ID:               41613
 Updated by:       [EMAIL PROTECTED]
 Reported By:      riverfr0zen at elitemail dot org
-Status:           Open
+Status:           Assigned
 Bug Type:         XML related
 Operating System: Linux 2.6.15-28-386 UbuntuDappr
 PHP Version:      4.4.7
-Assigned To:      
+Assigned To:      rrichards


Previous Comments:
------------------------------------------------------------------------

[2007-06-06 23:58:31] riverfr0zen at elitemail dot org

ha. of course, i violate the first instruction :) here it is with
beginning and ending php tags.

<?php

print "begin\n";
function startElement(){}
function endElement(){}

$feed = fopen('http://feeds.feedburner.com/thr/film', "r");

if ($feed)
{
        $_parser = xml_parser_create();
        xml_set_element_handler($_parser, "startElement", "endElement"); 
        xml_set_character_data_handler($_parser, "characterData");
        while ($data = fread($feed, 4096)) {
                if (xml_parse($_parser, $data, feof($feed)) !== 1)
                {
                        print xml_error_string(xml_get_error_code($_parser)) . 
"\n";
                        print xml_get_current_line_number($_parser) . "\n";
                }
        }
        fclose($feed); 
        xml_parser_free($_parser);
}
print "end\n";
?>

------------
if you comment out 

print xml_get_current_line_number($_parser) . "\n";

the script successfully prints out "end". but if it is left there, it
never arrives, and gets a segmentation fault instead.

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

[2007-06-06 20:21:21] riverfr0zen at elitemail dot org

Note: Commenting out the line 

print xml_get_current_line_number($_parser) . "\n";" 

in the simple script above allows the script to complete execution
without a seg fault.

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

[2007-06-06 20:18:33] riverfr0zen at elitemail dot org

function startElement(){}
function endElement(){}

$feed = fopen('http://feeds.feedburner.com/thr/film', "r");

if ($feed)
{
        $_parser = xml_parser_create();
        xml_set_element_handler($_parser, "startElement", "endElement"); 
        xml_set_character_data_handler($_parser, "characterData");
        while ($data = fread($feed, 4096)) {
                if (xml_parse($_parser, $data, feof($feed)) !== 1)
                {
                        print xml_error_string(xml_get_error_code($_parser)) . 
"\n";
                        print xml_get_current_line_number($_parser) . "\n";
                }
        }
        fclose($feed); 
        xml_parser_free($_parser);
}

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

[2007-06-06 20:09:47] [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 the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.



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

[2007-06-06 19:47:23] riverfr0zen at elitemail dot org

Here's the backtrace:

(gdb) bt
#0  0x081c7fdd in normal_updatePosition (enc=0x8394560, ptr=0x8d7a000
<Address 0x8d7a000 out of bounds>,
    end=0x8d67e5d " Technique of the American
Commercial.\"</description>\n</item>\n<item>\n<title>'Golden' shines for
Disney</title>\n<pubDate>2007-06-06</pubDate>\n<guid
isPermaLink=\"true\">http://www.hollywoodreporter.com/h";...,
pos=0x8cbe948) at xmltok_impl.c:1747
#1  0x081b7afe in php_XML_GetCurrentLineNumber (parser=0x8cbe7c0)
    at /usr/local/src/php-4.4.7/ext/xml/expat/xmlparse.c:1571
#2  0x081b54c5 in zif_xml_get_current_line_number (ht=1,
return_value=0x8d5f0ec, this_ptr=0x0,
    return_value_used=1) at
/usr/local/src/php-4.4.7/ext/xml/xml.c:1437
#3  0x082291f2 in execute (op_array=0x8cdab84) at
/usr/local/src/php-4.4.7/Zend/zend_execute.c:1681
#4  0x08229498 in execute (op_array=0x8cced9c) at
/usr/local/src/php-4.4.7/Zend/zend_execute.c:1725
#5  0x08229498 in execute (op_array=0x8a71d3c) at
/usr/local/src/php-4.4.7/Zend/zend_execute.c:1725
#6  0x08229498 in execute (op_array=0x8a7555c) at
/usr/local/src/php-4.4.7/Zend/zend_execute.c:1725
#7  0x08229498 in execute (op_array=0x8a73204) at
/usr/local/src/php-4.4.7/Zend/zend_execute.c:1725
#8  0x08229498 in execute (op_array=0x848ec3c) at
/usr/local/src/php-4.4.7/Zend/zend_execute.c:1725
#9  0x08229498 in execute (op_array=0x8842254) at
/usr/local/src/php-4.4.7/Zend/zend_execute.c:1725
#10 0x08229498 in execute (op_array=0x8843e64) at
/usr/local/src/php-4.4.7/Zend/zend_execute.c:1725
#11 0x08229498 in execute (op_array=0x8841b44) at
/usr/local/src/php-4.4.7/Zend/zend_execute.c:1725
#12 0x08229498 in execute (op_array=0x8488c1c) at
/usr/local/src/php-4.4.7/Zend/zend_execute.c:1725
#13 0x08229498 in execute (op_array=0x848859c) at
/usr/local/src/php-4.4.7/Zend/zend_execute.c:1725
#14 0x08212d7d in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
    at /usr/local/src/php-4.4.7/Zend/zend.c:939
#15 0x081d9897 in php_execute_script (primary_file=0xbfc2275c) at
/usr/local/src/php-4.4.7/main/main.c:1757
#16 0x082314b4 in main (argc=2, argv=0xbfc22844) at
/usr/local/src/php-4.4.7/sapi/cli/php_cli.c:838
(gdb)

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/41613

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

Reply via email to