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.

zsh's child dies in execute(), exec.c:243, when it tries to access
the empty argument list.  But there's more to this than only that:

The exit code doesn't make sense when command substitution happens
in command position, eg.

  % ./zsh -fc '$(true); echo $?'
  139
  % ./zsh -fc '$(false); echo $?'
  139

Both bash and pd-ksh say `0' and '1' here, respectively.  They both
give an exit code of `127' if the command isn't found.  What's the
Right Thing?

Regards,
--Thorsten




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