Hello dbeu,
I enclose the section of code containing file(). Looking at teh code
again, the problem might be an XML function. If I comment out the line
with file(), the XML code will not run.

After the problem hit yesterday, I spent about 2 hours commenting out
lines to seee where the problem occurred. I do not remember leaving
file() in and xml out. I will test that this morning.

Peter

Bug Database wrote:
> 
> ID: 8647
> Updated by: dbeu
> Reported By: [EMAIL PROTECTED]
> Old-Status: Open
> Status: Feedback
> Bug Type: Reproduceable crash
> Assigned To:
> Comments:
> 
> can you please append some *short* reproducing code?
> 
> i tested file() with a file greater than 100k and it didn't crash.
> 
> Previous Comments:
> ---------------------------------------------------------------------------
> 
> [2001-01-10 21:05:56] [EMAIL PROTECTED]
> Loading array via file(). File is 4Mb of text. Bang, PHP died.
> 
> I increased PHP memory from 8 MB to 20 Mb but did not fix it. I cut the file down to 
>about 10Kb but that did not fix it. When I comment out the line containing file(), 
>that removes the problem.
> 
> I thought it might not be file(), it might be any part of the code that uses the 
>array so I commented out file() and inserted statements that manually load the array 
>with data. The script ran to completion using the manual array.
> 
> gdb backtrace is gobbledygook to me. I am reading your documentation page to see if 
>any of it is relevant to Windows environment. If your page helps me change my php 
>setup to produce additional diagnostics, I will add them to this report.
> 
> Apache is the latest Apache 1.14 or something from about 3 weeks ago. PHP is PHP 
>4.0.4 from the large download file. NT 4.0 SP6a running without a hitch for 6 months. 
>The code I am working on was working in the middle of last year on a PHP3 downloaded 
>in the middle of last year.
> 
> ---------------------------------------------------------------------------
> 
> Full Bug description available at: http://bugs.php.net/?id=8647



<?php
require("include.php");
require("includexml.php");
$uploaderrorlocation = "Location: " . $upload["indexpage"] .
"?errormessage=uploadxml2db:+";
$uploaderrorfile = "";
if(empty($filename))
        {header($uploaderrorlocation . "No+input+file+named." . "&filename=" .
$upload["filename"]);}
else
        {
        $upload["filename"] = $filename;
        
        $xmlfilearray = file($upload["xmlfiles"] . $upload["filename"]);
        if(isset($xmlfilearray) and $xmlfilearray)
                {
                $uploadxmlparser = xml_parser_create();
                if(!$uploadxmlparser)
                        {print("<p>xml_parser_create error: " .
xml_get_error_code($uploadxmlparser) . "</p>\n");
                        flush();}
                if(!xml_set_element_handler($uploadxmlparser, "xmltagstart",
"xmltagend"))
                        {print("<p>xml_set_element_handler error: " .
xml_get_error_code($uploadxmlparser) . "</p>\n");
                        flush();}
                if(!xml_set_character_data_handler($uploadxmlparser,
"xmlcharacterdata"))
                        {print("<p>xml_set_character_data_handler error: " .
xml_get_error_code($uploadxmlparser) . "</p>\n");
                        flush();}
                if(!xml_set_default_handler($uploadxmlparser, "xmldefaulthandler"))
                        {print("<p>xml_set_default_handler error: " .
xml_get_error_code($uploadxmlparser) . "</p>\n");
                        flush();}
                if(!xml_set_external_entity_ref_handler($uploadxmlparser,
"xmlexternalentity"))
                        {print("<p>xml_set_external_entity_ref_handler error: " .
xml_get_error_code($uploadxmlparser) . "</p>\n");
                        flush();}
                if(!xml_set_notation_decl_handler($uploadxmlparser, "xmlnotation"))
                        {print("<p>xml_set_notation_decl_handler error: " .
xml_get_error_code($uploadxmlparser) . "</p>\n");
                        flush();}
                if(!xml_set_processing_instruction_handler($uploadxmlparser,
"xmlprocessinginstruction"))
                        {print("<p>xml_set_processing_instruction_handler error: " .
xml_get_error_code($uploadxmlparser) . "</p>\n");
                        flush();}
                if(!xml_set_unparsed_entity_decl_handler($uploadxmlparser,
"xmlunparsed"))
                        {print("<p>xml_set_unparsed_entity_decl_handler error: " .
xml_get_error_code($uploadxmlparser) . "</p>\n");
                        flush();}
                for($xmlfilearrayindex=0; $xmlfilearrayindex<count($xmlfilearray);
$xmlfilearrayindex++)
                        {
                        if(substr($xmlfilearray[$xmlfilearrayindex], -1, 1) == chr(10))
                                {$xmlfilearray[$xmlfilearrayindex] =
substr($xmlfilearray[$xmlfilearrayindex], 0, -1);}
                        if(!xml_parse($uploadxmlparser, 
$xmlfilearray[$xmlfilearrayindex]))
                                {
                                uploaderror("XML line not working."
                                        . " Line: " . 
xml_get_current_line_number($uploadxmlparser)
                                        . ", column: " . 
xml_get_current_column_number($uploadxmlparser));
                                }
                        if(!empty($xmlaccumulateddata))
                                {
                                print("<br>uploadxml2db: parsed data unused: "
                                        . htmlentities($xmlaccumulateddata) . "\n");
                                flush();
                                }
                        }
                if(!xml_parse($uploadxmlparser, "", 1)) {xmlerror("XML end of file not
working.");}
                xml_parser_free($uploadxmlparser);
                }
        header("Location: " . $upload["indexpage"] . "?uploaded=yes&filename="
. $upload["filename"]);
        }
?>

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to