runtimeverification / rv-predict

Code for improved rv-predict and installer
BSD 3-Clause "New" or "Revised" License
2 stars 3 forks source link

PHP crashes at signal handler #1035

Open maya-rv opened 5 years ago

maya-rv commented 5 years ago

Steps to reproduce:

sudo apt install -y bison libxml2-dev
git clone http://github.com/php/php-src
cd php-src
./buildconf
./configure CC=rvpc CXX=rvpc++
make -j`nproc`
^C
./sapi/cli/php
^C

And the backtrace:

(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000000af8409 in __rvpredict_handler_wrapper (signum=2, info=0x7fffd3a0ffb0, ctx=0x7fffd3a0fe80) at /home/fly/rv/rv-predict/llvm/ngrt/rvpsignal.c:485
#2  <signal handler called>
#3  0x00007f09881f6187 in kill () at ../sysdeps/unix/syscall-template.S:78
#4  0x0000000000906d72 in zend_signal_handler (signo=2, siginfo=0x7fffd3a10ab0, context=0x7fffd3a10980) at Zend/zend_signal.c:207
#5  0x0000000000906b34 in zend_signal_handler_defer (signo=2, siginfo=0x7fffd3a10ab0, context=0x7fffd3a10980) at Zend/zend_signal.c:104
#6  0x0000000000af83f7 in __rvpredict_handler_wrapper (signum=2, info=0x7fffd3a10ab0, ctx=0x7fffd3a10980) at /home/fly/rv/rv-predict/llvm/ngrt/rvpsignal.c:483
#7  <signal handler called>
#8  0x00007f09882c70b4 in __GI___libc_read (fd=0, buf=0x3541b20, nbytes=1024) at ../sysdeps/unix/sysv/linux/read.c:27
#9  0x00007f0988244148 in _IO_new_file_underflow (fp=0x7f09885a2a00 <_IO_2_1_stdin_>) at fileops.c:531
#10 0x00007f0988242748 in __GI__IO_file_xsgetn (fp=0x7f09885a2a00 <_IO_2_1_stdin_>, data=<optimized out>, n=1) at fileops.c:1344
#11 0x00007f09882363c1 in __GI__IO_fread (buf=<optimized out>, size=1, count=1, fp=0x7f09885a2a00 <_IO_2_1_stdin_>) at iofread.c:38
#12 0x00000000008e9e8a in zend_stream_stdio_reader (handle=0x7f09882c70b4 <__GI___libc_read+68>, buf=0x0, len=1024) at Zend/zend_stream.c:51
#13 0x00000000008ea091 in zend_stream_getc (file_handle=0x7fffd3a14a10) at Zend/zend_stream.c:144
#14 zend_stream_read (file_handle=0x7fffd3a14a10, buf=0x7f098467c000 "", len=4096) at Zend/zend_stream.c:156
#15 0x00000000008e9afd in zend_stream_fixup (file_handle=0x7fffd3a14a10, buf=<optimized out>, len=<optimized out>) at Zend/zend_stream.c:249
#16 0x000000000081b39a in open_file_for_scanning (file_handle=0x7fffd3a14a10) at Zend/zend_language_scanner.l:512
#17 0x000000000081bb5c in compile_file (file_handle=0x7fffd3a14a10, type=8) at Zend/zend_language_scanner.l:629
#18 0x00000000005ff8c7 in phar_compile_file (file_handle=0x7fffd3a14a10, type=<optimized out>) at ext/phar/phar.c:3332
#19 0x00000000008a318a in zend_execute_scripts (type=8, retval=0x0, file_count=3) at Zend/zend.c:1610
#20 0x00000000007d702d in php_execute_script (primary_file=0x7fffd3a14a10) at main/main.c:2643
#21 0x0000000000adc960 in do_cli (argc=1, argv=0x3428710) at sapi/cli/php_cli.c:997
#22 0x0000000000adb323 in main (argc=<optimized out>, argv=0x3428710) at sapi/cli/php_cli.c:1389