Perplexing crash with 5.2.9+ php5ts.dll

Perplexing crash with 5.2.9+ php5ts.dll

am 24.07.2009 04:32:15 von Brad Waite

Hello all,

I've been battling with a crash on a somewhat-fresh XP SP3 under Apache 2.2.11
and any version of PHP higher than 5.2.8. The problem *appears* to be with
php5ts.dll. Here's what I'm getting in my httpd error log:

[notice] Parent: child process exited with status 3221225477 -- Restarting.

There are no errors (startup or otherwise) for PHP.

I installed 5.2.10 from the .msi with the following extensions: bzip2, cURL,
GD2, IMAP, MB String, MySQL, MySQLi, OpenSSL, PDO (and Mysql driver), SOAP,
Sockets, XML-RPC, XSL & zip.

The crash occurs when trying to log into Drupal. I can get my login page, but
my Apache crashes when loading the main page. So far I haven't been able to
isolate WHERE in the code it's crashing, but I can do more digging if
necessary. It's crashing under both PHP 5.2.9 and 5.2.10.

I first assumed it was a extension problem, so I commented out extensions, one
at a time, until I could successfully log in. When cURL wasn't loaded, the
whole site works great. I found this odd since it works fine under 5.2.8 on my
laptop with cURL enabled. I'm not aware of any code in my Drupal install that
uses cURL but I did a quick test and was able to fetch a web page with cURL,
furthering the mystery.

That led me to think it may have something to do with the SSL libs, so I tried
0.9.8i, j & k, with no success. I made sure the same version was used for both
Apache and PHP; no difference.

I also used Process Explorer to verify that the right DLLs are being loaded as
I'd read elsewhere about the SSL or MySQL libs needing to be either in my PATH,
/windows/system32, or apache/bin. Regardless of where they were located, they
loaded fine.

So copied my PHP dir from the laptop over and bounced Apache; Bingo!everything
woke up beautifully. That led me to swap out DLLs from the laptop's 5.2.8 with
the 5.2.10 install. The only DLL that made a difference was php5ts.dll.
5.2.8's php5ts works great, 5.2.10's php5ts crashes.

I'm hesitant to submit a bug since 90% of the bugs I've seen are dupes or
mis-configurations, but I also haven't found anyone else experiencing this
issue with recent builds.

Any suggestions?

Thanks,

Brad Waite




--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Perplexing crash with 5.2.9+ php5ts.dll

am 24.07.2009 10:56:56 von Richard Quadling

2009/7/24 Brad Waite :
> Hello all,
>
> I've been battling with a crash on a somewhat-fresh XP SP3 under Apache 2=
..2.11
> and any version of PHP higher than 5.2.8.  The problem *appears* to =
be with
> php5ts.dll.  Here's what I'm getting in my httpd error log:
>
> [notice] Parent: child process exited with status 3221225477 -- Restartin=
g.
>
> There are no errors (startup or otherwise) for PHP.
>
> I installed 5.2.10 from the .msi with the following extensions: bzip2, cU=
RL,
> GD2, IMAP, MB String, MySQL, MySQLi, OpenSSL, PDO (and Mysql driver), SOA=
P,
> Sockets, XML-RPC, XSL & zip.
>
> The crash occurs when trying to log into Drupal.  I can get my login=
page, but
> my Apache crashes when loading the main page.  So far I haven't been=
able to
> isolate WHERE in the code it's crashing, but I can do more digging if
> necessary.  It's crashing under both PHP 5.2.9 and 5.2.10.
>
> I first assumed it was a extension problem, so I commented out extensions=
, one
> at a time, until I could successfully log in.  When cURL wasn't load=
ed, the
> whole site works great.  I found this odd since it works fine under =
5.2.8 on my
> laptop with cURL enabled.  I'm not aware of any code in my Drupal in=
stall that
> uses cURL but I did a quick test and was able to fetch a web page with cU=
RL,
> furthering the mystery.
>
> That led me to think it may have something to do with the SSL libs, so I =
tried
> 0.9.8i, j & k, with no success.  I made sure the same version was us=
ed for both
> Apache and PHP; no difference.
>
> I also used Process Explorer to verify that the right DLLs are being load=
ed as
> I'd read elsewhere about the SSL or MySQL libs needing to be either in my=
PATH,
> /windows/system32, or apache/bin.  Regardless of where they were loc=
ated, they
> loaded fine.
>
> So copied my PHP dir from the laptop over and bounced Apache; Bingo!every=
thing
> woke up beautifully.  That led me to swap out DLLs from the laptop's=
5.2.8 with
> the 5.2.10 install.  The only DLL that made a difference was php5ts.=
dll.
> 5.2.8's php5ts works great, 5.2.10's php5ts crashes.
>
> I'm hesitant to submit a bug since 90% of the bugs I've seen are dupes or
> mis-configurations, but I also haven't found anyone else experiencing thi=
s
> issue with recent builds.
>
> Any suggestions?
>
> Thanks,
>
> Brad Waite
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

