From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Clint Adams <schizo@debian.org>, zsh-workers@sunsite.dk
Cc: Michal Politowski <mpol@charybda.icm.edu.pl>,
101523-forwarded@bugs.debian.org
Subject: Re: Bug#101523: zsh segmentation fault
Date: Wed, 20 Jun 2001 04:01:05 +0000 [thread overview]
Message-ID: <1010620040105.ZM1105@candle.brasslantern.com> (raw)
In-Reply-To: <20010619183324.A17427@dman.com>
On Jun 19, 6:33pm, Clint Adams wrote:
}
} I can reproduce this with zsh --no-equals -fx shoop.sh
It's happening when the `=' parameter is (not) restored upon exit from the
function. I'm not sure that's really the root cause, though. Trace below.
I will point out that there's a rather nasty bug in shoop.sh on line 61:
local orgargs="$@"
This will almost certainly not do what is wanted; it'll set orgargs to be
$1 and will make local variables whose names are the rest of the arguments.
Then later,
set -- $orgargs
will also not produce the desired effect.
------------
BUG: in restoring special parameters
zsh: segmentation fault (core dumped)
zagzig<11> gdb Src/zsh core
GNU gdb 4.17.0.4 with Linux/x86 hardware watchpoint and FPU support
Copyright 1998 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 "i386-redhat-linux"...
Core was generated by `Src/zsh -o noequals -fx /home/schaefer/Mail/detach.dir/shoop.sh'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libnsl.so.1...done.
Reading symbols from /usr/lib/libncurses.so.4...done.
Reading symbols from /lib/libm.so.6...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
Reading symbols from /lib/libnss_files.so.1...done.
#0 0x805f3c2 in restore_params (restorelist=0x40112580, removelist=0x40112588)
at ../../zsh-4.0/Src/exec.c:2439
2439 tpm->flags = pm->flags;
(gdb) where
#0 0x805f3c2 in restore_params (restorelist=0x40112580, removelist=0x40112588)
at ../../zsh-4.0/Src/exec.c:2439
#1 0x805eecc in execcmd (state=0xbffffaa8, input=0, output=0, how=18, last1=2)
at ../../zsh-4.0/Src/exec.c:2315
#2 0x805bacb in execpline2 (state=0xbffffaa8, pcode=5699, how=18, input=0,
output=0, last1=0) at ../../zsh-4.0/Src/exec.c:1192
#3 0x805b043 in execpline (state=0xbffffaa8, slcode=11266, how=18, last1=0)
at ../../zsh-4.0/Src/exec.c:982
#4 0x805a9dd in execlist (state=0xbffffaa8, dont_change_job=0, exiting=0)
at ../../zsh-4.0/Src/exec.c:826
#5 0x805a6f7 in execode (p=0x401122c8, dont_change_job=0, exiting=0)
at ../../zsh-4.0/Src/exec.c:729
#6 0x806fcd5 in loop (toplevel=1, justonce=0) at ../../zsh-4.0/Src/init.c:160
#7 0x80724b4 in zsh_main (argc=5, argv=0xbffffb38)
at ../../zsh-4.0/Src/init.c:1209
#8 0x804a8b4 in main (argc=5, argv=0xbffffb38) at ../../zsh-4.0/Src/main.c:37
(gdb) p pm
$1 = (struct param *) 0x40112590
(gdb) p *pm
$2 = {next = 0x40112568, nam = 0x8124bbc "=", flags = 786432, u = {
data = 0x8137640, arr = 0x8137640, str = 0x8137640 " ",
val = 7309465757271946816, dval = 4.2633628668410461e+180,
hash = 0x8137640}, sets = {cfn = 0x998b646e, ifn = 0x998b646e,
ffn = 0x998b646e, afn = 0x998b646e, hfn = 0x998b646e}, gets = {cfn = 0x99,
ifn = 0x99, ffn = 0x99, afn = 0x99, hfn = 0x99}, unsetfn = 0, ct = 0,
env = 0x0, ename = 0x0, old = 0x0, level = 1074866392}
(gdb) p tpm
$3 = (struct param *) 0x0
(gdb) l
2434 Param tpm = (Param) paramtab->getnode(paramtab, pm->nam);
2435
2436 DPUTS(!tpm || PM_TYPE(pm->flags) != PM_TYPE(tpm->flags) ||
2437 !(pm->flags & PM_SPECIAL),
2438 "BUG: in restoring special parameters");
2439 tpm->flags = pm->flags;
2440 switch (PM_TYPE(pm->flags)) {
2441 case PM_SCALAR:
2442 tpm->sets.cfn(tpm, pm->u.str);
2443 break;
(gdb) p pm->nam
$4 = 0x8124bbc "="
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
next prev parent reply other threads:[~2001-06-20 4:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20010619225633.A7077@Amber.lab.icm.edu.pl>
2001-06-19 22:33 ` Clint Adams
2001-06-20 4:01 ` Bart Schaefer [this message]
2001-06-20 6:51 ` Andrej Borsenkow
2001-06-20 7:59 ` Andrej Borsenkow
2001-06-20 16:47 ` KSH_TYPESET and 4.0.2 Bart Schaefer
2001-06-20 18:33 ` Peter Stephenson
2001-06-20 16:04 ` Bug#101523: zsh segmentation fault Bart Schaefer
2001-06-20 10:01 ` Peter Stephenson
2001-06-20 10:10 ` Peter Stephenson
2001-06-20 4:57 ` Bart Schaefer
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=1010620040105.ZM1105@candle.brasslantern.com \
--to=schaefer@candle.brasslantern.com \
--cc=101523-forwarded@bugs.debian.org \
--cc=mpol@charybda.icm.edu.pl \
--cc=schizo@debian.org \
--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).