php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22950 Stack overflow with IIS, ISAPI
Submitted: 2003-03-29 03:24 UTC Modified: 2003-07-14 18:03 UTC
Votes:12
Avg. Score:4.5 ± 0.9
Reproduced:9 of 9 (100.0%)
Same Version:3 (33.3%)
Same OS:7 (77.8%)
From: heyjohnlim at yahoo dot com Assigned: edink (profile)
Status: Wont fix Package: IIS related
PHP Version: 4.3.2-RC OS: Windows 2000
Private report: No CVE-ID: None
 [2003-03-29 03:24 UTC] heyjohnlim at yahoo dot com
Hello,

I am testing some complicated scripts that use many classes and objects and that connects to mysql. The scripts work fine on Windows with IIS CGI and on Linux with Apache 1.3.

However it crashes with IIS, ISAPI with

  PHP has encountered a Stack Overflow

Tracing the code, it appears to crash in two different places in two different scripts. The crashes are consistently reproducible.

(1) Once while including a file(!) and 
(2) When the script calls an object's method (the method is never executed, so it is during the method invocation). 

There is some faint connection between the two crashes. The key code is a factory class that creates an object that looks something like this, and is where the first crash occurs:

function GetEditor()
{
static $editor;

if (empty($editor)) {
  include_once('editor.inc.php'); ## crashes here
  $editor = new editor();
}
return $editor;
}

The second crash occurs when calling the editor object returned by GetEditor().

$editor->Render(); ## crashes here...


One suspicion was perhaps some extension was not thread-safe. I then removed all extensions from my php.ini and restarted IIS. Only the pre-compiled extensions from the standard PHP Windows distribution such as mysql were installed, and also Zend Optimizer. It still crashed.

Because i suspected the problem might be mysql, so i switched to querying mssql instead. The problem still occurs at the same places.

It is difficult for me to create a simple script to reproduce the problem, because the bug only happens in my  very complicated script.

- John Lim

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-29 03:36 UTC] heyjohnlim at yahoo dot com
>The second crash occurs when calling the editor object
>returned by GetEditor().
>
>$editor->Render(); ## crashes here...

I did a print_r($editor) just before the Render() call and it looked normal. I also called method_exists($editor,'Render') and it returned 1. So the $editor is still in a sane state just before it crashes.
 [2003-03-31 04:13 UTC] heyjohnlim at yahoo dot com
This problem happens still happens with 4.3.2-RC build Mar 31 2003 01:11:32

If you have a debug build i can download, i will be happy to try. I have Visual C++ 6 and debugging facilities installed, but not the full build environment for PHP.
 [2003-04-23 04:28 UTC] sniper@php.net
Edin, could you make the snapshots for win32 be debug-enabled..? :)

 [2003-07-14 18:03 UTC] edink@php.net
Our build environment produces only Release_TS_inline target of the php build. If you need any assistance in helping you setup php build I would be more than happy to help.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC