[BusyBox] SIGSEGV problem

Erik Andersen andersen at lineo.com
Thu Jan 4 20:51:41 UTC 2001


On Thu Jan 04, 2001 at 02:37:02PM -0600, bgat at open-widgets.com wrote:
> Guys:
> 
> 
> I'm trying to run BusyBox 0.48 on a *very* spartan embedded Linux
> setup on an MBX860.  I'm trying to use BusyBox as a simple shell.  I'm
> not running tinylogin or anything else.
> 
> For some time, I've been having problems getting busybox's sh to run
> more than one command.  I finally decided to start looking into this,
> and what I found is that I'm getting a SIGSEGV at cmdedit.c:445.  The
> offending line looks like this:
> 
> 	memset(command, 0, BUFSIZ);
> 
> I grabbed a trace from gdb (attached), and I'm not seeing anything
> unusual--- an xcalloc call returns a pointer for the command buffer,
> and that pointer value is used without problems in the first
> invocation of cmdedit_read_input.  When it comes around to that
> function again, after running whatever command I've given it ("ls",
> usually), the same memset() causes the segfault.
> 
> I'm still digging into the sources, because I'm no BusyBox internals
> guru.  Is there something obvious going on here that I'm missing?
> 
> I had the same problem with 0.47.

Hmm.  Could you dig into this further for me.  Step one, install dmalloc
(http://dmalloc.com/) and enable DODMALLOC in the Makefile.  Recompile, then
run 'export DMALLOC_OPTIONS=debug=0x14f47d83,inter=100,log=logfile' (wierd, I
know -- just do it cuz it works) and then run gdb again.  dmalloc does
wonderful things when looking for wierd bugs like this, and is the best IMHO
open source malloc debugger/mem-leak finder out there.  Since you can reproduce
this ellusive bug, I'd really be glad to have your help in finding it.

I want this bug dead (as do a few others),

 -Erik

--
Erik B. Andersen   email:  andersen at lineo.com
--This message was written using 73% post-consumer electrons--





More information about the busybox mailing list