Repository navigation
Closed as not planned
Labels
Description
Description
We're using guzzlehttp/guzzle 7.5.0.
PHP config: https://paste.daniil.it/config
gdb backtrace:
(gdb) backtrace
#0 0x000056330533d16a in ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_OP_DATA_CV_HANDLER () at ./Zend/zend_vm_execute.h:32960
#1 0x000056330534b898 in execute_ex (ex=0x50) at ./Zend/zend_vm_execute.h:58929
#2 0x000056330536bc5c in zend_generator_resume (orig_generator=0x7faf2dceabc0) at ./Zend/zend_generators.c:770
#3 0x000056330536cf59 in zend_generator_ensure_initialized (generator=0x7faf2dceabc0) at ./Zend/zend_generators.c:826
#4 zend_generator_ensure_initialized (generator=0x7faf2dceabc0) at ./Zend/zend_generators.c:823
#5 zim_Generator_current (execute_data=<optimized out>, return_value=0x7faf2dc14eb0) at ./Zend/zend_generators.c:881
#6 0x0000563305353d1b in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER () at ./Zend/zend_vm_execute.h:1951
#7 execute_ex (ex=0x50) at ./Zend/zend_vm_execute.h:56068
#8 0x0000563305355701 in zend_execute (op_array=0x7faf2dc7e000, return_value=0x0) at ./Zend/zend_vm_execute.h:60396
#9 0x00005633052e2e55 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at ./Zend/zend.c:1827
#10 0x000056330527e3fa in php_execute_script (primary_file=<optimized out>) at ./main/main.c:2542
#11 0x00005633053cc50a in do_cli (argc=9, argv=0x5633073e9170) at ./sapi/cli/php_cli.c:964
#12 0x000056330510ec5b in main (argc=9, argv=0x5633073e9170) at ./sapi/cli/php_cli.c:1333
gdb zbacktrace:
(gdb) zbacktrace
[0x7faf2dc151b0] GuzzleHttp\HandlerStack->setHandler(object[0x7faf2dc15200]) /zoon/zoon/vendor/guzzlehttp/guzzle/src/HandlerStack.php:116
[0x7faf2dc15100] Zoon\Queue\KafkaProxy\Consumer->getClient() /zoon/zoon/vendor/zoon/queue/src/KafkaProxy/Consumer.php:290
[0x7faf2dc15050] Zoon\Queue\KafkaProxy\Consumer->__construct(array(10)[0x7faf2dc150a0], object[0x7faf2dc150b0], object[0x7faf2dc150c0], object[0x7faf2dc150d0], array(6)[0x7faf2dc150e0])
/zoon/zoon/vendor/zoon/queue/src/KafkaProxy/Consumer.php:62
[0x7faf2dc14fc0] Zoon\Queue\KafkaProxy\Context->createConsumer(object[0x7faf2dc15010]) /zoon/zoon/vendor/zoon/queue/src/KafkaProxy/Context.php:68
[0x7faf2dc14f30] Zoon\Queue\Driver\KafkaPixy->getConsumer("Z\Module\Parser\Controller\Queue\ZextMatcherMatchFixer") /zoon/zoon/vendor/zoon/queue/src/Driver/KafkaPixy.php:140
[0x7faf20eb06e0] Zoon\Queue\Driver\KafkaPixy->consume("Z\Module\Parser\Controller\Queue\ZextMatcherMatchFixer") /zoon/zoon/vendor/zoon/queue/src/Driver/KafkaPixy.php:76
[0x7faf2dceac78] ???
[0x7faf2dc14ee0] Generator->current() [internal function]
[0x7faf2dc14e00] Zoon\Queue\ConsumerJsonRPC->run(290000) /zoon/zoon/vendor/zoon/queue/src/ConsumerJsonRPC.php:100
// more stuff
I can DM the coredump if needed.
ref: compressed_coredump-php.168655.1688664312
PHP Version
PHP 8.2.7
Operating System
Ubuntu 20.04, ondrej repos
Activity
danog commentedon Jul 10, 2023
Note that we're using kafka-pixy with guzzle, not ext-rdkafka.
iluuu1994 commentedon Jul 10, 2023
It's not obvious what the issue is from the backtrace. I also see that you have quite a few extensions enabled (including ext-rdkafka), any of which could have some connection with the issue. Would it be possible to run PHP with valgrind? You should also set the
ZEND_DONT_UNLOAD_MODULES=1 USE_ZEND_ALLOC=0environment variables. If there is memory corruption it should reveal the origin.danog commentedon Jul 10, 2023
Hmm, I can ask, but I'm afraid running valgrind on a production queue consumer would slow it down too much, would DM-ing the coredump help a bit more?
danog commentedon Jul 10, 2023
I actually have two coredumps with the same C trace now (compressed_coredump-php.97418.1688701817 and compressed_coredump-php.168655.1688664312), I can DM both if needed
iluuu1994 commentedon Jul 10, 2023
@danog Oh, valgrind is definitely not viable in production. I was hoping you could reproduce this in your dev environment.
iluuu1994 commentedon Jul 10, 2023
@danog The problem is that very often memory corruption will only cause a segfault down the line. It's very hard to backtrace and understand where there corruption occurred, even with a coredump. Valgrind or AddressSanitizer can be very helpful because they report violations when they happen.
danog commentedon Jul 10, 2023
Yeah understandable, I previously did start configuring a production docker image with AddressSanitizer enabled, guess I'll have to finish it and deploy it, because I can't reproduce this on the dev environment :)
iluuu1994 commentedon Jul 10, 2023
As long as it's in a separate environment (i.e. not redirecting all traffic onto it) using AddressSanitizer should be ok. There's a 2-3x slowdown. Note that failures will be printed to stderr, you can redirect it to a file with
ASAN_OPTIONS="log_path=asan.logif that's easier.danog commentedon Jul 10, 2023
Thanks!
I'll get to it then, in the meantime I found another similar coredump which I assume is also just a memory corruption, correct? :)
backtrace:
zbacktrace:
ref: compressed_coredump-php.2103386.1688761504.txt
iluuu1994 commentedon Jul 10, 2023
Most likely, yes. Similarly to the previous one, it fails at this line:
It seems that this should only segfault if
EX(run_time_cache)oropline->result.numgot corrupted.danog commentedon Jul 11, 2023
Btw should I also set the
ZEND_DONT_UNLOAD_MODULES=1 USE_ZEND_ALLOC=0env variables when running PHP with ASAN (not valgrind)?iluuu1994 commentedon Jul 11, 2023
@danog
USE_ZEND_ALLOC=0should suffice.kamil-tekiela commentedon Nov 7, 2026
Same as #11655 I am closing it for lack of reproducible steps or ASAN log. We don't even know if the issue is in PHP core or in one of the loaded extensions.