zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: Complicated segfault regression
Date: Fri, 03 Jul 2015 12:35:40 +0100	[thread overview]
Message-ID: <20150703123540.6266a481@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <5595AEF8.3000508@inlv.org>

On Thu, 2 Jul 2015 23:36:56 +0200
Martijn Dekker <martijn@inlv.org> wrote:
> 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.

Thanks for trying to find this.  Based on Bart's clue that the text
representation is going wrong at some point to do with "case" , I've
narrowed it down a bit further... The following file, crash4.zsh

# --- begin crashing code block ---
fn() {
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb \
    | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
    *.* ) break;;
    * ) break;;
  esac
}
# --- end crashing code block ---

when sourced produces the following output for "which fn"
(I've used "-x 2", only recently made available):

(N.B. there's a long line I haven't attempted to wrap myself...)

fn () {
  case $ac_file in
    (*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj)  ;;
    (*.*) break
}

which has evidently gone haywiere (though this version wasn't
particularly crash prone), while the slightly further simplified
crash5.zsh:

# --- begin crashing code block ---
fn() {
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb ) ;;
    *.* ) break;;
    * ) break;;
  esac
}
# --- end crashing code block ---

doesn't show that effect:

fn () {
  case $ac_file in
    (*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb)  ;;
    (*.*) break ;;
    (*) break ;;
  esac
}

So the best guess so far is it's do with memory management of the long
case with the continuation line.

pws


  parent reply	other threads:[~2015-07-03 11:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-02 21:36 Martijn Dekker
2015-07-03  3:28 ` Bart Schaefer
2015-07-03 11:35 ` Peter Stephenson [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150703123540.6266a481@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).