php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44039 Throwing an exception results in Access Violation on Win32 ISAPI.
Submitted: 2008-02-04 14:03 UTC Modified: 2008-07-11 12:34 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: RQuadling at GMail dot com Assigned:
Status: Closed Package: IIS related
PHP Version: 5.3CVS-2008-02-04 (snap) OS: Windows XP SP2
Private report: No CVE-ID: None
 [2008-02-04 14:03 UTC] RQuadling at GMail dot com
Description:
------------
The following code worked on a snapshot in January.

The code only seems to go wrong in ISAPI (Using Sambar Server).

Works fine in CLI mode.

php -n -derror_reporting=-1 -ddisplay_errors=1 -r "throw new exception('foo' . $bar, 0);"

produces ...

Notice: Undefined variable: bar in Command line code on line 1

Fatal error: Uncaught exception 'Exception' with message 'foo' in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code on line 1

Reproduce code:
---------------
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
throw new exception('Missing variable ' . $unknown, 0);
?>

Expected result:
----------------
Notice: Undefined variable: unknown in C:\unk.php on line 4

Fatal error: Uncaught exception 'Exception' with message 'Missing variable ' in C:\unk.php:4
Stack trace:
#0 {main}
  thrown in C:\unk.php on line 4

Actual result:
--------------
PHP has encountered an Access Violation at 00000000

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-05 10:07 UTC] RQuadling at GMail dot com
<?php
error_reporting(0);
ini_set('display_errors', 0);
throw new exception('Broken exceptions', 0);
?>

Results in "PHP has encountered an Access Violation at 00000000".

Nothing to do with the undefined variable.

Also, different output at the command line (this may be me not getting something quite right).

php -n unk.php
[No output]


php -n -r "throw new exception('Broken exceptions', 0);"

Fatal error: Uncaught exception 'Exception' with message 'Broken exceptions' in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code on line 1


So, we have 3 different outputs for the same line of code.

Nothing if using PHP as CLI interpreter.
Fatal error when using PHP with STDIN (correct output).
Access Violation when using PHP via ISAPI interface (Sambar Server).
 [2008-03-24 08:32 UTC] slava at shabrov dot com
I have v 5.2.4 working for almost half a year - no problem. Had to enable "magic_quotes_gpc" to simulate client's site and all hell broke loose.
"PHP has encountered an Access Violation at 01B6AB92"
"Fatal error: Cannot redeclare pma_ifsetor() (previously declared in C:\wwwroot\phpmyadmin\libraries\core.lib.php:38) in C:\wwwroot\phpmyadmin\libraries\core.lib.php on line 45"
... and so on.
Turned it off and peace is restored.
Windows 2003 Server Standard x86 on Pentium IV. ISAPI configuration. System disk E:; boot disk C: all NTFS. 
Somehow installer put number of files on C:, creating "program files/php" folder (maybe a bug in installer). php.ini file in e:\program files\php
Hope this helps.
 [2008-07-11 12:34 UTC] auroraeosrose@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

This was present in all threaded SAPIS for awhile, dup of #44226
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 07:01:32 2024 UTC