sh (pid 1081) segfaults for page address 00000000 at pc 00000000

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Mon Jan 26 20:24:00 UTC 2009


On Mon, 26 Jan 2009, Cathey, Jim wrote:

> So you're looking at the string output of pidof?

Right.

> If proc's not there, I don't think that:
>
> 	if [ "" ]
>
> is highly meaningful.

/proc is there alright.

> (Hence the -z suggestion?)

Well, I dom't think that matters.
I've been doing that kind of evaluation everywhere since ages.
All these expressions:

	[ "" ]
	[ -n "" ]
	[ -z "" ]

evaluate correctly in all shells I use: bash, zsh, dash and ash (except
for maybe this time, on this version: 1.13.2).  I already have ash from bb
1.1.3 behaving as expected on the same box.

> When I use pidof to probe for a process, I use
> its exit status:
>
> 	if pidof <foo> >/dev/null

if [ "$(pidof <process name>)" ]

should return failure both if the pidof exit code is non-zero and when the
expression evaluates to the empty string.  That's the behaviour in all
shells I use.

The gdb backtrace I sent shows weird values for various variables.


Cheers,

-- 
Cristian


More information about the busybox mailing list