|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48680 5.3 segfaults where 5.2 doesn't
Submitted: 2009-06-24 21:16 UTC Modified: 2009-06-25 20:50 UTC
From: ms419 at freezone dot co dot uk Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.3CVS-2009-06-24 (snap) OS: Debian
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: ms419 at freezone dot co dot uk
New email:
PHP Version: OS:


 [2009-06-24 21:16 UTC] ms419 at freezone dot co dot uk

The project I contribute to works with PHP 5.2, but causes PHP 5.3 to segfault,

The project source is available from Subversion,

I downloaded and built the latest 5.3 snapshot,

 $ ./configure --enable-debug --with-pdo-mysql
 $ make

I got a backtrace with gdb,


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-24 21:20 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

 [2009-06-24 21:22 UTC]
Any chance you could extract a simple reproducing case from that code?  It is obviously related to the call_user_func_array() call there, so if you could figure out the exact arguments to the call and create a simple test case that causes the crash it would speed this up.
 [2009-06-25 11:43 UTC]
I tried to reproduce it, fetched the tree, configured the database, the application didn't properly run but didn'T segfault.

Running fro mthe command line as in your backtrace gave me some HTML output. So please try to make the scrit shorter so we have a chance to understand it.

A good starting point might be a PHP-level backtrace to generate this we have a .gdbinit file with a dump_bt macro.

source /path/to/php-src/.gdbinit
help dump_bt

Should get oyu started there.

 [2009-06-25 19:26 UTC] ms419 at freezone dot co dot uk
Thanks for your help rasmus and johannes, I thought it was going to be very difficult to isolate this bug in a sample script, but with the help of dump_bt, it was not so hard. Thanks for that advice!

Here's a sample script which exposes the bug I think I'm experiencing in our project. It works in 5.2 but segfaults in 5.3.


class A
  public function x()

class B extends A
  public function x()
    $args = func_get_args();

    return call_user_func_array(array($this, 'parent::x'), $args);

class C extends B

$c = new C;
 [2009-06-25 20:50 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

Thanks for the report. From the UPGRADING:

    call_user_func() now propagates $this even if the callee is
    the parent class

This includes the class to which the call is relative, might not be clear from the entry.

The fix for the code would be replacing parent::x with A::x.

Thanks for the report, I'll try to come up with a more clear wording for UPGRADING and other documentation.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Mar 30 11:01:25 2020 UTC