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

Complicated segfault regression



Just for the hell of it I decided to make zsh 5.0.8 run a GNU
'configure' script (in sh mode) to see how far it would come with that
incredibly convoluted code. The result was a segfault. So I tried to
find the code that triggers it.

The following code block makes zsh 5.0.8 and current git zsh segfault
reliably. It's now completely non-operational because I've tried to
reduce it to the minimum necessary to make zsh crash.

The strange thing is, almost *any* change in the crashing code block
below will make it fail to produce a segfault. The 'if' is necessary.
All three clauses in the case statement are necessary. All the extension
tests in the first clause are necessary. The : with the parameter in
that form, with the variable, is necessary (this used to be a 'rm').
Even the { : ; } at the end is necessary. Change any of those and it
fails to segfault.

It doesn't seem to make a difference whether 'emulate sh' is used or
not, though.

Oh, and zsh 4.2.7 and 4.3.11 are fine.

I can't seem to narrow this down any further, but I figured it was worth
reporting anyway.

- M.

#! /usr/bin/env zsh
emulate sh
set -x

# --- begin crashing code block ---

if true; then
for ac_file in somestuff; do
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb \
    | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
    *.* ) break;;
    * ) break;;
  esac
  break
done
fi
: conftest$ac_cv_exeext
{ : ; }

# --- end crashing code block ---



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