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

Re: Bug#249627: Alias + LC_CTYPE + function => segmentation fault



Le primidi 1er prairial, an CCXII, Peter Stephenson a écrit :
> I don't think this is the same problem, since the programme finishes
> correctly.  It does indicate something funny in saving and restoring
> environment variables.

If it is a memory corruption caused by an invalid free, it is likely
that valgrind would either prevent it, or change the exact place where
the corruption occurs, thus changing the time it results in a
segmentation fault. I have seen that just having used "setopt" earlyer
changed a segfault on the second try into an infinite loop in the third
try: this problem is very sensitive to initial conditions.

I have tried Electric Fence, here is a backtrace, just after the second
date:

ssecem% date

ElectricFence Aborting: free(403cdfe8): address not from malloc().

Program received signal SIGILL, Illegal instruction.
[Switching to Thread 1075767072 (LWP 1967)]
0xffffe410 in __kernel_vsyscall ()
(gdb) where
#0  0xffffe410 in __kernel_vsyscall ()
#1  0x400ce156 in kill () from /lib/tls/i686/cmov/libc.so.6
#2  0x4002719b in EF_Abort () from /usr/lib/libefence.so
#3  0x40026ac1 in free () from /usr/lib/libefence.so
#4  0x0808dc1e in zsfree (p=0x403cdfe8 "") at mem.c:1399
#5  0x0809b2d2 in delenv (x=0x403cdfe8 "") at params.c:3455
#6  0x080698f4 in save_params (state=0xbffff7c0, pc=0x406d915c, 
    restore_p=0xbffff568, remove_p=0xbffff56c) at exec.c:2523
#7  0x08069314 in execcmd (state=0xbffff7c0, input=0, output=0, how=18, 
    last1=2) at exec.c:2371
#8  0x08065e47 in execpline2 (state=0xbffff7c0, pcode=387, how=18, input=0, 
    output=0, last1=0) at exec.c:1276
#9  0x08065381 in execpline (state=0xbffff7c0, slcode=6146, how=18, last1=0)
    at exec.c:1066
#10 0x08064cce in execlist (state=0xbffff7c0, dont_change_job=0, exiting=0)
    at exec.c:872
#11 0x080649ee in execode (p=0x406d9128, dont_change_job=0, exiting=0)
    at exec.c:773
#12 0x0807b253 in loop (toplevel=1, justonce=0) at init.c:165
#13 0x0807d99f in zsh_main (argc=1, argv=0xbffff8f4) at init.c:1274
#14 0x080521e6 in main (argc=1, argv=0xbffff8f4) at main.c:37

Attachment: pgpcvBuNJAyd8.pgp
Description: PGP signature



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