php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21319 the PHP Script Interpreter crashes.
Submitted: 2003-01-01 13:04 UTC Modified: 2003-01-30 03:35 UTC
Votes:4
Avg. Score:4.8 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:4 (100.0%)
From: odarcan at hotmail dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.3.0 OS: windows xp
Private report: No CVE-ID: None
 [2003-01-01 13:04 UTC] odarcan at hotmail dot com
Hi, i've just upgraded to php 4.3.0 and i'm pleased the fsockopen timeout problem has been fixed..

but now to something more serious:

the php script interpreter crashes, windows takes over command and says "PHP Script Interpreter has encountered a problem and needs to close. We are sorry for the inconvenience." and you get to choose to send or dont send an error report to microsoft
("please tell microsoft about this problem" it says)

this happens very often... i suspect this has something to do with the die() construct and/or the mysql interface... because the crash often comes directly after a erroneus mysql query a it's die-error-message... but not always.. i think.. sometimes no error is produced by php at all..

i want to be of more help by telling you how to reproduce the error but i haven't figured out how to figure out how to tell you to reproduce the error..

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-01 13:15 UTC] derick@php.net
Okay, then we set it to suspended until you can provide some more info.
 [2003-01-01 13:47 UTC] odarcan at hotmail dot com
check this out:

THIS IS THE CODE:
result=mysql_query($querystring[$a]) or die ("ERROR: $a : ".$querystring[$a].mysql_error());

THIS IS THE OUTPUT:
ERROR: 3 : 1.48592465966E-313You have an error in your SQL syntax near '3766568' at line 1<br />

PLUS THIS:
<b>Warning</b>:  Unknown list entry type in request shutdown (61) in <b>Unknown</b> on line <b>0</b><br />

and then... BOOOOOM it crashes..
but the weird warning is not always typed.. perhaps in only 1 of every 5 crash..
 [2003-01-02 07:07 UTC] odarcan at hotmail dot com
what kind of information do you need additionally, i dont know if i may be able to reproduce the crash (my script DOES crash all the time but i dont know what causes it)
 [2003-01-02 11:51 UTC] odarcan at hotmail dot com
I AM STILL WAITING FOR YOUR COMMENTS WAKE UP PLEASE
 [2003-01-02 15:24 UTC] odarcan at hotmail dot com
"this just in":

FATAL:  erealloc():  Unable to allocate 59 bytes

and then again: BOOM

cool eh?
 [2003-01-02 15:51 UTC] odarcan at hotmail dot com
FATAL:  emalloc():  Unable to allocate 1936028514 bytes

is this php's fault or the os'?
 [2003-01-02 15:52 UTC] odarcan at hotmail dot com
i have by the way only 500 MB of ram
 [2003-01-04 05:08 UTC] odarcan at hotmail dot com
Hi, i've just upgraded to php 4.3.0 and i'm pleased the fsockopen
timeout problem has been fixed..

but now to something more serious:

the php script interpreter crashes, windows takes over command and says
"PHP Script Interpreter has encountered a problem and needs to close. We
are sorry for the inconvenience." and you get to choose to send or dont
send an error report to microsoft
("please tell microsoft about this problem" it says)

this happens very often... i suspect this has something to do with the
die() construct and/or the mysql interface... because the crash often
comes directly after a erroneus mysql query a it's die-error-message...
but not always.. i think.. sometimes no error is produced by php at
all..

i want to be of more help by telling you how to reproduce the error but
i haven't figured out how to figure out how to tell you to reproduce the
error..
 [2003-01-07 03:19 UTC] rene at laerke dot net
Hi, i'm getting the same errors on two different Windows XP Pro installations. 

I'll try to get some more information (xp related addresses from the crash) but from the head i remember that the problem is php_iisfunc.dll.

The web'server (PWS) serves seems the pages correctly but at the end of the session the error occurs. I can reproduce the error everytime in multiple scenarios.

I know there is another reported bug related to Apache  under WinXP (php_apachefunc.dll) and i won't be surprised if this is actually a related issue.
 [2003-01-07 13:56 UTC] odarcan at hotmail dot com
I am using Apache and yes, it may be the same problem, what i don't understand is why these guys dont respond, i would really like to know if they're into the problem or if they haven't even read my messages yet..

a simple "we're looking into the problem" would be fine.. but nooo..
 [2003-01-07 14:05 UTC] odarcan at hotmail dot com
i withdraw my speculation about the die construct beeing the problem;

