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

Segfault with zsh 5.2

zsh 5.2 (x86_64-unknown-linux-gnu)

I use the following lines in my .zshrc:

if [[ $1 == eval ]]; then
  set --
  zle-line-init() {
    zle accept-line
    zle -D zle-line-init
  zle -N zle-line-init

Then I can run `zsh -is eval sleep 0 0 0 0` and it will run the
command and keep the shell open.  I run this code fine since 2013-01-30.
Now, this results sometimes in the following segfault with 5.2:

Core was generated by `zsh -is eval sleep 0 0 0 0'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  malloc_consolidate (av=av@entry=0x7fd1fe56ac40 <main_arena>)
    at malloc.c:4161
4161	malloc.c: No such file or directory.
(gdb) bt
#0  malloc_consolidate (av=av@entry=0x7fd1fe56ac40 <main_arena>)
    at malloc.c:4161
#1  0x00007fd1fe2446ab in _int_malloc (
    av=av@entry=0x7fd1fe56ac40 <main_arena>, bytes=bytes@entry=1024)
    at malloc.c:3444
#2  0x00007fd1fe2462c8 in __GI___libc_malloc (bytes=1024) at malloc.c:2907
#3  0x0000557079a38c7c in zalloc (size=<optimized out>, size@entry=1024)
    at mem.c:956
#4  0x0000557079a4f730 in init_parse () at parse.c:463
#5  0x0000557079a4fb74 in parse_event (endtok=endtok@entry=37) at parse.c:562
#6  0x0000557079a22c19 in loop (toplevel=toplevel@entry=1, 
    justonce=justonce@entry=0) at init.c:146
#7  0x0000557079a26754 in zsh_main (argc=<optimized out>, argv=<optimized out>)
    at init.c:1680
#8  0x00007fd1fe1eb680 in __libc_start_main (main=0x5570799f0790 <main>, 
    argc=8, argv=0x7ffd47aa62d8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7ffd47aa62c8) at libc-start.c:289
#9  0x00005570799f07c9 in _start () at ../sysdeps/x86_64/start.S:108

(Several arguments need to be passed to trigger it more often.)

Christian Neukirchen  <chneukirchen@xxxxxxxxx>  http://chneukirchen.org

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