|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66448 Segfault when adding property to SplEnum
Submitted: 2014-01-09 08:38 UTC Modified: 2017-01-10 08:14 UTC
Avg. Score:4.4 ± 0.7
Reproduced:7 of 7 (100.0%)
Same Version:3 (42.9%)
Same OS:1 (14.3%)
From: berend at inversive dot nl Assigned:
Status: Suspended Package: SPL_Types (PECL)
PHP Version: 5.5.7 OS: Ubuntu 13.10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: berend at inversive dot nl
New email:
PHP Version: OS:


 [2014-01-09 08:38 UTC] berend at inversive dot nl
Adding a property to a class which extends a SplEnum causes a segfault.

Test script:
class MyEnum extends SplEnum {
    const BLA = 1;
    const BLABLA = 2;
    const BLABLABLA = 3;

    private $someProperty;


new MyEnum(1);

Expected result:
No segfault.

Actual result:
Program received signal SIGSEGV, Segmentation fault.
0x00000000006dca67 in zend_hash_destroy ()
(gdb) backtrace
#0  0x00000000006dca67 in zend_hash_destroy ()
#1  0x00007ffff4d4743d in spl_type_object_free_storage (_object=0x7ffff7fb9e00) at /tmp/pear/temp/SPL_Types/spl_type.c:66
#2  0x00000000006f6e34 in zend_objects_store_del_ref_by_handle_ex ()
#3  0x00000000006f6e53 in zend_objects_store_del_ref ()
#4  0x000000000077f197 in ?? ()
#5  0x00000000006f8b18 in execute_ex ()
#6  0x00000000006bee79 in dtrace_execute_ex ()
#7  0x00007ffff4f57d7d in xdebug_execute_ex (execute_data=0x7ffff7f83100) at /build/buildd/xdebug-2.2.3/build-php5/xdebug.c:1437
#8  0x00000000006d0810 in zend_execute_scripts ()
#9  0x0000000000670a05 in php_execute_script ()
#10 0x0000000000780cee in ?? ()
#11 0x0000000000460290 in main ()


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-18 04:19 UTC]
-Package: SPL related +Package: SPL_Types
 [2014-10-15 10:30 UTC] vpassapera at gmail dot com
This affects all SPL Classes. At the moment, the only way around this is to decorate the SPL class, not extend it.

However, this is a serious issue since the classes seem to be built for inheritance. If that's not the case, it should be noted in the documentation.

At least until we have some real types with the current functions built into them.
 [2014-10-15 21:29 UTC] vpassapera at gmail dot com
It should be noted, that SplType functionality is non-existent when you decorate it instead of extending it.

Therefore, this needs to be fixed ASAP please!
 [2015-04-29 23:13 UTC] php66448 at mailinator dot com
Also an issue with PHP (cli) (built: Mar 24 2015 11:23:10) on Ubuntu 14.10.
 [2017-01-10 08:14 UTC]
-Status: Open +Status: Suspended
 [2017-01-10 08:14 UTC]
Suspending this report as the extension have not had a release for almost 5 years.  Please revive this if the extension once again shows life
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 01 05:01:29 2024 UTC