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

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



Le decadi 30 floréal, an CCXII, Clint Adams a écrit :
> If you rebuild the deb with DEB_BUILD_OPTIONS="debug", you'll get some
> more verbose output from gdb.

I built only with ./configure, but I confess I did not check that the
build options enabled debugging, as they usually do with ./configure. I
re-tried with --enable-zsh-debug --enable-zsh-mem-debug
--enable-zsh-hash-debug. Here is the new backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x4011513c in mallopt () from /lib/tls/i686/cmov/libc.so.6
(gdb) where
#0  0x4011513c in mallopt () from /lib/tls/i686/cmov/libc.so.6
#1  0x080b3f30 in gettext2 (state=0x40aa6070) at text.c:343
Previous frame inner to this frame (corrupt stack?)

> zsh doesn't call mallopt() directly; it's probably being called from
> another libc function such as free().  Can you repeat the problem under
> valgrind with appropriate options?  Does it reveal anything?

I do not know valgrind, so I am not sure which are the appropriate
options, but a raw "HOME=/tmp/empty valgrind ./Src/zsh" gives sime
interesting details:

[snip a lot of initialization]
zsh: failed to load module: zsh/zle  <--- I did not make install
ssecem% alias frobnicate="LC_CTYPE=en_US.UTF-8"
ssecem% alias date="frobnicate date"
ssecem% function date { command date; echo done }
ssecem% date
==29387== Warning: invalid file descriptor -1 in syscall close()
==29387== Warning: invalid file descriptor -1 in syscall close()
Tue May 18 21:11:15 CEST 2004
done
ssecem% date
==29385== 
==29385== Invalid free() / delete / delete[]
==29385==    at 0x3C01F918: free (vg_replace_malloc.c:127)
==29385==    by 0x808DC1D: zsfree (mem.c:1399)
==29385==    by 0x809B2D1: delenv (params.c:3455)
==29385==    by 0x80698F3: save_params (exec.c:2523)
==29385==  Address 0x3C3C9B24 is 0 bytes inside a block of size 21 free'd
==29385==    at 0x3C01F918: free (vg_replace_malloc.c:127)
==29385==    by 0x808DC1D: zsfree (mem.c:1399)
==29385==    by 0x809B1A8: addenv (params.c:3402)
==29385==    by 0x8069C67: restore_params (exec.c:2594)
==29389== Warning: invalid file descriptor -1 in syscall close()
==29389== Warning: invalid file descriptor -1 in syscall close()
Tue May 18 21:11:17 CEST 2004
done

Again, I can make a core file available if you need it. I guess the
final core would be rather useless, since according to valgrind, the
memory is probably already corrupted at this point, but I can use gdb to
produce a core at the entrance of save_params.

Attachment: pgpOqpbneDR3s.pgp
Description: PGP signature



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