Skip to content

Segmentation fault in Zend/zend_types.h #14741

Closed
@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?php
$dom = new DOMDocument;
$dom->loadXML('<foo>foo1</foo>');
$nodes = $dom->documentElement->childNodes;
$iter = $nodes->getIterator();
$script1_dataflow = $iter;
clone $script1_dataflow;

Resulted in this output:

Segmentation fault (core dumped)

Valgrind:

==2405895== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==2405895==  Bad permissions for mapped region at address 0x16D68A8
==2405895==    at 0x973F0F: zend_gc_delref (zend_types.h:1344)
==2405895==    by 0x97407A: zend_iterator_dtor (zend_iterators.c:91)
==2405895==    by 0x97350D: zend_internal_iterator_free (zend_interfaces.c:514)
==2405895==    by 0x9A51D5: zend_objects_store_del (zend_objects_API.c:200)
==2405895==    by 0x9C552D: rc_dtor_func (zend_variables.c:57)
==2405895==    by 0x8A281F: zval_ptr_dtor_nogc (zend_variables.h:36)
==2405895==    by 0x8D7E63: ZEND_FREE_SPEC_TMPVAR_HANDLER (zend_vm_execute.h:14893)
==2405895==    by 0x937424: execute_ex (zend_vm_execute.h:59399)
==2405895==    by 0x93AD56: zend_execute (zend_vm_execute.h:62962)
==2405895==    by 0x9D180A: zend_execute_script (zend.c:1906)
==2405895==    by 0x78AF30: php_execute_script_ex (main.c:2529)
==2405895==    by 0x78B0B6: php_execute_script (main.c:2569)

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions