php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37188 Wrong value of include_path causes 'Official' PHP4.4.2, PHP 4.4.3.3dev to crash
Submitted: 2006-04-24 22:27 UTC Modified: 2006-06-28 01:00 UTC
Votes:9
Avg. Score:4.8 ± 0.4
Reproduced:9 of 9 (100.0%)
Same Version:5 (55.6%)
Same OS:7 (77.8%)
From: phpclub_ru at bougakov dot com Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 4.4.2 OS: Windows XP Home, SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phpclub_ru at bougakov dot com
New email:
PHP Version: OS:

 

 [2006-04-24 22:27 UTC] phpclub_ru at bougakov dot com
Description:
------------
PHP 4.4.3.3 from snaps.php.net (php4-STABLE-200604220230), as well as 'official' PHP 4.4.2 available in the 'Downloads' section of php.net crashes with the following message:

####################### cut here #################################

AppName: php.exe	 AppVer: 4.4.3.3	 ModName: ntdll.dll
ModVer: 5.1.2600.2180	 Offset: 00010f2b

Unhandled exception at 0x7c910f2b in php.exe: 0xC0000005: Access violation reading location 0x0009000d.


####################### / cut here #################################

My system is XP Home SP2, Apache 1.3.33
Bug reproduces all times when I open one PHP script (can't reproduce it here since it is a part of large obfuscated project of other developer; you can download it here: http://e2.ilyabirman.ru/download/e2_oranda_te_v1454_distr.zip, 126Kb).

Doesn't reproduce on PHP 4.3.11. mod_php is affected as well as CGI version.

Crash is caused by the wrong setting in php.ini:

valid example: 
include_path = ".;c:/path/with/some/cyrillic/letters/"

example that causes PHP to crash:
include_path = "c:/path/with/some/cyrillic/letters/"


Reproduce code:
---------------
Code that demonstrates the crash: http://e2.ilyabirman.ru/download/e2_oranda_te_v1454_distr.zip, 126Kb

Expected result:
----------------
PHP should report or just ignore the wrong setting, not to crash.

Actual result:
--------------
MS Visual Studio 2003 EA debugger displays the following:


####################### cut here #################################

malloc.c, line 212:

#ifndef _WIN64
        if (__active_heap != __SYSTEM_HEAP)
            size = (size + BYTES_PER_PARA - 1) & ~(BYTES_PER_PARA - 1);
#endif  /* _WIN64 */
        return HeapAlloc(_crtheap, 0, size);
}  //             <== THIS IS LINE 212

#else  /* WINHEAP */

        /* try to find a big enough free block
         */

####################### / cut here #################################



Call stack:

####################### cut here #################################
--> 	 	ntdll.dll!7c910f2b() 	
 	ntdll.dll!7c910d5c() 	
 	php.exe!004024d9() 	
 	php.exe!004024d9() 	
 	php4ts.dll!100b68f0() 	
 	php4ts.dll!100042fa() 	
 	ntdll.dll!7c91056d() 	
 	php4ts.dll!100b64ec() 	
 	php4ts.dll!100c6810() 	
 	php.exe!004024d9() 	
 	php.exe!004024d9() 	
 	php.exe!004024d9() 	
 	php.exe!004024d9() 	
 	php.exe!004024d9() 	
 	php.exe!004024d9() 	
 	php.exe!004024d9() 	
 	php.exe!00402c6e() 	
 	ntdll.dll!7c9106eb() 	
>	msvcr71.dll!_heap_alloc(unsigned int size=1)  Line 212	C
 	msvcr71.dll!_setargv()  Line 143	C

####################### / cut here #################################

Autos:

####################### cut here #################################
	_crtheap	0x00380000	void *
	size	1	unsigned int
####################### / cut here #################################





Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-24 22:35 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2006-04-24 22:45 UTC] phpclub_ru at bougakov dot com
Already posted.
 [2006-04-25 07:13 UTC] tony2001@php.net
Backtrace without debug symbols doesn't make any sense.
And yes, your debugger points to a wrong place.

Please try to reproduce it on *nix and get a valid backtrace with GDB, if MSVC is unable to give you requested information.
 [2006-04-25 08:14 UTC] phpclub_ru at bougakov dot com
> Backtrace without debug symbols doesn't make any sense.

Can't build debug version of PHP since there is some error in the sources (compiler breaks when processes regex-related files and generates about 18 errors). 

> Please try to reproduce it on *nix and 
> get a valid backtrace with GDB

Got no *nix system. My hosting provider won't let me edit the php.ini

If YOU have got debug version of PHP 4.4.2, you can easily reproduce the bug by editing your php.ini:

from:
include_path = ".;c:/php/includes/"
to:
include_path = "c:/php/includes/"

and opening ANY script with 

<?php 
  include 'whatever.php';
?>
 [2006-04-25 08:23 UTC] bjori@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2006-04-25 08:49 UTC] tony2001@php.net
>Can't build debug version of PHP since there is some error in the sources 
>(compiler breaks when processes regex-related files and generates about 18 errors). 

There is absolutely no need to build PHP yourself.
The process of getting a backtrace is described here:
http://bugs.php.net/bugs-generating-backtrace-win32.php

Please use snapshots instead of homemade builds, as we do not support unofficial win32 builds.

>If YOU have got debug version of PHP 4.4.2, you can easily
> reproduce the bug by editing your php.ini:

No Windows$ here.
And I cannot reproduce it on Linux:

Warning: main(test1.php): failed to open stream: No such file or directory in 
Warning: main(): Failed opening 'test1.php' for inclusion (include_path='&#1088;&#1091;&#1089;&#1089;&#1082;&#1080;&#1077; &#1089;&#1080;&#1084;&#1074;&#1086;&#1083;&#1099;') 

 [2006-04-25 09:42 UTC] phpclub_ru at bougakov dot com
> Please use snapshots instead of homemade builds

There is NO debug pack for Windows version of PHP 4.4.x on http://snaps.php.net/ (only for 5.1.x-dev)

> To properly diagnose the problem, we
> need a short but complete example script 

1. Obtain PHP 4.4.2 for Windows from http://www.php.net/downloads.php
2. Edit php.ini: replace default 
include_path = ".;c:/php/includes/" with
include_path =   "c:/php/includes/"
3. Open test.php in browser containing
<?php 
  include '/whatever.php';
?>
4. Wait for the nice "Unhandled exception at 0x7c910f2b in php.exe" window to appear.
 [2006-04-25 12:27 UTC] edink@php.net
I cannot reproduce this with debug build. You can test it yourself with this build:

http://php.emini.dk/misc/php-4.4.3-dev-Win32-debug.zip

 [2006-04-27 18:56 UTC] phpclub_ru at bougakov dot com
edink,

seems like something wrong is with your debug build. When I am trying to make supplied php.exe to parse any PHP script (including trivial "phpinfo") I always get the same: 

  c:\Downloads\php debug>php -e -n -f php_test.php
  No input file specified.

No matter how I launch it: using Apache, or directly from command line. 

Are you sure everything is OK with your build?
 [2006-04-29 11:44 UTC] mike@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2006-04-30 18:48 UTC] phpclub_ru at bougakov dot com
STOP POSTING AUTOMATED REPLIES JUST FOR CHANGING BUGs STATUS FROM 'open', WITHOUT CARING TO READ IT FIRST!

I can not generate backtrace:
- the debug build from emini.dk is broken - it simply doesn't work
- the source package from php.net (latest .bz2 file for version 4.4.2) doesn't compile - it breaks on

c:\php\php-4.4.2\ext\pcre\pcrelib\pcre_internal.h(219) : fatal error C1189: #error :  LINK_SIZE must be either 2, 3, or 4

Anyway the bug reproduces on two different machines with official PHP 4.4.2 binary from your website.

Don't want to check it out for yourselves with the official binaries ("my version from some cvs works" is not the answer)? Then give me the sources that will compile, or compiled binary that actually runs.
 [2006-04-30 23:40 UTC] edink@php.net
Seems that there is a problem with cgi and debug mode. Will check it out.

I have no problems compiling "Debug_TS" build.
 [2006-05-01 15:14 UTC] tony2001@php.net
Please change your attitude to something more productive.
Since nobody except you is able to reproduce the problem, please do something useful and at least _try_ to provide more info instead of TYPING WITH CAPS LOCK ON.
 [2006-06-28 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, 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".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 02:01:29 2024 UTC