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

Re: Zsh parser segmentation fault in strcatsub



On Wed, May 17, 2017 at 1:37 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
[...]
>
> Can you repeat the crash with multibyte support disabled in the compile?

I can't get it to crash with multibyte support disabled. Also, it
seems that the --enable-zsh-debug makes the crash go away (although I
suspect that just may be because the payload doesn't overflow the
heap).

dualbus@debian:~/src/zsh/zsh$ ./Util/preconfig && CC=gcc-6 CFLAGS='-O0
-ggdb' ./configure --enable-zsh-debug --disable-multibyte && make -j4
[...]
dualbus@debian:~/src/zsh/zsh$ md5sum /tmp/strcatsub
45a3a29522b0bd62d073d791b722ce02  /tmp/strcatsub
dualbus@debian:~/src/zsh/zsh$ ./Src/zsh -nf /tmp/strcatsub

dualbus@debian:~/src/zsh/zsh$ ./Util/preconfig && CC=gcc-6 CFLAGS='-O0
-ggdb' ./configure --enable-zsh-debug --enable-multibyte && make -j4
[...]
dualbus@debian:~/src/zsh/zsh$ md5sum /tmp/strcatsub
45a3a29522b0bd62d073d791b722ce02  /tmp/strcatsub
dualbus@debian:~/src/zsh/zsh$ ./Src/zsh -nf /tmp/strcatsub

dualbus@debian:~/src/zsh/zsh$ ./Util/preconfig && CC=clang-3.9
CFLAGS='-O0 -ggdb' ./configure --enable-zsh-debug --disable-multibyte
&& make -j4
[...]
dualbus@debian:~/src/zsh/zsh$ md5sum /tmp/strcatsub
45a3a29522b0bd62d073d791b722ce02  /tmp/strcatsub
dualbus@debian:~/src/zsh/zsh$ ./Src/zsh -nf /tmp/strcatsub

dualbus@debian:~/src/zsh/zsh$ ./Util/preconfig && CC=clang-3.9
CFLAGS='-O0 -ggdb' ./configure --enable-zsh-debug --enable-multibyte
&& make -j4
[...]
dualbus@debian:~/src/zsh/zsh$ md5sum /tmp/strcatsub
45a3a29522b0bd62d073d791b722ce02  /tmp/strcatsub
dualbus@debian:~/src/zsh/zsh$ ./Src/zsh -nf /tmp/strcatsub

dualbus@debian:~/src/zsh/zsh$ ./Util/preconfig && CC=clang-3.9
CFLAGS='-O0 -ggdb' LDFLAGS='' ./configure  --enable-multibyte && make
-j4
[...]
dualbus@debian:~/src/zsh/zsh$ md5sum /tmp/strcatsub
45a3a29522b0bd62d073d791b722ce02  /tmp/strcatsub
dualbus@debian:~/src/zsh/zsh$ ./Src/zsh -nf /tmp/strcatsub
Segmentation fault

dualbus@debian:~/src/zsh/zsh$ ./Util/preconfig && CC=clang-3.9
CFLAGS='-O0 -ggdb' LDFLAGS='' ./configure  --disable-multibyte && make
-j4
[...]
dualbus@debian:~/src/zsh/zsh$ md5sum /tmp/strcatsub
45a3a29522b0bd62d073d791b722ce02  /tmp/strcatsub
dualbus@debian:~/src/zsh/zsh$ ./Src/zsh -nf /tmp/strcatsub

dualbus@debian:~/src/zsh/zsh$ ./Util/preconfig && CC=gcc-6 CFLAGS='-O0
-ggdb' LDFLAGS='' ./configure  --enable-multibyte && make -j4
[...]
dualbus@debian:~/src/zsh/zsh$ md5sum /tmp/strcatsub
45a3a29522b0bd62d073d791b722ce02  /tmp/strcatsub
dualbus@debian:~/src/zsh/zsh$ ./Src/zsh -nf /tmp/strcatsub
Segmentation fault


The reason I build it with CFLAGS='-O0 -ggdb' LDFLAGS='' is that the
Makefile kept stripping symbols from the binary, so I hacked around it
by passing an empty LDFLAGS, but now I realize that --enable-zsh-debug
is what I was looking for.



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