php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65328 Segfault when getting SplStack object Value
Submitted: 2013-07-24 22:25 UTC Modified: 2013-07-25 05:20 UTC
From: alexander dot moldova at gmail dot com Assigned: colder
Status: Closed Package: SPL related
PHP Version: 5.4.17 OS: Fedora 18
Private report: No CVE-ID:
 [2013-07-24 22:25 UTC] alexander dot moldova at gmail dot com
Description:
------------
- Getting segfault when trying to read assigned class in array or even splStack.

- Using GDB i'm getting one that may help(excluding some echos and dumps)
Program received signal SIGSEGV, Segmentation fault.
0x00000000005e69d8 in zend_std_object_get_class ()


Test script:
---------------
https://gist.github.com/AlexanderC/6075141

This gist is the script that would reproduce the bug

Expected result:
----------------
object(Node)#4 (7) {
  ["children":protected]=>
  array(0) {
  }
  ["parent":protected]=>
  object(Node)#3 (7) {
    ["children":protected]=>
    array(1) {
      [0]=>
      *RECURSION*
    }
    ["parent":protected]=>
    object(Node)#2 (7) {
      ["children":protected]=>
      array(1) {
        [0]=>
        *RECURSION*
      }
      ["parent":protected]=>
      NULL
      ["data":protected]=>
      string(4) "HEAD"
      ["uid":protected]=>
      string(63) 
"a8c3048459faa2d4b4f41acb5a3827675196e96b51f053692308c5.92526655"
      ["index":protected]=>
      int(0)
      ["assureUnique":protected]=>
      bool(false)
      ["storage":"ArrayIterator":private]=>
      array(0) {
      }
    }
    ["data":protected]=>
    string(6) "value1"
    ["uid":protected]=>
    int(1)
    ["index":protected]=>
    int(0)
    ["assureUnique":protected]=>
    bool(false)
    ["storage":"ArrayIterator":private]=>
    array(0) {
    }
  }
  ["data":protected]=>
  string(6) "value2"
  ["uid":protected]=>
  int(2)
  ["index":protected]=>
  int(0)
  ["assureUnique":protected]=>
  bool(false)
  ["storage":"ArrayIterator":private]=>
  array(0) {
  }
}

Actual result:
--------------
Process finished with exit code 139

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-25 05:20 UTC] laruence@php.net
-Assigned To: +Assigned To: colder
 [2013-07-25 14:46 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=9909c4d4c4eb15a64dea0f10e10a8e3a2c0d879d
Log: Fixed bug #65328 (Segfault when getting SplStack object Value)
 [2013-07-25 14:46 UTC] laruence@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 09:02:29 2014 UTC