Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: seg fault on $(dgqhghdqwdhqwjq) : beta19



> > res1% $(wekdwqw)
> > zsh: command not found: wekdwqw
> > zsh: 21441 segmentation fault  $(wekdwqw)
> 
> It always happens when prefork() in execcmd() removes all arguments.
> Eg. $foo triggers the bug if foo is not set.  Richard did several changes
> related to this and I think this bug appeared with these changes.  Richard,
> could you check it?
> 
> Zoltan
> 

I recently removed the piece of code

    if (empty(args)) {
        zerr("no command", NULL, 0);
        _exit(1);
    }

from the beginning of execute() in exec.c since `args' should not
be empty at this point.  It appears this uncovered a bug higher up
the execution pipeline (this was my very intention, of course).
Rather than putting this piece of code back, we should probably fix
this in execcmd() or prefork().

There were a couple of other places I removed such checks.  I hate
these types of checks since they cover up bugs rather than fix them.
In my opinion, the check in dotrap() for errflag (which was recently
added) is in this category.  If errflag=1, then you shouldn't have
called dotrap in the first place.

rc





Messages sorted by: Reverse Date, Date, Thread, Author