php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30266 Invalid opcode 137/1/8
Submitted: 2004-09-28 20:46 UTC Modified: 2005-03-11 02:15 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: sorin at intersol dot ro Assigned: helly (profile)
Status: Closed Package: Reproducible crash
PHP Version: 5.0.3 OS: *
Private report: No CVE-ID: None
 [2004-09-28 20:46 UTC] 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?!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-29 18:24 UTC] andi@php.net
Can you please post a working piece of reproducing code? Preferably no more than 20 lines.
Thanks.
 [2005-02-06 01:37 UTC] hholzgra@php.net
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


?>

 [2005-02-11 00:07 UTC] rrichards@php.net
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
 [2005-03-11 02:15 UTC] helly@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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC