zsh-workers
 help / color / mirror / code / Atom feed
* Complicated segfault regression
@ 2015-07-02 21:36 Martijn Dekker
  2015-07-03  3:28 ` Bart Schaefer
  2015-07-03 11:35 ` Peter Stephenson
  0 siblings, 2 replies; 10+ messages in thread
From: Martijn Dekker @ 2015-07-02 21:36 UTC (permalink / raw)
  To: zsh-workers

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 ---


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-07-05 11:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-02 21:36 Complicated segfault regression Martijn Dekker
2015-07-03  3:28 ` Bart Schaefer
2015-07-03 11:35 ` Peter Stephenson
2015-07-03 12:29   ` Martijn Dekker
2015-07-03 13:44     ` Peter Stephenson
2015-07-03 17:52       ` Martijn Dekker
2015-07-03 22:11       ` Peter Stephenson
2015-07-04 10:03         ` Peter Stephenson
2015-07-05 11:06         ` Peter Stephenson
2015-07-05 11:15           ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).