php / php/php-src

Segfault while assigning property

Open
#11,656 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied GDB and zbacktrace output, the PHP configuration link, and the assignment at vendor/guzzlehttp/guzzle/src/HandlerStack.php:116. Reproduce the generator path if possible and inspect Zend/zend_vm_execute.h and Zend/zend_generators.c; done means the crash cause is isolated and a verified fix or regression test exists.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.