What happens if you try to run PHP from the command line?

php -v
php -m
php --ini

Enable all the extensions you want.

Can you make sure that in the ini file ...

display_startup_errors =3D On

just in case you are missing a really obvious error.

Richard.


--=20
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474=
731
"Standing on the shoulders of some very clever giants!"
ZOPA : http://uk.zopa.com/member/RQuadling

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Perplexing crash with 5.2.9+ php5ts.dll

am 24.07.2009 17:12:39 von Brad Waite

Richard Quadling wrote:

> What happens if you try to run PHP from the command line?
>
> php -v

PHP 5.2.10 (cli) (built: Jun 17 2009 16:16:57)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with Zend Debugger v5.2.15, Copyright (c) 1999-2008, by Zend Technologies

> php -m

[PHP Modules]
bcmath
bz2
calendar
com_dotnet
ctype
curl
date
dom
filter
ftp
gd
hash
iconv
imap
json
libxml
mbstring
mcrypt
mysql
mysqli
odbc
openssl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_sqlite
Reflection
session
SimpleXML
soap
sockets
SPL
SQLite
standard
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend Debugger
zip
zlib

[Zend Modules]
Zend Debugger

> php --ini

Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File: C:\Program Files\PHP\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)

> Enable all the extensions you want.
>
> Can you make sure that in the ini file ...
>
> display_startup_errors = On
>
> just in case you are missing a really obvious error.

Yep, I've got all the logging enabled. Nothing's showing up in the event log.

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Perplexing crash with 5.2.9+ php5ts.dll

am 24.07.2009 21:19:59 von Brad Waite

Richard Quadling wrote:
> 2009/7/24 Brad Waite :
>> Richard Quadling wrote:
>>
>>> What happens if you try to run PHP from the command line?
>>>
>>> php -v
>> PHP 5.2.10 (cli) (built: Jun 17 2009 16:16:57)
>> Copyright (c) 1997-2009 The PHP Group
>> Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
>> with Zend Debugger v5.2.15, Copyright (c) 1999-2008, by Zend Technologies
>>
>>> php -m
>> [PHP Modules]
>> bcmath
>> bz2
>> calendar
>> com_dotnet
>> ctype
>> curl
>> date
>> dom
>> filter
>> ftp
>> gd
>> hash
>> iconv
>> imap
>> json
>> libxml
>> mbstring
>> mcrypt
>> mysql
>> mysqli
>> odbc
>> openssl
>> pcre
>> PDO
>> pdo_mysql
>> PDO_ODBC
>> pdo_sqlite
>> Reflection
>> session
>> SimpleXML
>> soap
>> sockets
>> SPL
>> SQLite
>> standard
>> tokenizer
>> wddx
>> xml
>> xmlreader
>> xmlrpc
>> xmlwriter
>> xsl
>> Zend Debugger
>> zip
>> zlib
>>
>> [Zend Modules]
>> Zend Debugger
>>
>>> php --ini
>> Configuration File (php.ini) Path: C:\WINDOWS
>> Loaded Configuration File: C:\Program Files\PHP\php.ini
>> Scan for additional .ini files in: (none)
>> Additional .ini files parsed: (none)
>>
>>> Enable all the extensions you want.
>>>
>>> Can you make sure that in the ini file ...
>>>
>>> display_startup_errors = On
>>>
>>> just in case you are missing a really obvious error.
>> Yep, I've got all the logging enabled. Nothing's showing up in the event log.
>>
>
> OK, so far so good.
>
> Now create a simple PHP script which you can run at the command line
> which you think will cause the issue.
>
> If you can produce a simple test case, then allow us to run it to see
> if it is reproducible.
>

So far simple tests have been unable to reproduce the issue. I'll try to debug
the Drupal install to the point where I can isolate the breakage.

Thanks for the help so far.

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Perplexing crash with 5.2.9+ php5ts.dll

am 25.07.2009 17:54:01 von Brad Waite

Richard Quadling wrote:

> OK, so far so good.
>
> Now create a simple PHP script which you can run at the command line
> which you think will cause the issue.
>
> If you can produce a simple test case, then allow us to run it to see
> if it is reproducible.
>

Okay, found the problem; it's with simplexml_load_string() and with some bad code.

simplexml_load_string() under 5.2.8 will return a proper SimpleXMLElement
object from a non-UTF-16-encoded bit of XML, even though the XML says that it
*is* encoded with UTF-16.

Under 5.2.9+, simplexml_load_string() tosses a warning and returns FALSE.

Apache was crashing because a poorly written SimpleXMLtoArray() function was
recursively calling itself without checking the arguments first. I suspect it
simply ran out of memory, but I didn't step through it enough times to verify.

Here's a bit of code that can reproduce the "problem":


$xmlstr = ' xmlns="http://www.foo.com/service">';
$xml = simplexml_load_string( $xmlstr, "SimpleXMLElement", LIBXML_NOCDATA );


Why the change in encoding-handling between the PHP versions? I can't see
anything in the 5.2.9 Changelog that would affect this.

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php