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

Re: zsh 4.3.4 released



On 23/04/07, Peter Stephenson <pws@xxxxxxx> wrote:
"Mikael Magnusson" <mikachu@xxxxxxxxx> wrote:
> I found a weird problem yesterday, if i type 'which svmode' after
> sourcing [1] (from zsh -f), zsh allocates all free memory then ooms.
> (so set ulimit -v 50000 or so before trying). The strange thing is it
> works fine if i cat the file and paste it in the terminal.
>
> [1] http://mikachu.ath.cx/slask/dot-zshurxvt

I haven't been able to get this to happen on various Linux systems or
Solaris 8.  The trace implies its happening in the code that recreates the
function in text for output.  Finding out where the final taddnl() is being
called from might help.  It's possibly an inconsistency with allocation
that's been hidden up to now.

Here it is with debug symbols,
taddnl () at text.c:42
42	    *tptr++ = c;
(gdb) bt
#0  taddnl () at text.c:42
#1  0x080dbe30 in gettext2 (state=0xafa162a0) at text.c:583
#2  0x080dcc39 in getpermtext (prog=0x8156710, c=0x8156754) at text.c:133
#3  0x0807f7f8 in printshfuncnode (hn=0x8156a68,
printflags=-1478367808) at hashtable.c:889
#4  0x0805c2ec in bin_whence (nam=0xa7edc820 "which", argv=0xafa164f0,
ops=0xafa16540, func=0)
   at builtin.c:3050
#5  0x0805335e in execbuiltin (args=0xa7edc820, bn=0x80f1728) at builtin.c:438
#6  0x080724c4 in execcmd (state=0xafa1ba40, input=0, output=0,
how=18, last1=2) at exec.c:2670
#7  0x08072725 in execpline2 (state=0xafa1ba40, pcode=0, how=18,
input=0, output=0, last1=0)
   at exec.c:1343
#8  0x08072ce3 in execpline (state=0xafa1ba40, slcode=33554432,
how=18, last1=0) at exec.c:1129
#9  0x08074715 in execlist (state=0xafa1ba40, dont_change_job=0,
exiting=0) at exec.c:935
#10 0x080748fa in execode (p=0xa7edc738, dont_change_job=0, exiting=0)
at exec.c:793
#11 0x0808904d in loop (toplevel=1, justonce=0) at init.c:180
#12 0x0808bec8 in zsh_main (argc=1, argv=0xafa1bb74) at init.c:1347
#13 0x08052d0e in main (argc=0, argv=0x0) at ./main.c:93

Here's another one,
Program received signal SIGSEGV, Segmentation fault.
0x080d0ce4 in taddchr (c=9) at text.c:42
42	    *tptr++ = c;
(gdb) bt
#0  0x080d0ce4 in taddchr (c=9) at text.c:42
#1  0x080d0ed9 in taddnl () at text.c:104
#2  0x080d1df7 in gettext2 (state=0xafcafe10) at text.c:583
#3  0x080d0f8a in getpermtext (prog=0x814c6f8, c=0x814c73c) at text.c:133
#4  0x08081057 in printshfuncnode (hn=0x814ca50, printflags=32) at
hashtable.c:889
#5  0x080619f7 in bin_whence (nam=0xa7f44790 "which", argv=0xafcb00a0,
ops=0xafcb00f0, func=0)
   at builtin.c:3050
#6  0x080536bd in execbuiltin (args=0xa7f44768, bn=0x80e73a8) at builtin.c:438
#7  0x0807496c in execcmd (state=0xafcb04d0, input=0, output=0,
how=18, last1=2) at exec.c:2670
#8  0x08070cd1 in execpline2 (state=0xafcb04d0, pcode=131, how=18,
input=0, output=0, last1=0)
   at exec.c:1343
#9  0x0806fc28 in execpline (state=0xafcb04d0, slcode=4098, how=18,
last1=0) at exec.c:1129
#10 0x0806f355 in execlist (state=0xafcb04d0, dont_change_job=0,
exiting=0) at exec.c:935
#11 0x0806ef63 in execode (p=0xa7f446a8, dont_change_job=0, exiting=0)
at exec.c:793
#12 0x0808996c in loop (toplevel=1, justonce=0) at init.c:180
#13 0x0808c470 in zsh_main (argc=1, argv=0xafcb0604) at init.c:1347
#14 0x08052d12 in main (argc=1, argv=0xafcb0604) at ./main.c:93

the first is with O3 and the second with O0 (in order of remembering
how to debug :)

--
Mikael Magnusson



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