php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45801 PHPUnit testcase crashes (segfault)
Submitted: 2008-08-12 16:22 UTC Modified: 2008-08-13 23:27 UTC
From: jtaal at eljakim dot nl Assigned: fb-req-jani (profile)
Status: Closed Package: Reproducible crash
PHP Version: 5.2.6 OS: *
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jtaal at eljakim dot nl
New email:
PHP Version: OS:

 

 [2008-08-12 16:22 UTC] jtaal at eljakim dot nl
Description:
------------
I'm getting a segmentation fault when running a very simple PHPUnit testcase.
I'm using the latest pear package from pear.phpunit.de.

The testcase is issuing an E_STRICT.

I think deep inside PHPUnit something happens that causes this to happen. However, since PHPUnit is "just" a bunch of PHP classes, I dare say this is a bug inside the PHP interpreter.

I've been able to run and crash this on both Linux (debian lenny) and Windows XP SP3 (both using PHP 5.2.6).


Reproduce code:
---------------
<?php // MyTest.php
require_once 'PHPUnit/Framework.php';

class MyObject {
    public function getX() {
        return NULL;
    }
}

class MyTest extends PHPUnit_Framework_TestCase {
    public function test1() {
        $obj = new MyObject;
        $source = & $obj->getX();
    }
}

Actual result:
--------------
$ phpunit MyTest.php

Strict Standards: Only variables should be assigned by reference in /home/jtaal/public_html/MyTest.php on line 18
PHPUnit 3.2.21 by Sebastian Bergmann.

Segmentation fault


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-13 07:51 UTC] jtaal at eljakim dot nl
Sebastian Bergman managed to narrow it down:
http://bugs.php.net/bug.php?id=45805

please close this bug
 [2008-08-13 23:27 UTC] nicos@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks to Dmitry.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 06:01:28 2024 UTC