Hi,
I've encountered a crash while using bcompiler (version 0.6). Here goes a
backtrace:
#0 0x0000000000536c05 in _efree (ptr=0x2a961411c4)
at /home/sh/php-5.0.3/Zend/zend_alloc.c:281
281 REMOVE_POINTER_FROM_LIST(p);
(gdb) bt
#0 0x0000000000536c05 in _efree (ptr=0x2a961411c4)
at /home/sh/php-5.0.3/Zend/zend_alloc.c:281
#1 0x00000000005446ba in destroy_zend_class (pce=0x2a961411c4)
at /home/sh/php-5.0.3/Zend/zend_opcode.c:165
#2 0x0000000000554b78 in zend_hash_del_key_or_index (ht=0x71f100,
arKey=0x8275b0 "invalidparamexception", nKeyLength=22,
h=6642468091832743628, flag=7437472)
at /home/sh/php-5.0.3/Zend/zend_hash.c:490
#3 0x0000000000555fb1 in zend_hash_reverse_apply (ht=0x71f100,
apply_func=0x540e60 <is_not_internal_class>)
at /home/sh/php-5.0.3/Zend/zend_hash.c:738
#4 0x0000000000541536 in shutdown_executor ()
at /home/sh/php-5.0.3/Zend/zend_execute_API.c:265
#5 0x000000000054d768 in zend_deactivate ()
at /home/sh/php-5.0.3/Zend/zend.c:818
#6 0x00000000005133e3 in php_request_shutdown (dummy=0x2a961411c4)
at /home/sh/php-5.0.3/main/main.c:1212
#7 0x000000000058c98d in main (argc=2, argv=0x7fbffff638)
at /home/sh/php-5.0.3/sapi/cli/php_cli.c:1046
I've narrowed offending code to this (in multiple files):
File: index.php
<?php
include_once('compiler.php');
include_file('config.php');
?>
File compiler.php:
<?php
function include_file($file)
{
static $compiler;
static $ini;
$fh = fopen($file.".phb", "w");
bcompiler_write_header($fh);
bcompiler_write_file($fh, $file);
bcompiler_write_footer($fh);
fclose($fh);
include_once($file.".phb");
}
?>
File config.php:
<?php
include_file('exception.php');
?>
File exception.php:
<?php
class RuntimeException extends Exception
{
public function __construct($message = NULL)
{
if (is_string($message)) {
$message = sprintf("Error: %s.", $message);
} else {
$message = 'Unknown.';
}
parent::__construct($message);
}
}
class InvalidParamException extends RuntimeException
{
public function __construct()
{
parent::__construct('Invalid params.');
}
}
?>
--
mg
|