zsh-workers
 help / color / mirror / code / Atom feed
From: Anthony Heading <aheading@jpmorgan.com>
To: Peter Stephenson <pws@csr.com>
Cc: zsh-workers@sunsite.dk
Subject: Re: segfault in 4.1.1-test-2 [now with a different param expansion]
Date: Thu, 22 May 2003 12:48:51 +0900	[thread overview]
Message-ID: <20030522034850.GA1441@tkd-fires-02.ja.jpmorgan.com> (raw)
In-Reply-To: <20313.1053533019@csr.com>

On Wed, May 21, 2003 at 05:03:39PM +0100, Peter Stephenson wrote:
> I *hate* that function.

Heh. For me, even the manual page is more than enough.  So thanks!

Since the iron is hot, however...  see below  :-)

I'm probably missing something obvious here - At the point of the fault,
parameter 'a' of nstrpcmp is null, however it looks to me like it's
outside the range of the qsort??!  Maybe I don't believe the
debugger. Anyhow, both gcc 3.3 and Sun C v5 show the same behaviour,
but I couldn't reproduce the fault on Linux.  Also, though
the implications seem a bit odd, overriding qsort using
LD_PRELOAD seems to avoid the crash.

Again, let me know if I should to do more investigation.

Regards

Anthony


========================================================

fires-02% gdb Src/zsh
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.8"...
(gdb) run
Starting program: /tmp/zsh-4.1.1-test-2/Src/zsh 
fires-02% cd /tmp
fires-02% cat numbers
22829
29156
15632
19174
4296
10392
5297
6392
19035
24181
2494
20468
20513
14808
26229
fires-02% x=($(<numbers))
fires-02% echo ${(no)x}

Program received signal SIGSEGV, Segmentation fault.
0xff15c1b0 in __strcoll_std () from /usr/lib/libc.so.1
(gdb) where
#0  0xff15c1b0 in __strcoll_std () from /usr/lib/libc.so.1
#1  0x000a86b4 in nstrpcmp (a=0xff1e01dc, b=0xff1e01ec) at subst.c:550
#2  0xff14b07c in qsort () from /usr/lib/libc.so.1
#3  0x000af434 in paramsubst (l=0xff1e01a8, n=0xff1e01bc, str=0xffbed71c, qt=0, ssub=0) at subst.c:1991
#4  0x000a69b4 in stringsubst (list=0xff1e01a8, node=0xff1e01bc, ssub=0, asssub=0) at subst.c:137
#5  0x000a61d0 in prefork (list=0xff1e01a8, flags=1) at subst.c:74
#6  0x000331dc in execcmd (state=0xffbedc48, input=0, output=0, how=18, last1=2) at exec.c:1796
#7  0x00030cb0 in execpline2 (state=0xffbedc48, pcode=323, how=18, input=0, output=0, last1=0) at exec.c:1228
#8  0x0002fa78 in execpline (state=0xffbedc48, slcode=4098, how=18, last1=0) at exec.c:1018
#9  0x0002eec0 in execlist (state=0xffbedc48, dont_change_job=0, exiting=0) at exec.c:829
#10 0x0002e9d8 in execode (p=0xff1e0150, dont_change_job=0, exiting=0) at exec.c:730
#11 0x000545d4 in loop (toplevel=1, justonce=0) at init.c:167
#12 0x000587b4 in zsh_main (argc=1, argv=0xffbede54) at init.c:1239
#13 0x0001273c in main (argc=1, argv=0xffbede54) at main.c:37
(gdb) frame 3
#3  0x000af4d4 in paramsubst (l=0xff1e05a8, n=0xff1e05bc, str=0xffbed71c, qt=0, ssub=0) at subst.c:1998
1998                        qsort(aval, i, sizeof(char *), sortfn[sortit-1]);
(gdb) print aval
$32 = (char **) 0xff1e05e0
(gdb) print i
$33 = 15
(gdb) 


This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan Chase & Co., its
subsidiaries and affiliates.


  reply	other threads:[~2003-05-22  3:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-21 15:26 segfault in 4.1.1-test-2 with ${(u)${=:-$(echo yes yes)}} Anthony Heading
2003-05-21 16:03 ` Peter Stephenson
2003-05-22  3:48   ` Anthony Heading [this message]
2003-05-22 10:08     ` segfault in 4.1.1-test-2 [now with a different param expansion] 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=20030522034850.GA1441@tkd-fires-02.ja.jpmorgan.com \
    --to=aheading@jpmorgan.com \
    --cc=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /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).