* Crash while testing a completion: trap handlers and malloc?
@ 1999-09-18 23:47 Bart Schaefer
0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 1999-09-18 23:47 UTC (permalink / raw)
To: zsh-workers
In the same shell where I'd been testing my patch from 7929, I was fooling
with the _mailboxes updates I sent in 7932. I typed "mutt -f <TAB>" and
got a core dump with the following huge stack trace. Note that the SIGALRM
trap handler is being called (so it's a TMOUT thing) and further that it is
being called during zalloc(). This is bad news, as the malloc() arena is
not re-entrant in most implementations.
I think that's probably the cause of the crash, but I've included the whole
traceback for completeness.
#0 0x400718f6 in chunk_free (ar_ptr=0x400c6420, p=0x8221f00) at malloc.c:2945
#1 0x40070fea in malloc_extend_top (ar_ptr=0x400c6420, nb=144)
at malloc.c:2464
#2 0x40071635 in chunk_alloc (ar_ptr=0x400c6420, nb=144) at malloc.c:2793
#3 0x400710c5 in __libc_malloc (bytes=136) at malloc.c:2561
#4 0x806e434 in lexsave () at ../../zsh-3.1.6/Src/lex.c:205
#5 0x8087b52 in dotrapargs (sig=14, sigtr=0x80eedec, sigfn=0x810f168)
at ../../zsh-3.1.6/Src/signals.c:882
#6 0x8087d8a in dotrap (sig=14) at ../../zsh-3.1.6/Src/signals.c:931
#7 0x8087090 in handler (sig=14) at ../../zsh-3.1.6/Src/signals.c:525
#8 <signal handler called>
#9 chunk_alloc (ar_ptr=0x400c6420, nb=16) at malloc.c:2801
#10 0x400710c5 in __libc_malloc (bytes=4) at malloc.c:2561
#11 0x8075c04 in zalloc (size=4) at ../../zsh-3.1.6/Src/mem.c:436
#12 0x8075d4e in dupstring (s=0x816aa60 "tmp") at ../../zsh-3.1.6/Src/mem.c:500
#13 0x809290d in dupstruct (a=0x816ab98) at ../../zsh-3.1.6/Src/utils.c:1980
#14 0x8092cc0 in duplist (l=0x816ace0, func=0x80927f0 <dupstruct>)
at ../../zsh-3.1.6/Src/utils.c:2103
#15 0x8092926 in dupstruct (a=0x816ab78) at ../../zsh-3.1.6/Src/utils.c:1983
#16 0x80928f5 in dupstruct (a=0x816acf8) at ../../zsh-3.1.6/Src/utils.c:1977
#17 0x80928f5 in dupstruct (a=0x816ab60) at ../../zsh-3.1.6/Src/utils.c:1977
#18 0x80928f5 in dupstruct (a=0x816ad08) at ../../zsh-3.1.6/Src/utils.c:1977
#19 0x8092d59 in duparray (arr=0x816c404, func=0x80927f0 <dupstruct>)
at ../../zsh-3.1.6/Src/utils.c:2118
#20 0x809296a in dupstruct (a=0x816c3e8) at ../../zsh-3.1.6/Src/utils.c:1989
#21 0x80928f5 in dupstruct (a=0x816a768) at ../../zsh-3.1.6/Src/utils.c:1977
#22 0x80928f5 in dupstruct (a=0x816c408) at ../../zsh-3.1.6/Src/utils.c:1977
#23 0x80928f5 in dupstruct (a=0x816a750) at ../../zsh-3.1.6/Src/utils.c:1977
#24 0x80928f5 in dupstruct (a=0x816c418) at ../../zsh-3.1.6/Src/utils.c:1977
#25 0x80928f5 in dupstruct (a=0x816a640) at ../../zsh-3.1.6/Src/utils.c:1977
#26 0x80928f5 in dupstruct (a=0x816a388) at ../../zsh-3.1.6/Src/utils.c:1977
#27 0x80928f5 in dupstruct (a=0x816a1f8) at ../../zsh-3.1.6/Src/utils.c:1977
#28 0x80928f5 in dupstruct (a=0x8169f20) at ../../zsh-3.1.6/Src/utils.c:1977
#29 0x80928f5 in dupstruct (a=0x8169c60) at ../../zsh-3.1.6/Src/utils.c:1977
#30 0x80928f5 in dupstruct (a=0x81699a0) at ../../zsh-3.1.6/Src/utils.c:1977
#31 0x80928f5 in dupstruct (a=0x8169830) at ../../zsh-3.1.6/Src/utils.c:1977
#32 0x80928f5 in dupstruct (a=0x8169698) at ../../zsh-3.1.6/Src/utils.c:1977
#33 0x80928f5 in dupstruct (a=0x8169110) at ../../zsh-3.1.6/Src/utils.c:1977
#34 0x80928f5 in dupstruct (a=0x81690f0) at ../../zsh-3.1.6/Src/utils.c:1977
#35 0x80928f5 in dupstruct (a=0x816f238) at ../../zsh-3.1.6/Src/utils.c:1977
#36 0x80928f5 in dupstruct (a=0x81690d8) at ../../zsh-3.1.6/Src/utils.c:1977
#37 0x80928f5 in dupstruct (a=0x816f248) at ../../zsh-3.1.6/Src/utils.c:1977
#38 0x80928f5 in dupstruct (a=0x81690c8) at ../../zsh-3.1.6/Src/utils.c:1977
#39 0x80928f5 in dupstruct (a=0x81689b8) at ../../zsh-3.1.6/Src/utils.c:1977
#40 0x80928f5 in dupstruct (a=0x8167cf8) at ../../zsh-3.1.6/Src/utils.c:1977
#41 0x80928f5 in dupstruct (a=0x8167268) at ../../zsh-3.1.6/Src/utils.c:1977
#42 0x80928f5 in dupstruct (a=0x8166f38) at ../../zsh-3.1.6/Src/utils.c:1977
#43 0x80928f5 in dupstruct (a=0x8162f00) at ../../zsh-3.1.6/Src/utils.c:1977
#44 0x80928f5 in dupstruct (a=0x8162d70) at ../../zsh-3.1.6/Src/utils.c:1977
#45 0x80928f5 in dupstruct (a=0x8162be0) at ../../zsh-3.1.6/Src/utils.c:1977
#46 0x80928f5 in dupstruct (a=0x8162838) at ../../zsh-3.1.6/Src/utils.c:1977
#47 0x80928f5 in dupstruct (a=0x8162690) at ../../zsh-3.1.6/Src/utils.c:1977
#48 0x80928f5 in dupstruct (a=0x8162300) at ../../zsh-3.1.6/Src/utils.c:1977
#49 0x8092d59 in duparray (arr=0x816f3bc, func=0x80927f0 <dupstruct>)
at ../../zsh-3.1.6/Src/utils.c:2118
#50 0x809296a in dupstruct (a=0x816f3a0) at ../../zsh-3.1.6/Src/utils.c:1989
#51 0x80928f5 in dupstruct (a=0x8161758) at ../../zsh-3.1.6/Src/utils.c:1977
#52 0x80928f5 in dupstruct (a=0x816f3c0) at ../../zsh-3.1.6/Src/utils.c:1977
#53 0x80928f5 in dupstruct (a=0x8161740) at ../../zsh-3.1.6/Src/utils.c:1977
#54 0x80928f5 in dupstruct (a=0x816f3d0) at ../../zsh-3.1.6/Src/utils.c:1977
#55 0x80928f5 in dupstruct (a=0x8161630) at ../../zsh-3.1.6/Src/utils.c:1977
#56 0x80928f5 in dupstruct (a=0x8160ad8) at ../../zsh-3.1.6/Src/utils.c:1977
#57 0x80928f5 in dupstruct (a=0x8160938) at ../../zsh-3.1.6/Src/utils.c:1977
#58 0x80928f5 in dupstruct (a=0x815fa10) at ../../zsh-3.1.6/Src/utils.c:1977
#59 0x8092d59 in duparray (arr=0x816fccc, func=0x80927f0 <dupstruct>)
at ../../zsh-3.1.6/Src/utils.c:2118
#60 0x809296a in dupstruct (a=0x816fcb0) at ../../zsh-3.1.6/Src/utils.c:1989
#61 0x80928f5 in dupstruct (a=0x815f4b8) at ../../zsh-3.1.6/Src/utils.c:1977
#62 0x80928f5 in dupstruct (a=0x816fcd0) at ../../zsh-3.1.6/Src/utils.c:1977
#63 0x80928f5 in dupstruct (a=0x815f4a0) at ../../zsh-3.1.6/Src/utils.c:1977
#64 0x80928f5 in dupstruct (a=0x816fce0) at ../../zsh-3.1.6/Src/utils.c:1977
#65 0x80928f5 in dupstruct (a=0x815f390) at ../../zsh-3.1.6/Src/utils.c:1977
#66 0x80928f5 in dupstruct (a=0x815f1f0) at ../../zsh-3.1.6/Src/utils.c:1977
#67 0x80928f5 in dupstruct (a=0x818d7a0) at ../../zsh-3.1.6/Src/utils.c:1977
#68 0x80928f5 in dupstruct (a=0x818d5f0) at ../../zsh-3.1.6/Src/utils.c:1977
#69 0x80928f5 in dupstruct (a=0x818d320) at ../../zsh-3.1.6/Src/utils.c:1977
#70 0x80928f5 in dupstruct (a=0x818cf68) at ../../zsh-3.1.6/Src/utils.c:1977
#71 0x80928f5 in dupstruct (a=0x818ccb8) at ../../zsh-3.1.6/Src/utils.c:1977
#72 0x8092d59 in duparray (arr=0x81c6e34, func=0x80927f0 <dupstruct>)
at ../../zsh-3.1.6/Src/utils.c:2118
#73 0x809296a in dupstruct (a=0x81c6e18) at ../../zsh-3.1.6/Src/utils.c:1989
#74 0x80928f5 in dupstruct (a=0x818c410) at ../../zsh-3.1.6/Src/utils.c:1977
#75 0x80928f5 in dupstruct (a=0x81c6e38) at ../../zsh-3.1.6/Src/utils.c:1977
#76 0x80928f5 in dupstruct (a=0x818c3f8) at ../../zsh-3.1.6/Src/utils.c:1977
#77 0x80928f5 in dupstruct (a=0x81c6e48) at ../../zsh-3.1.6/Src/utils.c:1977
#78 0x80928f5 in dupstruct (a=0x818c2e8) at ../../zsh-3.1.6/Src/utils.c:1977
#79 0x80928f5 in dupstruct (a=0x818bb18) at ../../zsh-3.1.6/Src/utils.c:1977
#80 0x80928f5 in dupstruct (a=0x818b020) at ../../zsh-3.1.6/Src/utils.c:1977
#81 0x80928f5 in dupstruct (a=0x81ac7f0) at ../../zsh-3.1.6/Src/utils.c:1977
#82 0x80928f5 in dupstruct (a=0x81ac3d8) at ../../zsh-3.1.6/Src/utils.c:1977
#83 0x80928f5 in dupstruct (a=0x81ab388) at ../../zsh-3.1.6/Src/utils.c:1977
#84 0x805be42 in execautofn (cmd=0x818e7a0, args=0x0, flags=0)
at ../../zsh-3.1.6/Src/exec.c:2907
#85 0x8059af1 in execcmd (cmd=0x818e7a0, input=0, output=0, how=2, last1=2)
at ../../zsh-3.1.6/Src/exec.c:1985
#86 0x80571f6 in execpline2 (pline=0x818e7c8, how=2, input=0, output=0,
last1=0) at ../../zsh-3.1.6/Src/exec.c:1060
#87 0x8056747 in execpline (l=0x818e7e0, how=2, last1=0)
at ../../zsh-3.1.6/Src/exec.c:875
#88 0x805630b in execlist (list=0x818e7f8, dont_change_job=1, exiting=0)
at ../../zsh-3.1.6/Src/exec.c:744
#89 0x805c24f in runshfunc (list=0x818e7f8, wrap=0x0,
name=0x818e810 "_arguments") at ../../zsh-3.1.6/Src/exec.c:3036
#90 0x809e645 in comp_wrapper (list=0x818e7f8, w=0x0,
name=0x818e810 "_arguments") at ../../../zsh-3.1.6/Src/Zle/compctl.c:2435
#91 0x805c202 in runshfunc (list=0x818e7f8, wrap=0x80d4be4,
name=0x818e810 "_arguments") at ../../zsh-3.1.6/Src/exec.c:3023
#92 0x805c078 in doshfunc (name=0x818e810 "_arguments", list=0x818e7f8,
doshargs=0x81aabb8, flags=8704, noreturnval=0)
at ../../zsh-3.1.6/Src/exec.c:2973
#93 0x805bc90 in execshfunc (cmd=0x8177df0, shf=0x818e778, args=0x81aabb8)
at ../../zsh-3.1.6/Src/exec.c:2864
#94 0x8059c78 in execcmd (cmd=0x8177df0, input=0, output=0, how=2, last1=2)
at ../../zsh-3.1.6/Src/exec.c:2022
#95 0x80571f6 in execpline2 (pline=0x8177dd8, how=2, input=0, output=0,
last1=0) at ../../zsh-3.1.6/Src/exec.c:1060
#96 0x8056747 in execpline (l=0x8177dc0, how=2, last1=0)
at ../../zsh-3.1.6/Src/exec.c:875
#97 0x8056329 in execlist (list=0x8177da8, dont_change_job=1, exiting=0)
at ../../zsh-3.1.6/Src/exec.c:750
#98 0x805be93 in execautofn (cmd=0x8191928, args=0x0, flags=0)
at ../../zsh-3.1.6/Src/exec.c:2911
#99 0x8059af1 in execcmd (cmd=0x8191928, input=0, output=0, how=2, last1=2)
at ../../zsh-3.1.6/Src/exec.c:1985
#100 0x80571f6 in execpline2 (pline=0x8191950, how=2, input=0, output=0,
last1=0) at ../../zsh-3.1.6/Src/exec.c:1060
#101 0x8056747 in execpline (l=0x8191968, how=2, last1=0)
at ../../zsh-3.1.6/Src/exec.c:875
#102 0x805630b in execlist (list=0x8191980, dont_change_job=1, exiting=0)
at ../../zsh-3.1.6/Src/exec.c:744
#103 0x805c24f in runshfunc (list=0x8191980, wrap=0x0, name=0x8191998 "_mutt")
at ../../zsh-3.1.6/Src/exec.c:3036
#104 0x809e645 in comp_wrapper (list=0x8191980, w=0x0, name=0x8191998 "_mutt")
at ../../../zsh-3.1.6/Src/Zle/compctl.c:2435
#105 0x805c202 in runshfunc (list=0x8191980, wrap=0x80d4be4,
name=0x8191998 "_mutt") at ../../zsh-3.1.6/Src/exec.c:3023
#106 0x805c078 in doshfunc (name=0x8191998 "_mutt", list=0x8191980,
doshargs=0x8185ac0, flags=8704, noreturnval=0)
at ../../zsh-3.1.6/Src/exec.c:2973
#107 0x805bc90 in execshfunc (cmd=0x8148ae8, shf=0x8191900, args=0x8185ac0)
at ../../zsh-3.1.6/Src/exec.c:2864
#108 0x8059c78 in execcmd (cmd=0x8148ae8, input=0, output=0, how=2, last1=2)
at ../../zsh-3.1.6/Src/exec.c:2022
#109 0x80571f6 in execpline2 (pline=0x8148ad0, how=2, input=0, output=0,
last1=0) at ../../zsh-3.1.6/Src/exec.c:1060
#110 0x8056747 in execpline (l=0x8148ab8, how=2, last1=0)
at ../../zsh-3.1.6/Src/exec.c:875
#111 0x8056329 in execlist (list=0x8148aa0, dont_change_job=1, exiting=0)
at ../../zsh-3.1.6/Src/exec.c:750
#112 0x8072d94 in execif (cmd=0x81488e8, args=0x0, flags=0)
at ../../zsh-3.1.6/Src/loop.c:409
#113 0x8059af1 in execcmd (cmd=0x81488e8, input=0, output=0, how=2, last1=2)
at ../../zsh-3.1.6/Src/exec.c:1985
#114 0x80571f6 in execpline2 (pline=0x81488d0, how=2, input=0, output=0,
last1=0) at ../../zsh-3.1.6/Src/exec.c:1060
#115 0x8056747 in execpline (l=0x81488b8, how=2, last1=0)
at ../../zsh-3.1.6/Src/exec.c:875
#116 0x805630b in execlist (list=0x81488a0, dont_change_job=1, exiting=0)
at ../../zsh-3.1.6/Src/exec.c:744
#117 0x805c24f in runshfunc (list=0x8146860, wrap=0x0,
name=0x8191a40 "_normal") at ../../zsh-3.1.6/Src/exec.c:3036
#118 0x809e645 in comp_wrapper (list=0x8146860, w=0x0,
name=0x8191a40 "_normal") at ../../../zsh-3.1.6/Src/Zle/compctl.c:2435
#119 0x805c202 in runshfunc (list=0x8146860, wrap=0x80d4be4,
name=0x8191a40 "_normal") at ../../zsh-3.1.6/Src/exec.c:3023
#120 0x805c078 in doshfunc (name=0x8191a40 "_normal", list=0x8146860,
doshargs=0x8184ca8, flags=8192, noreturnval=0)
at ../../zsh-3.1.6/Src/exec.c:2973
#121 0x805bc90 in execshfunc (cmd=0x817a098, shf=0x81919a8, args=0x8184ca8)
at ../../zsh-3.1.6/Src/exec.c:2864
#122 0x8059c78 in execcmd (cmd=0x817a098, input=0, output=0, how=2, last1=2)
at ../../zsh-3.1.6/Src/exec.c:2022
#123 0x80571f6 in execpline2 (pline=0x817a080, how=2, input=0, output=0,
last1=0) at ../../zsh-3.1.6/Src/exec.c:1060
#124 0x8056747 in execpline (l=0x817a068, how=2, last1=0)
at ../../zsh-3.1.6/Src/exec.c:875
#125 0x805630b in execlist (list=0x817a050, dont_change_job=1, exiting=0)
at ../../zsh-3.1.6/Src/exec.c:744
#126 0x8072d94 in execif (cmd=0x8179f40, args=0x0, flags=0)
at ../../zsh-3.1.6/Src/loop.c:409
#127 0x8059af1 in execcmd (cmd=0x8179f40, input=0, output=0, how=2, last1=2)
at ../../zsh-3.1.6/Src/exec.c:1985
#128 0x80571f6 in execpline2 (pline=0x8179f28, how=2, input=0, output=0,
last1=0) at ../../zsh-3.1.6/Src/exec.c:1060
#129 0x8056747 in execpline (l=0x8179f10, how=2, last1=0)
at ../../zsh-3.1.6/Src/exec.c:875
#130 0x805630b in execlist (list=0x8179ef8, dont_change_job=1, exiting=0)
at ../../zsh-3.1.6/Src/exec.c:744
#131 0x805c24f in runshfunc (list=0x811a178, wrap=0x0,
name=0x818f330 "_complete") at ../../zsh-3.1.6/Src/exec.c:3036
#132 0x809e645 in comp_wrapper (list=0x811a178, w=0x0,
name=0x818f330 "_complete") at ../../../zsh-3.1.6/Src/Zle/compctl.c:2435
#133 0x805c202 in runshfunc (list=0x811a178, wrap=0x80d4be4,
name=0x818f330 "_complete") at ../../zsh-3.1.6/Src/exec.c:3023
#134 0x805c078 in doshfunc (name=0x818f330 "_complete", list=0x811a178,
doshargs=0x81848f8, flags=8192, noreturnval=0)
at ../../zsh-3.1.6/Src/exec.c:2973
#135 0x805bc90 in execshfunc (cmd=0x812d618, shf=0x818f298, args=0x81848f8)
at ../../zsh-3.1.6/Src/exec.c:2864
#136 0x8059c78 in execcmd (cmd=0x812d618, input=0, output=0, how=2, last1=2)
at ../../zsh-3.1.6/Src/exec.c:2022
#137 0x80571f6 in execpline2 (pline=0x812db18, how=2, input=0, output=0,
last1=0) at ../../zsh-3.1.6/Src/exec.c:1060
#138 0x8056747 in execpline (l=0x812db00, how=2, last1=0)
at ../../zsh-3.1.6/Src/exec.c:875
#139 0x805630b in execlist (list=0x812dae8, dont_change_job=1, exiting=0)
at ../../zsh-3.1.6/Src/exec.c:744
#140 0x8072ccf in execif (cmd=0x812ded0, args=0x0, flags=0)
at ../../zsh-3.1.6/Src/loop.c:397
#141 0x8059af1 in execcmd (cmd=0x812ded0, input=0, output=0, how=2, last1=2)
at ../../zsh-3.1.6/Src/exec.c:1985
#142 0x80571f6 in execpline2 (pline=0x812deb8, how=2, input=0, output=0,
last1=0) at ../../zsh-3.1.6/Src/exec.c:1060
#143 0x8056747 in execpline (l=0x812f500, how=2, last1=0)
at ../../zsh-3.1.6/Src/exec.c:875
#144 0x805630b in execlist (list=0x812f4e8, dont_change_job=1, exiting=0)
at ../../zsh-3.1.6/Src/exec.c:744
#145 0x80721b8 in execfor (cmd=0x812f5e0, args=0x81848b8, flags=0)
at ../../zsh-3.1.6/Src/loop.c:117
#146 0x8059af1 in execcmd (cmd=0x812f5e0, input=0, output=0, how=2, last1=2)
at ../../zsh-3.1.6/Src/exec.c:1985
#147 0x80571f6 in execpline2 (pline=0x812f5c8, how=2, input=0, output=0,
last1=0) at ../../zsh-3.1.6/Src/exec.c:1060
#148 0x8056747 in execpline (l=0x812f6a0, how=2, last1=0)
at ../../zsh-3.1.6/Src/exec.c:875
#149 0x805630b in execlist (list=0x812f688, dont_change_job=1, exiting=0)
at ../../zsh-3.1.6/Src/exec.c:744
#150 0x805c24f in runshfunc (list=0x8189380, wrap=0x0,
name=0x81896b8 "_main_complete") at ../../zsh-3.1.6/Src/exec.c:3036
#151 0x809e645 in comp_wrapper (list=0x8189380, w=0x0,
name=0x81896b8 "_main_complete")
at ../../../zsh-3.1.6/Src/Zle/compctl.c:2435
#152 0x805c202 in runshfunc (list=0x8189380, wrap=0x80d4be4,
name=0x81896b8 "_main_complete") at ../../zsh-3.1.6/Src/exec.c:3023
#153 0x805c078 in doshfunc (name=0x81896b8 "_main_complete", list=0x8189380,
doshargs=0x0, flags=0, noreturnval=0) at ../../zsh-3.1.6/Src/exec.c:2973
#154 0x80bb245 in callcompfunc (s=0x80f4618 "", fn=0x81896b8 "_main_complete")
at ../../../zsh-3.1.6/Src/Zle/zle_tricky.c:4922
#155 0x80bb931 in makecomplist (s=0x80f4618 "", incmd=0, lst=0)
at ../../../zsh-3.1.6/Src/Zle/zle_tricky.c:5081
#156 0x80ba3b5 in docompletion (s=0x814da28 "", lst=0, incmd=0)
at ../../../zsh-3.1.6/Src/Zle/zle_tricky.c:4592
#157 0x80b1f73 in docomplete (lst=0)
at ../../../zsh-3.1.6/Src/Zle/zle_tricky.c:1091
#158 0x80b0933 in expandorcomplete (args=0x80d7d2c)
at ../../../zsh-3.1.6/Src/Zle/zle_tricky.c:495
#159 0x80b0627 in completecall (args=0x80d7d2c)
at ../../../zsh-3.1.6/Src/Zle/zle_tricky.c:394
#160 0x80a85b1 in execzlefunc (func=0x80d5d18, args=0x80d7d2c)
at ../../../zsh-3.1.6/Src/Zle/zle_main.c:628
#161 0x80a817c in zleread (lp=0x81015a0 "%m<%h> ", rp=0x0, flags=3)
at ../../../zsh-3.1.6/Src/Zle/zle_main.c:547
#162 0x806a2be in inputline () at ../../zsh-3.1.6/Src/input.c:265
#163 0x806a1b1 in ingetc () at ../../zsh-3.1.6/Src/input.c:210
#164 0x8064374 in ihgetc () at ../../zsh-3.1.6/Src/hist.c:242
#165 0x806eff3 in gettok () at ../../zsh-3.1.6/Src/lex.c:545
#166 0x806e871 in yylex () at ../../zsh-3.1.6/Src/lex.c:308
#167 0x807d288 in parse_event () at ../../zsh-3.1.6/Src/parse.c:105
#168 0x806828a in loop (toplevel=1, justonce=0)
at ../../zsh-3.1.6/Src/init.c:113
#169 0x804a4c9 in main (argc=1, argv=0xbffff6b4)
at ../../zsh-3.1.6/Src/main.c:89
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Crash while testing a completion: trap handlers and malloc?
1999-09-21 9:05 Sven Wischnowsky
@ 1999-09-21 16:44 ` Bart Schaefer
0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 1999-09-21 16:44 UTC (permalink / raw)
To: Sven Wischnowsky, zsh-workers
On Sep 21, 11:05am, Sven Wischnowsky wrote:
} Subject: Re: Crash while testing a completion: trap handlers and malloc?
}
} Bart Schaefer wrote:
}
} > got a core dump with the following huge stack trace. Note that the SIGALRM
} > trap handler is being [...] called during zalloc().
}
} I think the library should take care of this, but maybe if we move the
} (|un)queue_signals() calls from our malloc down into zalloc() and friends?
This was discussed a very long time ago (when the zsh memory routines were
first introduced) and rejected by Zoltan on the grounds that it made it too
slow to call malloc(). There are a couple mentions of this in the mailing
list archives (e.g. zsh-workers/291 (yes, two hundred ninety one) and 1441)
but the real discussion was on the old, pre-archives zsh-list.
Given the recent changes that reduce the number of allocation calls that
zsh makes in normal operation, and given that zhalloc() already contains
queue_signals() calls, I wouldn't object to queuing signals around every
possible call to malloc().
Note, however, that the calls in zhalloc() are needed independently, to
protect zsh's own internal heap pointers from being garbled by a signal
handler. So if we added queue_signals() calls lower down, we'd have to
be sure that they "nest" properly with the ones in zhalloc(), so that an
unqueue_signals() at a lower level doesn't prematurely allow signals into
zhalloc(). (Remember the similar problems with child_block() that had to
be worked around earlier in the 3.1.5-pws-* cycle?)
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Crash while testing a completion: trap handlers and malloc?
@ 1999-09-21 9:05 Sven Wischnowsky
1999-09-21 16:44 ` Bart Schaefer
0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 1999-09-21 9:05 UTC (permalink / raw)
To: zsh-workers
Bart Schaefer wrote:
> In the same shell where I'd been testing my patch from 7929, I was fooling
> with the _mailboxes updates I sent in 7932. I typed "mutt -f <TAB>" and
> got a core dump with the following huge stack trace. Note that the SIGALRM
> trap handler is being called (so it's a TMOUT thing) and further that it is
> being called during zalloc(). This is bad news, as the malloc() arena is
> not re-entrant in most implementations.
I think the library should take care of this, but maybe if we move the
(|un)queue_signals() calls from our malloc down into zalloc() and friends?
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1999-09-21 16:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-18 23:47 Crash while testing a completion: trap handlers and malloc? Bart Schaefer
1999-09-21 9:05 Sven Wischnowsky
1999-09-21 16:44 ` Bart Schaefer
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).