php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33332 Segmentation fault when extending DOMDocument
Submitted: 2005-06-14 07:28 UTC Modified: 2005-06-14 20:42 UTC
From: bjori at jeshus dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.0.3 OS: FreeBSD 5.3-RELEASE
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bjori at jeshus dot com
New email:
PHP Version: OS:

 

 [2005-06-14 07:28 UTC] bjori at jeshus dot com
Description:
------------
Segmentation fault is segmentation fault, should never happen, even thou the code is stupid.

Not sure how to describe this problem, guess the example speak for it self.
Short, and quite funny, example provided.

Reproduce code:
---------------
<?php
    class foo extends DOMDocument {
        function __construct() {
            $this->obj = $this;
            $this->obj = $this->obj->foobar;
        }
    }
    new foo;
?>


Actual result:
--------------
#0  _efree (ptr=0x5a5a5a5a, __zend_filename=0x817e4f4 "/usr/ports/lang/php5/work/php-5.0.3/Zend/zend_variables.c",
    __zend_lineno=193, __zend_orig_filename=0x817d97c "/usr/ports/lang/php5/work/php-5.0.3/Zend/zend_execute.h",
    __zend_orig_lineno=61) at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_alloc.c:263
#1  0x08111cee in _zval_ptr_dtor (zval_ptr=0x82901b0,
    __zend_filename=0x817e4f4 "/usr/ports/lang/php5/work/php-5.0.3/Zend/zend_variables.c", __zend_lineno=193)
    at zend_execute.h:61
#2  0x0811ce3b in _zval_ptr_dtor_wrapper (zval_ptr=0x82901b0)
    at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_variables.c:193
#3  0x0812504d in _zend_hash_quick_add_or_update (ht=0x82830a4, arKey=0x8281864 "obj", nKeyLength=4, h=2090572832,
    pData=0xbfbfd0e8, nDataSize=4, pDest=0xbfbfd0a0, flag=1,
    __zend_filename=0x8180640 "/usr/ports/lang/php5/work/php-5.0.3/Zend/zend_object_handlers.c", __zend_lineno=371)
    at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_hash.c:294
#4  0x08132e62 in zend_std_write_property (object=0x82814e4, member=0x81ad9d0, value=0x81975e4)
    at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_object_handlers.c:371
#5  0x284daca6 in dom_write_property () from /usr/local/lib/php/20041030-debug/dom.so
#6  0x0814a993 in zend_assign_to_object (result=0x81ad9a4, object_ptr=0x8197758, op2=0x81ad9cc, value_op=0x81ada04,
    Ts=0xbfbfd200, opcode=136) at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_execute.c:436
#7  0x0814a28f in zend_assign_obj_handler (execute_data=0xbfbfd290, opline=0x81ad9a0, op_array=0x8282724)
    at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_execute.c:2203
#8  0x08142990 in execute (op_array=0x8282724) at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_execute.c:1400
#9  0x0814e47a in zend_do_fcall_common_helper (execute_data=0xbfbfd410, opline=0x81addec, op_array=0x8282624)
    at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_execute.c:2740
#10 0x0814e8fc in zend_do_fcall_by_name_handler (execute_data=0x817d97c, opline=0x81addec, op_array=0x8282624)
    at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_execute.c:2825
#11 0x08142990 in execute (op_array=0x8282624) at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_execute.c:1400
#12 0x0811e979 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend.c:1069
#13 0x080e2f44 in php_execute_script (primary_file=0xbfbfeb50) at /usr/ports/lang/php5/work/php-5.0.3/main/main.c:1628
#14 0x08157adc in main (argc=2, argv=0xbfbfebd0) at /usr/ports/lang/php5/work/php-5.0.3/sapi/cli/php_cli.c:943


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-14 20:42 UTC] bjori at jeshus dot com
Yeah. Sorry about that. Works like a charm with CVS.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Dec 05 19:00:01 2025 UTC