Bug #60247 [NEW]: Segfault when calling class constructor
From:
Operating system: Mac OS 10.7.2 Server
PHP version: 5.4SVN-2011-11-08 (SVN)
Package: Reproducible crash
Bug Type: Bug
Bug description:Segfault when calling class constructor
Description:
------------
This is constantly reproducible on PHP 5.4 (SVN r318919). It does not occur
with
PHP 5.3.
I am using the SilverStripe framework (http://silverstripe.org). The
segfault is
happening when trying to execute line 41 of
sapphire/core/control/ContentController.php
(http://svn.simon.geek.nz/silverstripe/sapphire/branches/2.4/core/control/Content
Controller.php,
$dataRecord = new Page();) when creating a new Signup controller by direct
URL
access (http://localhost/silverstripe/Signup).
The segfault also occurs when simulating a request using the cli (php
sapphire/cli-script.php Signup). The backtrace provided is for this case.
Test script:
---------------
// Signup.php
<?php
class Signup extends LoginPage_Controller {}
// LoginPage.php
<?php
class LoginPage_Controller extends ContentController {
}
Expected result:
----------------
The page displays properly, as it does under PHP 5.3
Actual result:
--------------
Backtrace from gdb:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x0000000100882248 in ZEND_FETCH_CLASS_SPEC_CONST_HANDLER
(execute_data=0x1013a8220) at zend_vm_execute.h:1174
1174 CACHE_PTR(opline->op2.literal-
>cache_slot, EX_T(opline->result.var).class_entry);
(gdb) bt
#0 0x0000000100882248 in ZEND_FETCH_CLASS_SPEC_CONST_HANDLER
(execute_data=0x1013a8220) at zend_vm_execute.h:1174
#1 0x000000010087bcf2 in execute (op_array=0x102229e38) at
zend_vm_execute.h:410
#2 0x00000001008287fb in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
at zend.c:1272
#3 0x000000010076b093 in php_execute_script (primary_file=0x7fff5fbff7f0)
at
main.c:2414
#4 0x00000001009fd9e3 in do_cli (argc=3, argv=0x7fff5fbffaa8) at
php_cli.c:983
#5 0x00000001009ff725 in main (argc=3, argv=0x7fff5fbffaa8) at
php_cli.c:1356
(gdb) p *opline->op2.literal
$2 = {
constant = {
value = {
lval = 4317445712,
dval = 2.1331016040838005e-314,
str = {
val = 0x10156fe50 "Page",
len = 4
},
ht = 0x10156fe50,
obj = {
handle = 22478416,
handlers = 0x4
}
},
refcount__gc = 2,
type = 6 '\006',
is_ref__gc = 1 '\001'
},
hash_value = 0,
cache_slot = 0
}
--
Edit bug report at https://bugs.php.net/bug.php?id=60247&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60247&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60247&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60247&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=60247&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60247&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=60247&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=60247&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=60247&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=60247&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=60247&r=support
Expected behavior: https://bugs.php.net/fix.php?id=60247&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=60247&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=60247&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=60247&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60247&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60247&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=60247&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=60247&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=60247&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=60247&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=60247&r=mysqlcfg
Thread (6 messages)
- simon at simon dot geek dot nz