php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45516 PGSQL seems to crash apache.
Submitted: 2008-07-15 03:37 UTC Modified: 2008-07-30 01:00 UTC
Votes:4
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:3 (75.0%)
From: twilightthorn dot kh at gmail dot com Assigned: pajoye (profile)
Status: No Feedback Package: PostgreSQL related
PHP Version: 5.2.6 OS: Windows Vista Business
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-07-15 03:37 UTC] twilightthorn dot kh at gmail dot com
Description:
------------
As far as I can tell any successful call to a database, local or on an external server, will crash apache. 

I'm using a WAMP2.0c setup using PHP5.2.5 on vista and it did work fine until I added the PHP Postgre extension. 
I do know that the extension is up-to-date, and have in fact even tried to replace it with the one used in PHP5.2.6, it also fails and crashes the server.

Without the extension loaded, PHP/apache will output all errors and any other processing messages before the PG_Connect() call, upon which processing halts.


The system event log refers to ntdll.dll on this crash, but I don't really know why. This does sound an aweful lot like an Apache bug, but it only occurs when PHP's Postgre extension is loaded and the pg_connect(); function is called.


Best regards, and thanks.
Thomas.

Reproduce code:
---------------
<?php
//...

$link = pg_connect("host=localhost port=5432 dbname=public user=postgres password=PASS") or op_err('Con');

//...
?>

Expected result:
----------------
A successful database call and web-page out put.

Actual result:
--------------
I get a pop-up message telling me HTTPD.EXE has stopped working.

This is the information logged in the system by its failure:
------------------
Faulting application httpd.exe, version 2.2.8.0, time stamp 0x47904924, faulting module ntdll.dll, version 6.0.6000.16386, time stamp 0x4549bdc9, exception code 0xc00000fd, fault offset 0x00061635, process id 0x1174, application start time 0x01c8e628c7166890.
------------------

There are no other entries in my PHP or Apache error logs.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-15 03:46 UTC] twilightthorn dot kh at gmail dot com
Also, the reason I'm not currently using PHP5.2.6, all the workarounds submitted to fix the bug of not being able to use PGSQL in that version have not worked for me. 

If some one would be so kind as to give me and actual, detailed, workaround for using PGSQL in PHP5.2.6 on Vista Business, I would be very grateful.
 [2008-07-15 06:36 UTC] pajoye@php.net
Can you try using the 5.2.5's pgsql extension? Our extension not the one from wamp. The extension should work with 5.2.6 as well.
 [2008-07-15 09:01 UTC] twilightthorn dot kh at gmail dot com
Still no go... :( 

System logs the same error, Apache is still crashing.
To be sure it wasn't JUST Apache, I've tested my server by placing some massive load on it. Apache did not crash after well over 4 minutes of work, work that kept my CPU clocked at 100% for the duration. The PGSQL, and PDO_PGSQL extensions both initialized for this test.

I'm coming to think that maybe the problem isn't with the PGSQL extensions, but with my ntdll.dll. After all, these same extensions work on other platforms, and have been found to work on Vista* OS's before, right?

I've found that there is a later version of ntdll.dll on for my system, and would love to try using the newer one. But all the same I don't wish to lose my computer... 
Any other advise that you could offer?
 [2008-07-15 09:07 UTC] pajoye@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.



Can you try it in CLI as well? (in the cmd line php.exe yourscript.php)
 [2008-07-15 10:20 UTC] twilightthorn dot kh at gmail dot com
Trying to run the file through the command line makes the CLI crash as well.
The system logged this for CLI's crash:
-------------------
Faulting application php.exe, version 5.2.6.6, time stamp 0x481b8f60, faulting module ntdll.dll, version 6.0.6000.16386, time stamp 0x4549bdc9, exception code 0xc00000fd, fault offset 0x000447f2, process id 0x1398, application start time 0x01c8e660c8bcb334.
-------------------


As for your Back-trace, I hope this covers it. :)

-------------------
Thread 0 - System ID 4972
Entry point   php+2fc2 
Create time   7/15/2008 3:06:11 AM 
Time spent in user mode   0 Days 0:0:1.497 
Time spent in kernel mode   0 Days 0:0:13.88 






Function     Arg 1     Arg 2     Arg 3   Source 
ntdll!_SEH_prolog4+1a     00413398     004133c0     00000000    
ntdll!RtlAllocateHeap+17c     00140000     00000000     0000021a    
ntdll!RtlpDosPathNameToRelativeNtPathName_Ustr+97     00000001     00413330     004133cc    
ntdll!RtlpDosPathNameToRelativeNtPathName_U+61     00000001     7ffdec00     004133cc    
ntdll!RtlDosPathNameToRelativeNtPathName_U+18     7ffdec00     004133cc     004133c0    
kernel32!FindFirstFileExW+a0     7ffdec00     00000000     00413684    
kernel32!FindFirstFileA+44     0229b770     00413a28     022bd789    
php5ts!virtual_file_ex+6d3     052ae270     00000000     003a2638    
php5ts!php_stat+1c5     00414e58     003a0000     00000000    
ntdll!RtlpLowFragHeapAllocFromContext+a6f     00000018     01970b40     1019ba22    
php5ts!ts_resource_ex+15     0226a380     00000004     00000000    
php5ts!ecalloc+13     0196eb18     003a2638     003a2638    
php5ts!execute+b48     00000000     00000000     00000000    




NTDLL!_SEH_PROLOG4+1AIn php__PID__4724__Date__07_15_2008__Time_03_06_41AM__649__Second_Chance_Exception_C00000FD.dmp the assembly instruction at ntdll!_SEH_prolog4+1a in C:\Windows\System32\ntdll.dll from Microsoft Corporation has caused a stack overflow exception (0xC00000FD) when trying to write to memory location 0x00412fdc on thread 0

Module Information 
Image Name: C:\Windows\System32\ntdll.dll   Symbol Type:  PDB 
Base address: 0x77700000   Time Stamp:  Thu Nov 02 02:43:37 2006  
Checksum: 0x00128171   Comments:   
COM DLL: False   Company Name:  Microsoft Corporation 
ISAPIExtension: False   File Description:  NT Layer DLL 
ISAPIFilter: False   File Version:  6.0.6000.16386 (vista_rtm.061101-2205) 
Managed DLL: False   Internal Name:  ntdll.dll 
VB DLL: False   Legal Copyright:  ? Microsoft Corporation. All rights reserved. 
Loaded Image Name:  ntdll.dll   Legal Trademarks:   
Mapped Image Name:     Original filename:  ntdll.dll 
Module name:  ntdll   Private Build:   
Single Threaded:  False   Product Name:  Microsoft? Windows? Operating System 
Module Size:  1.12 MBytes   Product Version:  6.0.6000.16386 
Symbol File Name:  c:\symcache\ntdll.pdb\C0A498F0036E4D4FB5CBF69005B0F9242\ntdll.pdb   Special Build:  & 

------------------------


Really, thanks for the dedication on this. I'd like to see more people as devoted as you are to fixing problems. 

Best regards,
Thomas
 [2008-07-22 22:28 UTC] jani@php.net
Pierre, feedback was given..
 [2008-07-22 23:28 UTC] pajoye@php.net
Can you post a link to the script (please try to make it small) or mail me please?
 [2008-07-30 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-2022 The PHP Group
All rights reserved.
Last updated: Thu Dec 01 12:03:47 2022 UTC