parallel icon indicating copy to clipboard operation
parallel copied to clipboard

Segfaults when xdebug is enabled

Open maxgalbu opened this issue 4 years ago • 0 comments

I've had a lot of segfaults with xdebug enabled, which are hard to reproduce in simple test cases, and I only found out by running php through gdb.

In my case, it looks like xdebug is trying to access an instance of class Pv4\\Api\\Components\\PricingRequest which is shared with threads.

Is xdebug supposed to work with parallel? If not, it would be nice if there was a warning to disable xdebug, if it's enabled

Backtrace 1
0x0000559752030ea3 in php_addcslashes ()
#0  0x0000559752030ea3 in php_addcslashes ()
#1  0x00007fac7a057ae7 in xdebug_var_export_line (struc=0x7fac74038f58, struc@entry=0x7fac74039000, str=str@entry=0x7fac711088a0, level=level@entry=5, debug_zval=debug_zval@entry=0, options=options@entry=0x7fac711d35a0) at /tmp/pear/temp/xdebug/src/lib/var_export_line.c:169
#2  0x00007fac7a0580a4 in xdebug_object_element_export (object=<optimized out>, class_name=0x7fac738ce2d8 "Pv4\\Api\\Components\\PricingRequest", options=0x7fac711d35a0, debug_zval=0, str=0x7fac711088a0, level=3, hash_key=<optimized out>, index_key=<optimized out>, zv_nptr=<optimized out>) at /tmp/pear/temp/xdebug/src/lib/var_export_line.c:102
#3  xdebug_var_export_line (struc=0x7fac74038ff8, struc@entry=0x7fac740390a0, str=str@entry=0x7fac711088a0, level=level@entry=3, debug_zval=debug_zval@entry=0, options=options@entry=0x7fac711d35a0) at /tmp/pear/temp/xdebug/src/lib/var_export_line.c:243
#4  0x00007fac7a0580a4 in xdebug_object_element_export (object=<optimized out>, class_name=0x7fac738ca9c8 "Pv4\\Api\\Components\\RetrieverFetcher\\TaskContext", options=0x7fac711d35a0, debug_zval=0, str=0x7fac711088a0, level=1, hash_key=<optimized out>, index_key=<optimized out>, zv_nptr=<optimized out>) at /tmp/pear/temp/xdebug/src/lib/var_export_line.c:102
#5  xdebug_var_export_line (struc=struc@entry=0x7fac74039108, str=str@entry=0x7fac711088a0, level=level@entry=1, debug_zval=debug_zval@entry=0, options=options@entry=0x7fac711d35a0) at /tmp/pear/temp/xdebug/src/lib/var_export_line.c:243
#6  0x00007fac7a058240 in xdebug_get_zval_value_line (val=<optimized out>, debug_zval=0, options=0x7fac711d35a0) at /tmp/pear/temp/xdebug/src/lib/var_export_line.c:294
#7  0x00007fac7a071065 in add_single_value (html=<optimized out>, zv=<optimized out>, str=0x7fac74039210) at /tmp/pear/temp/xdebug/src/develop/stack.c:265
#8  xdebug_append_printable_stack (str=0x7fac74039210, html=<optimized out>) at /tmp/pear/temp/xdebug/src/develop/stack.c:445
#9  0x00007fac7a0723ad in xdebug_develop_throw_exception_hook (exception=exception@entry=0x7fac7381fc50, file=file@entry=0x7fac735c7678, line=line@entry=0x7fac735c7688, code=code@entry=0x7fac735c7668, code_str=code_str@entry=0x7fac7064c0c0 "403", message=message@entry=0x7fac735c7648) at /tmp/pear/temp/xdebug/src/develop/stack.c:959
#10 0x00007fac7a04a1b7 in xdebug_throw_exception_hook (exception=0x7fac7381fc50) at /tmp/pear/temp/xdebug/src/base/base.c:1213
#11 0x0000559751de33de in zend_throw_exception_internal ()
#12 0x0000559751df4b45 in ?? ()
#13 0x000055975217e363 in execute_ex ()
#14 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381fba0) at /tmp/pear/temp/xdebug/src/base/base.c:765
#15 0x0000559752183dbf in execute_ex ()
#16 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381f9a0) at /tmp/pear/temp/xdebug/src/base/base.c:765
#17 0x0000559752185cc3 in execute_ex ()
#18 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381f8f0) at /tmp/pear/temp/xdebug/src/base/base.c:765
#19 0x0000559752185cc3 in execute_ex ()
#20 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381f840) at /tmp/pear/temp/xdebug/src/base/base.c:765
#21 0x0000559752185cc3 in execute_ex ()
#22 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381f750) at /tmp/pear/temp/xdebug/src/base/base.c:765
#23 0x0000559752185cc3 in execute_ex ()
#24 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381f620) at /tmp/pear/temp/xdebug/src/base/base.c:765
#25 0x0000559752185cc3 in execute_ex ()
#26 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381f4e0) at /tmp/pear/temp/xdebug/src/base/base.c:765
#27 0x0000559752185cc3 in execute_ex ()
#28 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381f3b0) at /tmp/pear/temp/xdebug/src/base/base.c:765
#29 0x0000559752185cc3 in execute_ex ()
#30 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381f260) at /tmp/pear/temp/xdebug/src/base/base.c:765
#31 0x0000559752183dbf in execute_ex ()
#32 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381f1b0) at /tmp/pear/temp/xdebug/src/base/base.c:765
#33 0x0000559752183dbf in execute_ex ()
#34 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381ec30) at /tmp/pear/temp/xdebug/src/base/base.c:765
#35 0x0000559752183dbf in execute_ex ()
#36 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381ea70) at /tmp/pear/temp/xdebug/src/base/base.c:765
#37 0x0000559752183dbf in execute_ex ()
#38 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381e990) at /tmp/pear/temp/xdebug/src/base/base.c:765
#39 0x0000559752183dbf in execute_ex ()
#40 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381e8f0) at /tmp/pear/temp/xdebug/src/base/base.c:765
#41 0x0000559752183dbf in execute_ex ()
#42 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381e350) at /tmp/pear/temp/xdebug/src/base/base.c:765
#43 0x0000559752185cc3 in execute_ex ()
#44 0x00007fac7a04b690 in xdebug_execute_ex (execute_data=0x7fac7381e030) at /tmp/pear/temp/xdebug/src/base/base.c:765
#45 0x00007fac798cbeeb in php_parallel_scheduler_run (frame=0x7fac7381e030, runtime=<optimized out>) at /parallel/src/scheduler.c:265
#46 0x00007fac798cc61d in php_parallel_thread (arg=0x7fac79fcf820) at /parallel/src/scheduler.c:441
#47 0x00007fac7a8c1160 in ?? () from /lib/ld-musl-x86_64.so.1
#48 0x0000000000000000 in ?? ()
Backtrace 2
0x00007fbd70eba94f in xdebug_var_export_line (struc=<optimized out>, struc@entry=0x7fbd6bad0000, str=str@entry=0x7fbd67c6a780, level=level@entry=5, debug_zval=debug_zval@entry=0, options=options@entry=0x7fbd67aadc30) at /tmp/pear/temp/xdebug/src/lib/var_export_line.c:141
#0  0x00007fbd70eba94f in xdebug_var_export_line (struc=<optimized out>, struc@entry=0x7fbd6bad0000, str=str@entry=0x7fbd67c6a780, level=level@entry=5, debug_zval=debug_zval@entry=0, options=options@entry=0x7fbd67aadc30) at /tmp/pear/temp/xdebug/src/lib/var_export_line.c:141
#1  0x00007fbd70ebb0a4 in xdebug_object_element_export (object=<optimized out>, class_name=0x7fbd6b2ce2d8 "Pv4\\Api\\Components\\PricingRequest", options=0x7fbd67aadc30, debug_zval=0, str=0x7fbd67c6a780, level=3, hash_key=<optimized out>, index_key=<optimized out>, zv_nptr=<optimized out>) at /tmp/pear/temp/xdebug/src/lib/var_export_line.c:102
#2  xdebug_var_export_line (struc=0x7fbd6bacfff8, struc@entry=0x7fbd6bad00a0, str=str@entry=0x7fbd67c6a780, level=level@entry=3, debug_zval=debug_zval@entry=0, options=options@entry=0x7fbd67aadc30) at /tmp/pear/temp/xdebug/src/lib/var_export_line.c:243
#3  0x00007fbd70ebb0a4 in xdebug_object_element_export (object=<optimized out>, class_name=0x7fbd6b2ca9c8 "Pv4\\Api\\Components\\RetrieverFetcher\\TaskContext", options=0x7fbd67aadc30, debug_zval=0, str=0x7fbd67c6a780, level=1, hash_key=<optimized out>, index_key=<optimized out>, zv_nptr=<optimized out>) at /tmp/pear/temp/xdebug/src/lib/var_export_line.c:102
#4  xdebug_var_export_line (struc=struc@entry=0x7fbd6bad0108, str=str@entry=0x7fbd67c6a780, level=level@entry=1, debug_zval=debug_zval@entry=0, options=options@entry=0x7fbd67aadc30) at /tmp/pear/temp/xdebug/src/lib/var_export_line.c:243
#5  0x00007fbd70ebb240 in xdebug_get_zval_value_line (val=<optimized out>, debug_zval=0, options=0x7fbd67aadc30) at /tmp/pear/temp/xdebug/src/lib/var_export_line.c:294
#6  0x00007fbd70ed4065 in add_single_value (html=<optimized out>, zv=<optimized out>, str=0x7fbd6bad0210) at /tmp/pear/temp/xdebug/src/develop/stack.c:265
#7  xdebug_append_printable_stack (str=0x7fbd6bad0210, html=<optimized out>) at /tmp/pear/temp/xdebug/src/develop/stack.c:445
#8  0x00007fbd70ed53ad in xdebug_develop_throw_exception_hook (exception=exception@entry=0x7fbd6b21fd10, file=file@entry=0x7fbd684d39f8, line=line@entry=0x7fbd684d3a08, code=code@entry=0x7fbd684d39e8, code_str=code_str@entry=0x7fbd6802d780 "404", message=message@entry=0x7fbd684d39c8) at /tmp/pear/temp/xdebug/src/develop/stack.c:959
#9  0x00007fbd70ead1b7 in xdebug_throw_exception_hook (exception=0x7fbd6b21fd10) at /tmp/pear/temp/xdebug/src/base/base.c:1213
#10 0x000055ecb0a363de in zend_throw_exception_internal ()
#11 0x000055ecb0a47b45 in ?? ()
#12 0x000055ecb0dd1363 in execute_ex ()
#13 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21fc60) at /tmp/pear/temp/xdebug/src/base/base.c:765
#14 0x000055ecb0dd6dbf in execute_ex ()
#15 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21fa60) at /tmp/pear/temp/xdebug/src/base/base.c:765
#16 0x000055ecb0dd8cc3 in execute_ex ()
#17 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21f9b0) at /tmp/pear/temp/xdebug/src/base/base.c:765
#18 0x000055ecb0dd8cc3 in execute_ex ()
#19 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21f900) at /tmp/pear/temp/xdebug/src/base/base.c:765
#20 0x000055ecb0dd8cc3 in execute_ex ()
#21 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21f810) at /tmp/pear/temp/xdebug/src/base/base.c:765
#22 0x000055ecb0dd8cc3 in execute_ex ()
#23 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21f6e0) at /tmp/pear/temp/xdebug/src/base/base.c:765
#24 0x000055ecb0dd8cc3 in execute_ex ()
#25 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21f5a0) at /tmp/pear/temp/xdebug/src/base/base.c:765
#26 0x000055ecb0dd8cc3 in execute_ex ()
#27 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21f470) at /tmp/pear/temp/xdebug/src/base/base.c:765
#28 0x000055ecb0dd8cc3 in execute_ex ()
#29 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21f320) at /tmp/pear/temp/xdebug/src/base/base.c:765
#30 0x000055ecb0dd6dbf in execute_ex ()
#31 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21f270) at /tmp/pear/temp/xdebug/src/base/base.c:765
#32 0x000055ecb0dd6dbf in execute_ex ()
#33 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21ecf0) at /tmp/pear/temp/xdebug/src/base/base.c:765
#34 0x000055ecb0dd6dbf in execute_ex ()
#35 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21eb30) at /tmp/pear/temp/xdebug/src/base/base.c:765
#36 0x000055ecb0dd6dbf in execute_ex ()
#37 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21e990) at /tmp/pear/temp/xdebug/src/base/base.c:765
#38 0x000055ecb0dd6dbf in execute_ex ()
#39 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21e8f0) at /tmp/pear/temp/xdebug/src/base/base.c:765
#40 0x000055ecb0dd6dbf in execute_ex ()
#41 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21e350) at /tmp/pear/temp/xdebug/src/base/base.c:765
#42 0x000055ecb0dd8cc3 in execute_ex ()
#43 0x00007fbd70eae690 in xdebug_execute_ex (execute_data=0x7fbd6b21e030) at /tmp/pear/temp/xdebug/src/base/base.c:765
#44 0x00007fbd70938eeb in php_parallel_scheduler_run (frame=0x7fbd6b21e030, runtime=<optimized out>) at /parallel/src/scheduler.c:265
#45 0x00007fbd7093961d in php_parallel_thread (arg=0x7fbd711cf6e0) at /parallel/src/scheduler.c:441
#46 0x00007fbd71924160 in ?? () from /lib/ld-musl-x86_64.so.1
#47 0x0000000000000000 in ?? ()

php -v

PHP 7.3.28 (cli) (built: Apr 29 2021 19:46:28) ( ZTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.28, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.28, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans

php -m

[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
parallel
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
phalcon
Phar
posix
readline
redis
Reflection
session
SimpleXML
sodium
SPL
sqlite3
standard
tokenizer
xdebug
xml
xmlreader
xmlrpc
xmlwriter
Zend OPcache
zlib

[Zend Modules]
Xdebug
Zend OPcache

maxgalbu avatar May 11 '21 07:05 maxgalbu