Edit report at https://bugs.php.net/bug.php?id=60104&edit=1

 ID:                 60104
 Comment by:         patrickalla...@php.net
 Reported by:        patrickalla...@php.net
 Summary:            Segmentation Fault
 Status:             Feedback
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   Gentoo Linux
 PHP Version:        trunk-SVN-2011-10-20 (SVN)
 Block user comment: N
 Private report:     N

 New Comment:

The segfault appears the second time it executes $this->handler-
>sqliteCreateFunction() in the setUp().

If unset() isn't used in tearDown(), then there is no crash.


Previous Comments:
------------------------------------------------------------------------
[2011-10-21 07:30:03] patrickalla...@php.net

<?php
class SegfaultTest extends PHPUnit_Framework_TestCase
{
    protected $handler;

    public function setUp()
    {
        try
        {
            $this->handler = new PDO( "sqlite::memory:" );
            $this->handler->sqliteCreateFunction( 'md5', array( 
'ezcQuerySqliteFunctions', 'md5Impl' ), 1 );
        }
        catch ( PDOException $e )
        {
            $this->markTestSkipped(
                'PDO session could not be created: ' . $e->getMessage()
            );
        }
    }

    public function tearDown()
    {
        unset( $this->handler );
    }

    public function testOne()
    {
    }

    public function testTwo()
    {
    }
}

------------------------------------------------------------------------
[2011-10-20 23:55:05] fel...@php.net

Please, paste the test source at somewhere.

------------------------------------------------------------------------
[2011-10-20 16:39:34] patrickalla...@php.net

Description:
------------
PHP 5.4 / trunk segfault while using phpunit.
It only happens with one specific test, however, it looks like that test 
content 
is not relevant at all, emptying its content or putting a 
"die" at the end of that test avoid the segfault. It must happen in the phpunit 
code after the execution of that test.

Tested using trunk @rev 318251

See the backtrace which is more relevant.

Actual result:
--------------
(gdb) bt
#0  0x0000000000922721 in ZEND_SEND_VAL_SPEC_CONST_HANDLER 
(execute_data=0x7fcee7305910) at /home/patrick.allaert/Projets/php-
src/Zend/zend_vm_execute.h:2361
#1  0x0000000000919b46 in execute (op_array=0x7fcee5293f78) at 
/home/patrick.allaert/Projets/php-src/Zend/zend_vm_execute.h:410
#2  0x00000000008dbb61 in zend_execute_scripts (type=8, retval=0x0, 
file_count=3) 
at /home/patrick.allaert/Projets/php-src/Zend/zend.c:1272
#3  0x0000000000852760 in php_execute_script (primary_file=0x7ffff390c1a0) at 
/home/patrick.allaert/Projets/php-src/main/main.c:2414
#4  0x0000000000a25095 in do_cli (argc=6, argv=0x7ffff390c548) at 
/home/patrick.allaert/Projets/php-src/sapi/cli/php_cli.c:983
#5  0x0000000000a25fad in main (argc=6, argv=0x7ffff390c548) at 
/home/patrick.allaert/Projets/php-src/sapi/cli/php_cli.c:1356


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60104&edit=1

Reply via email to