-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDEBUG
42 lines (36 loc) · 2.04 KB
/
DEBUG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Debug extension using GDB:
bash$> gdb /usr/lib64/php7.1/bin/php
...
(gdb) set args -n -c 'pecl-foa/tmp-php.ini' -d "output_handler=" -d "open_basedir=" \
-d "disable_functions=" -d "output_buffering=Off" -d "error_reporting=32767" \
-d "display_errors=1" -d "display_startup_errors=1" -d "log_errors=0" \
-d "html_errors=0" -d "track_errors=1" -d "report_memleaks=1" \
-d "report_zend_debug=0" -d "docref_root=" -d "docref_ext=.html" \
-d "error_prepend_string=" -d "error_append_string=" -d "auto_prepend_file=" \
-d "auto_append_file=" -d "ignore_repeated_errors=0" -d "precision=14" \
-d "memory_limit=128M" -d "log_errors_max_len=0" -d "opcache.fast_shutdown=0" \
-d "opcache.file_update_protection=0" -d "extension_dir=pecl-foa/modules/" \
-d "extension=foa.so" -d "session.auto_start=0" -d "zlib.output_compression=Off"
-d "mbstring.func_overload=0" -f "pecl-foa/tests/foa_decode_basic.php"
(gdb) run
Starting program: /usr/lib64/php7.1/bin/php -n -c 'pecl-foa/tmp-php.ini' ...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff1b5d943 in ?? () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff1b5d943 in ?? () from /lib64/libc.so.6
#1 0x00007fffed9f8fdd in foa_set_buffer (foa=0x7fffee264000, input=<optimized out>) at libfoa.c:118
#2 0x00007fffedbfd5ff in zif_foa_set_buffer (execute_data=<optimized out>, return_value=<optimized out>) at pecl-foa/src/foa.c:226
#3 0x0000555555ab5098 in ?? ()
#4 0x0000555555aa51db in execute_ex ()
#5 0x0000555555afcf18 in zend_execute ()
#6 0x0000555555a5d3ea in zend_execute_scripts ()
#7 0x00005555559fc7d0 in php_execute_script ()
#8 0x0000555555aff1c4 in ?? ()
#9 0x00005555556eab74 in main ()
(gdb) quit
A debugging session is active.
Inferior 1 [process 25704] will be killed.
Quit anyway? (y or n) y
// Anders Lövgren, 2019-01-29