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

Re: Bug Report: Env Vars and shell functions



Zoltan wrote:
> The patch below should fix that.  It also removes the first hunk of my
> previous patch since it is not necessary.

With  1573, 1596 and 1598 applied to pre-2, not that these are likely relevant,
I get a segfault with the following

sun4% zsh -c xyzzy 
hello
zsh: 18399 segmentation fault  zsh -c xyzzy

where xyzzy is an autoloaded function containing

#!/usr/local/bin/zsh
. thing

and `thing' is a file reading

echo hello

Traceback attached.  None of the alloc_stackp related patches applied, since
they seemed all to be cosmetic.

On a related note, should the following not restore IFS?

sun4% IFS=@ set a@b@c@d; echo $IFS 
@

And finally, why doesn't this work?
sun4% local x=($(date))
zsh: not an identifier: 10 BST 1996)

I think this stops one saying IFS=@ local x=($(blaa)) using local, or
perhaps the even more vanilla typeset -t, as a way of making the
change to x permanent but restoring IFS.  Though maybe my whole notion
was flawed -- I was trying to split a command output into lines, but
the various expansions that happen after command substitution "corrupt"
the data.

Ah. Another core dump:
sun4% $(grep[TAB][TAB]
Program received signal SIGSEGV, Segmentation fault.
0x6ff8128c in _doprnt ()
#2  0x9afd0 in doexpandhist () at zle_tricky.c:3817
3817        DPUTS(useheap, "BUG: useheap in doexpandhist()");

Hmm. Time I went home.

Cheers

Anthony

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

sun4% gdb zsh
GDB is free software and you are welcome to 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.
GDB 4.15.1 (sparc-sun-sunos4.1.3_U1), Copyright 1995 Free Software Foundation, Inc...
(gdb) run -c xyzzy
Starting program: /tmp_mnt/home/research/aheading/build/zsh-3.0-pre2/Src/zsh -c xyzzy
hello

Program received signal SIGSEGV, Segmentation fault.
0x6ff8128c in _doprnt ()
(gdb) where
#0  0x6ff8128c in _doprnt ()
#1  0x6ff835c4 in fprintf ()
#2  0x3c04c in loop (toplevel=0) at init.c:131
#3  0x3e4fc in source (s=0xefffe9f0 "thing") at init.c:779
#4  0x16080 in bin_dot (name=0xbdc64 ".", argv=0xbdccc, ops=0xefffeea8 "", func=0) at builtin.c:4657
#5  0x2d10 in execbuiltin (args=0xbdc5c, bn=0xafc1c) at builtin.c:189
#6  0x22980 in execcmd (cmd=0xbdc3c, input=0, output=0, how=2, last1=2) at exec.c:1611
#7  0x1f0ec in execpline2 (pline=0xbdcac, how=2, input=0, output=0, last1=0) at exec.c:781
#8  0x1e600 in execpline (l=0xbdc98, how=2, last1=0) at exec.c:627
#9  0x1e0ec in execlist (list=0xbdc88, dont_change_job=1, exiting=0) at exec.c:508
#10 0x25878 in doshfunc (list=0xc0288, doshargs=0xbdbf8, flags=0, noreturnval=0) at exec.c:2422
#11 0x25464 in execshfunc (cmd=0xbdbd8, shf=0xc5520) at exec.c:2349
#12 0x22944 in execcmd (cmd=0xbdbd8, input=0, output=0, how=2, last1=1) at exec.c:1600
#13 0x1f0ec in execpline2 (pline=0xbdc1c, how=2, input=0, output=0, last1=1) at exec.c:781
#14 0x1e600 in execpline (l=0xbdbc4, how=2, last1=1) at exec.c:627
#15 0x1e0ec in execlist (list=0xbdc2c, dont_change_job=0, exiting=1) at exec.c:508
#16 0x1df50 in execstring (s=0xeffff916 "xyzzy", dont_change_job=0, exiting=1) at exec.c:466
#17 0x3e324 in init_misc () at init.c:738
#18 0x3bd5c in main (argc=3, argv=0xeffff844) at init.c:73
(gdb) frame 2
#2  0x3c04c in loop (toplevel=0) at init.c:131
131             DPUTS(alloc_stackp, "BUG: alloc_stackp != 0 in loop()");
(gdb) print alloc_stackp
$1 = 1

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




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