zsh-workers
 help / color / mirror / code / Atom feed
* Segfault with zsh 5.2
@ 2015-12-07 13:01 Christian Neukirchen
  2015-12-07 13:55 ` Peter Stephenson
  0 siblings, 1 reply; 11+ messages in thread
From: Christian Neukirchen @ 2015-12-07 13:01 UTC (permalink / raw)
  To: zsh-workers


zsh 5.2 (x86_64-unknown-linux-gnu)
zsh-5.2-0-gc86c20a

I use the following lines in my .zshrc:

if [[ $1 == eval ]]; then
  shift
  ICMD="$@"
  set --
  zle-line-init() {
    BUFFER="$ICMD"
    zle accept-line
    zle -D zle-line-init
  }
  zle -N zle-line-init
fi

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.)

Thanks,
-- 
Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-01-24 15:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-07 13:01 Segfault with zsh 5.2 Christian Neukirchen
2015-12-07 13:55 ` Peter Stephenson
2015-12-07 14:31   ` Christian Neukirchen
2015-12-07 14:36     ` Peter Stephenson
2015-12-07 14:54       ` Christian Neukirchen
2016-01-22 20:12       ` ${path[@]} in sh mode [was: Segfault with zsh 5.2] Martijn Dekker
2016-01-22 20:45         ` Martijn Dekker
2016-01-23  0:07           ` Mikael Magnusson
2016-01-23  1:08             ` Martijn Dekker
2016-01-23  1:53               ` Bart Schaefer
2016-01-24 15:15                 ` Peter Stephenson

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).