derickr / vld

BSD 2-Clause "Simplified" License
464 stars 87 forks source link

Segfault #69

Closed olliencc closed 3 years ago

olliencc commented 3 years ago

Describe the bug When running it with a PHP file I get the following

php -dvld.active=1 index.php

Finding entry points Segmentation fault (core dumped)

To Reproduce

Expected behaviour No crash

Version information:

; configuration for php opcache module ; priority=10 zend_extension=opcache.so

but even disabling it doesn't work.

Additional context

If you want the php I can e-mail but don't want to attach to an issue

olliencc commented 3 years ago

(gdb) r Starting program: /usr/bin/php -dvld.active=1 -dvld.verbosity=100 index.php [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Finding entry points

Program received signal SIGSEGV, Segmentation fault. 0x00007fffff7b9c85 in vld_set_add (set=0x8715db0, position=4294967295) at /root/vld/set.c:44 44 byte = byte | 1 << bit;

olliencc commented 3 years ago

(gdb) bt

0 0x00007fffff7b9c85 in vld_set_add (set=0x8715d70, position=4294967295) at /root/vld/set.c:44

1 0x00007fffff7b9811 in vld_analyse_oparray (opa=opa@entry=0x7ffffc87d380, set=set@entry=0x87067a0, branch_info=branch_info@entry=0x8715c90) at /root/vld/srm_oparray.c:1122

2 0x00007fffff7b9bc8 in vld_dump_oparray (opa=opa@entry=0x7ffffc87d380) at /root/vld/srm_oparray.c:918

3 0x00007fffff7b75d8 in vld_compile_file (file_handle=, type=) at /root/vld/vld.c:305

4 0x00000000082a7f2c in zend_execute_scripts ()

5 0x0000000008248688 in php_execute_script ()

6 0x0000000008331a8e in ?? ()

7 0x000000000810db1b in ?? ()

8 0x00007ffffebc409b in __libc_start_main (main=0x810d6d0, argc=4, argv=0x7ffffffee668, init=, fini=, rtld_fini=,

stack_end=0x7ffffffee658) at ../csu/libc-start.c:308

9 0x000000000810dc7a in _start ()

derickr commented 3 years ago

You should be able to reproduce this with just a single function, the one that throws the error. If you can attach that to this issue I can have a look. The code does not have to be able to be run, but it does need to parse.

olliencc commented 3 years ago

it was protected with ioncube, which I suspect was the root cause.