ID: 30266
Updated by: [EMAIL PROTECTED]
Reported By: sorin at intersol dot ro
Status: Verified
Bug Type: Reproducible crash
Operating System: WinXP
PHP Version: 5.0.2
Assigned To: andi
New Comment:
Reproduceable using array_walk as well:
<?php
class testc
{
var $b = "c";
function crash($val) {
$this->b = $val;
throw new Exception("ex");
}
}
$fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana",
"c"=>"apple");
$myobj = new testc();
function test_print ($item2, $key, $userd) {
$userd->crash($item2);
}
array_walk ($fruits, 'test_print', $myobj);
?>
comment out either line in the crash() method and it works fine
otherwise: Invalid opcode when run under HEAD and segfault when run
under 5_0 branch. same results as Hartmut's script
Previous Comments:
------------------------------------------------------------------------
[2005-02-06 01:37:41] [EMAIL PROTECTED]
The following code gives me
Fatal error: Invalid opcode 137/1/8. in
/home/hartmut/tmp/PECL_Gen.test/pecl-gen on line 24
using latest CVS HEAD on Linux:
<?php
class XML_Parser
{
var $dummy = "a";
function parse($data)
{
$parser = xml_parser_create();
xml_set_object($parser, $this);
xml_set_element_handler($parser, 'startHandler', 'endHandler');
xml_parse($parser, $data, true);
xml_parser_free($parser);
}
function startHandler($XmlParser, $tag, $attr)
{
// commenting out either line prevents the crash
$this->dummy = "b";
throw new Exception("ex");
}
function endHandler($XmlParser, $tag)
{
}
}
$p1 = new Xml_Parser();
$p1->parse('<tag1><tag2></tag2></tag1>'); // this crashes
# $p1->parse('<tag1></tag1>'); // this doesn't crash
?>
------------------------------------------------------------------------
[2004-12-06 01:00:10] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2004-11-28 14:35:33] [EMAIL PROTECTED]
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 possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2004-09-29 18:24:58] [EMAIL PROTECTED]
Can you please post a working piece of reproducing code? Preferably no
more than 20 lines.
Thanks.
------------------------------------------------------------------------
[2004-09-28 20:46:14] sorin at intersol dot ro
Description:
------------
Very basic use test of adodb generate a complete crash on 5.0.2 and
last build PHP 5.1.0-dev (cli) (built: Sep 28 2004 16:26:27)
gives this:
Invalid opcode 137/1/8 in adodb-xmlschema.inc.php.
Runing php with -e parameters makes no difference.
Reproduce code:
---------------
function _tag_close( &$parser, $tag ) {
>> $this->currentElement = '';
switch( strtoupper( $tag ) ) {
case 'TABLE':
$this->parent->addSQL(
Expected result:
----------------
Anything but not a crash?!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30266&edit=1