i have a script that does.. something (checks urls & downloads them via fsockopen) 20 times in a for loop from 1 to 20.. sometimes there is an error when downloading, and naturally, to move on to the next url, i use the continue construct (or whatever it's called).

I run my scripts from the command prompt with a batch script that runs "PHP SCRIPTNAME.PHP" over and over in an infinite loop..

since the php script is executed in a loop, it wouldn't really matter if you call continue or die since the next url in the database would be processed either way..

Now this should be interesting;
NOT A SINGLE CRASH, has ever occurred ever since i've started using die instead of continue on download errors..

and you're still not responding..

osman darcan
 [2003-01-07 17:46 UTC] edink@php.net
In order to look into the problem we would need a short and complete script that reproduces the problem. Without that there is very little information to go on.
 [2003-01-08 13:27 UTC] pollita@php.net
Don't quote me on this, but I believe this bug is related to several other bugs which have been reported since 4.3.0.

There *appears* to be an issue with garbage collection when the interpreter is in the final stages of shutdown (script exit).

I can't be more specific because it's related to a portion of the PHP Core which I'm not qualified to debug and is a heisenbug in the most classical sense.

Rest assured though that there ARE developers working on this issue.

Any additional information you can provide such as  backtraces and short, simple pieces of code which reproduce the error will aid in the isolation and irradication of this bug.
 [2003-01-08 13:34 UTC] rene at laerke dot net
Hi,

sorry I haven't been able to isolate in sort, but I found out this much :

Installing 4.3.0 by default enables the php_iisfunc.dll extension in the php.ini file. (Using Windows XP and IIS).

I'm not aware of using this functionality and when I remove the use of the php_iisfunc.dll (comment the line) the error doen't occur.

Hopefully this can be of some use.

/Rene'
 [2003-01-24 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over 2 weeks, 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".
 [2003-01-25 03:31 UTC] alexnow at msn dot no dot spam dot com
Hello, I've run into what seems to be the same problem.
I also have a way to reproduce it:
WinXP HE (NT 5.1), Apache 1.3.27, PHP 4.3.0 on CGI-FCGI

<?php
error_reporting(E_ALL ^ E_WARNING);
set_time_limit(10);

for($x=1;$x<10000;$x++){
$f = fsockopen('127.0.0.1',$x,$errno,$errstr,1);
print "Port $x: ";
print($f)?'Success!':'Failed!';
print "<br />";
}
?>

Almost every single time it causes an HTTP 500 Error
This from the server's log:

[Sat Jan 25 01:00:23 2003] [error] [client 127.0.0.1] Premature end of script headers: {PATH TO PHP}/php.exe
[Sat Jan 25 01:00:23 2003] [error] [client 127.0.0.1] FATAL:  erealloc():  Unable to allocate 10 bytes


You may need to refresh that page a few times to get the "Program has crashed and needs to close/Report to MS" window. When this happens, the browser hangs until you click something on that dialog box.

btw, I've also increased the timeout to fsockopen(), while the error still occures, it seems easier to reproduce with lower timeouts.

I have the files appcompat.txt, manifest.txt and php.exe.mdmp generated by the error reporting app available upon request.

Could this also be related to http://bugs.php.net/bug.php?id=21262 ?

Thank you for your time.
- Alex, http://alexnow.com
 [2003-01-27 02:18 UTC] odarcan at hotmail dot com
in order to set the status, i seem to have to edit this...

thank you alex, this does crash php, i hope it's the same problem.
 [2003-01-28 03:16 UTC] odarcan at hotmail dot com
Alex' script does not crash with the latest snapshot,

checking my own code..
 [2003-01-28 05:06 UTC] sniper@php.net
Okay..btw. Why did you again use that 'Add comment' link?
The URL in the email you get does not point there..?
(just curious :)

And close this if your stuff also works with the snapshot..

 [2003-01-28 11:00 UTC] odarcan at hotmail dot com
I've memorized the url :) (didn't look at the email) and if i'd edit the submission the status would be set to something other than what you recently set it to..
 [2003-01-29 00:03 UTC] sniper@php.net
You should be using ..&edit=2 (the 'Edit Submission' link)

Anyway, did the snapshot fix the problem for you or not?

 [2003-01-29 15:11 UTC] alexnow at msn dot no dot spam dot com
Hey guys, thank you for checking into this.

I just tryed the latest snapshot (2003-01-29 12:00 GMT-8) and... [drumroll...] the problem seems fixed!

I even used an ob_start() and ob_end_flush() whithin the for loop and got a clean execution.

As for me, you can close this one out!

Thanks again, and keep up the good work.

- Alex, http://alexnow.com
 [2003-01-30 03:35 UTC] odarcan at hotmail dot com
the crashes seem to have ended!

nice talking to you all..
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Aug 14 16:01:28 2024 UTC