|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-10-21 11:53 UTC] cmb@php.net
-Status: Open
+Status: Verified
[2019-10-21 11:53 UTC] cmb@php.net
[2019-10-21 14:08 UTC] nikic@php.net
[2019-11-25 14:55 UTC] cmb@php.net
-Summary: var_export on an FFI\CData:* instance causes
a segmentation fault
+Summary: var_export'ing certain class instances
segfaults
-Assigned To:
+Assigned To: cmb
[2019-11-25 14:55 UTC] cmb@php.net
[2019-11-25 14:59 UTC] cmb@php.net
[2019-11-25 14:59 UTC] cmb@php.net
-Status: Verified
+Status: Closed
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 15:00:01 2025 UTC |
Description: ------------ Whenever var_export() is called on the result of FFI::new(), PHP segfaults. I think it's related to calling GC_PROTECT_RECURSION, *but the line numbers in my build may be wrong* ``` 553 GC_PROTECT_RECURSION(myht); (gdb) bt #0 0x0000000000944811 in php_var_export_ex (struc=0x7fffecc13100, level=1, buf=0x7fffffffbf90) at /path/to/php-src/ext/standard/var.c:553 #1 0x0000000000944fe3 in zif_var_export (execute_data=0x7fffecc130b0, return_value=0x7fffffffbfe0) at /path/to/php-src/ext/standard/var.c:622 #2 0x0000000000bb2b63 in ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER () at /path/to/php-src/Zend/zend_vm_execute.h:649 ``` Test script: --------------- ``` ยป php -a Interactive shell php > $x = FFI::new('int'); php > echo gettype($x); object php > echo get_class($x); FFI\CData php > var_dump($x); object(FFI\CData:int32_t)#1 (1) { ["cdata"]=> int(0) } php > var_export($x); [1] 2615 segmentation fault php -a ``` Expected result: ---------------- Either dumps the type or throws an Exception/Error for being impossible to dump Actual result: -------------- Segfaults