php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65279 Apache crashes if ext=php_snmp.dll is used
Submitted: 2013-07-17 15:59 UTC Modified: 2013-07-29 17:50 UTC
From: craiga at wvhmhc dot org Assigned: ab (profile)
Status: Closed Package: Apache2 related
PHP Version: 5.4.14 OS: Win Serv 2008 R2
Private report: No CVE-ID: None
 [2013-07-17 15:59 UTC] craiga at wvhmhc dot org
Description:
------------
I followed the instructions, and PHP works on the command line:

partial phpinfo() output:
snmp

NET-SNMP Support => enabled
NET-SNMP Version => 5.4.2.1
PHP SNMP Version => 0.1

but Apache (ver 2.4) crashes with no clue in the logs every time I try to restart it with SNMP enabled in PHP.

Test script:
---------------
N/A

Expected result:
----------------
N/A

Actual result:
--------------
N/A

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-17 18:15 UTC] craiga at wvhmhc dot org
-PHP Version: 5.4.17 +PHP Version: 5.4.14
 [2013-07-17 18:15 UTC] craiga at wvhmhc dot org
Corrected PHP version. Originally picked 5.4.17
 [2013-07-17 21:24 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2013-07-17 21:24 UTC] ab@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.

Which apache build do you use? We only support those from apachelounge.com .
 [2013-07-18 05:36 UTC] pajoye@php.net
Are you sure it actually crashes or complain about some DLLs not found?
 [2013-07-18 18:59 UTC] craiga at wvhmhc dot org
-Status: Feedback +Status: Open
 [2013-07-18 18:59 UTC] craiga at wvhmhc dot org
I do believe the Apache is from the lounge... I wanted the VC9 version.

The dll is there, as evidenced by the fact that command-line PHP runs.

I'll need some help to make a back trace.
Most of the links on http://bugs.php.net/bugs-generating-backtrace-win32.php are broken.
Where can the debug pack for 5.4.14 be found?

Here is the Apache log for a normal start on my server:
[Wed Jul 17 11:17:35.707265 2013] [core:notice] [pid 3792:tid 276] AH00094: Command line: 'C:\\Apache24\\bin\\httpd.exe -d C:/Apache24'
[Wed Jul 17 11:17:35.707265 2013] [mpm_winnt:notice] [pid 3792:tid 276] AH00418: Parent: Created child process 1436
[Wed Jul 17 11:17:36.081672 2013] [mpm_winnt:notice] [pid 1436:tid 428] AH00354: Child: Starting 64 worker threads.

and with the attempt to use snmp:
[Wed Jul 17 11:14:49.049260 2013] [core:notice] [pid 2976:tid 276] AH00094: Command line: 'C:\\Apache24\\bin\\httpd.exe -d C:/Apache24'
[Wed Jul 17 11:14:49.049260 2013] [mpm_winnt:notice] [pid 2976:tid 276] AH00418: Parent: Created child process 2316
[Wed Jul 17 11:14:49.423667 2013] [mpm_winnt:notice] [pid 2316:tid 428] AH00354: Child: Starting 64 worker threads.
[Wed Jul 17 11:17:19.342550 2013] [mpm_winnt:notice] [pid 2976:tid 276] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Wed Jul 17 11:17:21.370589 2013] [mpm_winnt:notice] [pid 2316:tid 428] AH00364: Child: All worker threads have exited.
[Wed Jul 17 11:17:21.386189 2013] [mpm_winnt:notice] [pid 2976:tid 276] AH00430: Parent: Child process 2316 exited successfully.

Not a thing in php_errors.log or system event logs.
 [2013-07-22 07:45 UTC] ab@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: ab
 [2013-07-22 07:45 UTC] ab@php.net
Here's the path to debug symbols

http://windows.php.net/downloads/releases/archives/
 [2013-07-22 14:25 UTC] craiga at wvhmhc dot org
-Status: Feedback +Status: Assigned
 [2013-07-22 14:25 UTC] craiga at wvhmhc dot org
I got the debug pack and Windows Debug 1.2
It will be no help in this case...
You can only debug a running process, a service, or some IIS and COM stuff.
PHP is not visible in the process list long enough to pick it, if at all.
Debugging Apache gave nothing, as it is not crashing,
just detecting PHP failed to start and shutting down.
 [2013-07-22 15:18 UTC] ab@php.net
-Status: Assigned +Status: Feedback
 [2013-07-22 15:18 UTC] ab@php.net
How do you start apache? Please do not start as service, use the -X option, like 

c:\apache\bin\httpd.exe -X

combining that with WinDbg.
 [2013-07-23 13:39 UTC] craiga at wvhmhc dot org
-Status: Feedback +Status: Assigned
 [2013-07-23 13:39 UTC] craiga at wvhmhc dot org
Sorry... the debugger is not going to help here.
There is not enough time to choose your process
and build your rule before it bombs.
 [2013-07-23 15:24 UTC] ab@php.net
-Status: Assigned +Status: Feedback
 [2013-07-23 15:24 UTC] ab@php.net
Without a debugger we don't know what happens at all. There are at least two options:

1.
 - open windbg
 - click file->open executable and point it to httpd.exe, don't forget -X in the 
arguments field
 - click debug->go ... i had to do that twice as it haven't found symbols for the first 
time. The symbols have to be setup before of course.
At this point it should be crashing inside windbg

2. Setup a debugger for unhandled exceptions, here's the paper 
http://support.microsoft.com/kb/121434 . After this every crash will invoke windbg.

Don't give up, you can do it :)
 [2013-07-24 14:07 UTC] craiga at wvhmhc dot org
-Status: Feedback +Status: Assigned
 [2013-07-24 14:07 UTC] craiga at wvhmhc dot org
Here it is WITH SNMP:
It actually seems to crash on C:\Windows\SysWOW64\NETAPI32.DLL
It is flagged Read Execute for all users.
You can F5 as much as you like, just more access violations.
That DLL does not get called for without SNMP.

Microsoft (R) Windows Debugger Version 6.2.9200.20512 X86
Copyright (c) Microsoft Corporation. All rights reserved.

CommandLine: C:\Apache24\bin\httpd.exe -X
Symbol search path is: C:\Users\administrator.WVALLIANCE\phpDebug5414
Executable search path is: 
ModLoad: 011a0000 011a8000   httpd.exe
ModLoad: 77cb0000 77e10000   ntdll.dll
ModLoad: 75ca0000 75db0000   C:\Windows\syswow64\kernel32.dll
ModLoad: 72be0000 72c05000   C:\Apache24\bin\libapr-1.dll
ModLoad: 77280000 772ad000   C:\Windows\syswow64\WS2_32.dll
ModLoad: 75f30000 75fda000   C:\Windows\syswow64\msvcrt.dll
ModLoad: 772b0000 77376000   C:\Windows\syswow64\ADVAPI32.dll
ModLoad: 75db0000 75ea0000   C:\Windows\syswow64\RPCRT4.dll
ModLoad: 757d0000 75830000   C:\Windows\syswow64\Secur32.dll
ModLoad: 77190000 77196000   C:\Windows\syswow64\NSI.dll
ModLoad: 755f0000 7562b000   C:\Windows\SysWOW64\MSWSOCK.dll
ModLoad: 764f0000 77001000   C:\Windows\syswow64\SHELL32.dll
ModLoad: 76460000 764f0000   C:\Windows\syswow64\GDI32.dll
ModLoad: 75900000 759d0000   C:\Windows\syswow64\USER32.dll
ModLoad: 75fe0000 76039000   C:\Windows\syswow64\SHLWAPI.dll
ModLoad: 702d0000 7038f000   C:\Windows\SysWOW64\MSVCR100.dll
ModLoad: 72c10000 72c40000   C:\Apache24\bin\libaprutil-1.dll
ModLoad: 741e0000 741e9000   C:\Apache24\bin\libapriconv-1.dll
ModLoad: 724c0000 72514000   C:\Apache24\bin\libhttpd.dll
ModLoad: 72c90000 72caf000   C:\Apache24\bin\pcre.dll
(a94.1124): Break instruction exception - code 80000003 (first chance)
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll - 
eax=00000000 ebx=00000000 ecx=89d00000 edx=00000000 esi=fffffffe edi=00000000
eip=77cc0004 esp=0015f960 ebp=0015f990 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
ntdll!DbgBreakPoint:
77cc0004 cc              int     3
0:000> g
ModLoad: 77010000 77070000   C:\Windows\SysWOW64\IMM32.DLL
ModLoad: 75830000 758f8000   C:\Windows\syswow64\MSCTF.dll
ModLoad: 75b00000 75b09000   C:\Windows\syswow64\LPK.DLL
ModLoad: 77380000 773fd000   C:\Windows\syswow64\USP10.dll
ModLoad: 75130000 752ce000   C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6002.18305_none_5cb72f2a088b0ed3\comctl32.dll
ModLoad: 75430000 7546b000   C:\Windows\SysWOW64\rsaenh.dll
ModLoad: 75410000 75415000   C:\Windows\SysWOW64\wship6.dll
ModLoad: 75400000 75405000   C:\Windows\SysWOW64\wshtcpip.dll
ModLoad: 73220000 73227000   C:\Apache24\modules\mod_access_compat.so
ModLoad: 72d00000 72d06000   C:\Apache24\modules\mod_actions.so
ModLoad: 72cf0000 72cf7000   C:\Apache24\modules\mod_alias.so
ModLoad: 72810000 72816000   C:\Apache24\modules\mod_allowmethods.so
ModLoad: 72580000 72586000   C:\Apache24\modules\mod_asis.so
ModLoad: 72570000 72576000   C:\Apache24\modules\mod_auth_basic.so
ModLoad: 72560000 72566000   C:\Apache24\modules\mod_authn_core.so
ModLoad: 72550000 72556000   C:\Apache24\modules\mod_authn_file.so
ModLoad: 72540000 72548000   C:\Apache24\modules\mod_authz_core.so
ModLoad: 724b0000 724b6000   C:\Apache24\modules\mod_authz_groupfile.so
ModLoad: 72080000 72086000   C:\Apache24\modules\mod_authz_host.so
ModLoad: 72060000 72066000   C:\Apache24\modules\mod_authz_user.so
ModLoad: 72050000 7205a000   C:\Apache24\modules\mod_autoindex.so
ModLoad: 72040000 72049000   C:\Apache24\modules\mod_cgi.so
ModLoad: 71ef0000 71ef6000   C:\Apache24\modules\mod_dir.so
ModLoad: 71ee0000 71ee6000   C:\Apache24\modules\mod_env.so
ModLoad: 71cb0000 71cbd000   C:\Apache24\modules\mod_include.so
ModLoad: 71c50000 71c59000   C:\Apache24\modules\mod_isapi.so
ModLoad: 71c40000 71c49000   C:\Apache24\modules\mod_log_config.so
ModLoad: 71950000 71958000   C:\Apache24\modules\mod_mime.so
ModLoad: 71940000 7194b000   C:\Apache24\modules\mod_negotiation.so
ModLoad: 71770000 71777000   C:\Apache24\modules\mod_setenvif.so
ModLoad: 71760000 71766000   C:\Apache24\modules\mod_vhost_alias.so
ModLoad: 71750000 7175a000   C:\Users\administrator.WVALLIANCE\php\php5apache2_4.dll
ModLoad: 682c0000 688b5000   c:\users\administrator.WVALLIANCE\php\php5ts.dll
ModLoad: 70880000 708e6000   C:\Windows\SysWOW64\ODBC32.dll
ModLoad: 71960000 719e5000   C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.6002.18305_none_88f3a38569c2c436\COMCTL32.dll
ModLoad: 760d0000 76143000   C:\Windows\syswow64\COMDLG32.dll
ModLoad: 76310000 76455000   C:\Windows\syswow64\ole32.dll
ModLoad: 74720000 7474c000   C:\Windows\SysWOW64\DNSAPI.dll
ModLoad: 74fd0000 75073000   C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\MSVCR90.dll
ModLoad: 71ad0000 71b08000   C:\Windows\SysWOW64\odbcint.dll
ModLoad: 73220000 73227000   C:\Apache24\modules\mod_access_compat.so
ModLoad: 72d00000 72d06000   C:\Apache24\modules\mod_actions.so
ModLoad: 72cf0000 72cf7000   C:\Apache24\modules\mod_alias.so
ModLoad: 72810000 72816000   C:\Apache24\modules\mod_allowmethods.so
ModLoad: 72580000 72586000   C:\Apache24\modules\mod_asis.so
ModLoad: 72570000 72576000   C:\Apache24\modules\mod_auth_basic.so
ModLoad: 72560000 72566000   C:\Apache24\modules\mod_authn_core.so
ModLoad: 72550000 72556000   C:\Apache24\modules\mod_authn_file.so
ModLoad: 72540000 72548000   C:\Apache24\modules\mod_authz_core.so
ModLoad: 724b0000 724b6000   C:\Apache24\modules\mod_authz_groupfile.so
ModLoad: 72080000 72086000   C:\Apache24\modules\mod_authz_host.so
ModLoad: 72060000 72066000   C:\Apache24\modules\mod_authz_user.so
ModLoad: 72050000 7205a000   C:\Apache24\modules\mod_autoindex.so
ModLoad: 72040000 72049000   C:\Apache24\modules\mod_cgi.so
ModLoad: 71ef0000 71ef6000   C:\Apache24\modules\mod_dir.so
ModLoad: 71ee0000 71ee6000   C:\Apache24\modules\mod_env.so
ModLoad: 71cb0000 71cbd000   C:\Apache24\modules\mod_include.so
ModLoad: 71c50000 71c59000   C:\Apache24\modules\mod_isapi.so
ModLoad: 71c40000 71c49000   C:\Apache24\modules\mod_log_config.so
ModLoad: 71950000 71958000   C:\Apache24\modules\mod_mime.so
ModLoad: 71940000 7194b000   C:\Apache24\modules\mod_negotiation.so
ModLoad: 71770000 71777000   C:\Apache24\modules\mod_setenvif.so
ModLoad: 71760000 71766000   C:\Apache24\modules\mod_vhost_alias.so
ModLoad: 71750000 7175a000   C:\Users\administrator.WVALLIANCE\php\php5apache2_4.dll
ModLoad: 66d50000 67345000   c:\users\administrator.WVALLIANCE\php\php5ts.dll
ModLoad: 70880000 708e6000   C:\Windows\SysWOW64\ODBC32.dll
ModLoad: 71960000 719e5000   C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.6002.18305_none_88f3a38569c2c436\COMCTL32.dll
ModLoad: 760d0000 76143000   C:\Windows\syswow64\COMDLG32.dll
ModLoad: 76310000 76455000   C:\Windows\syswow64\ole32.dll
ModLoad: 74720000 7474c000   C:\Windows\SysWOW64\DNSAPI.dll
ModLoad: 74fd0000 75073000   C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\MSVCR90.dll
ModLoad: 71ad0000 71b08000   C:\Windows\SysWOW64\odbcint.dll
ModLoad: 71130000 71142000   c:\users\administrator.WVALLIANCE\php\ext\php_bz2.dll
ModLoad: 6fea0000 6ff14000   c:\users\administrator.WVALLIANCE\php\ext\php_curl.dll
ModLoad: 6f5e0000 6f706000   C:\Apache24\bin\LIBEAY32.dll
ModLoad: 70750000 70796000   C:\Apache24\bin\SSLEAY32.dll
ModLoad: 771a0000 771e9000   C:\Windows\syswow64\WLDAP32.dll
ModLoad: 77c80000 77c87000   C:\Windows\syswow64\PSAPI.DLL
ModLoad: 6e8d0000 6eb12000   c:\users\administrator.WVALLIANCE\php\ext\php_fileinfo.dll
ModLoad: 6da30000 6dbca000   c:\users\administrator.WVALLIANCE\php\ext\php_gd2.dll
ModLoad: 70540000 7056a000   c:\users\administrator.WVALLIANCE\php\ext\php_ldap.dll
ModLoad: 10000000 10014000   c:\users\administrator.WVALLIANCE\php\libsasl.dll
ModLoad: 74850000 74857000   C:\Windows\SysWOW64\WSOCK32.dll
ModLoad: 6d900000 6da2a000   c:\users\administrator.WVALLIANCE\php\ext\php_mbstring.dll
ModLoad: 71160000 7116c000   c:\users\administrator.WVALLIANCE\php\ext\php_mysql.dll
ModLoad: 70730000 70749000   c:\users\administrator.WVALLIANCE\php\ext\php_mysqli.dll
ModLoad: 70580000 70595000   c:\users\administrator.WVALLIANCE\php\ext\php_openssl.dll
ModLoad: 6fe30000 6fe9f000   c:\users\administrator.WVALLIANCE\php\ext\php_snmp.dll
ModLoad: 6ff20000 6ff5f000   c:\users\administrator.WVALLIANCE\php\ext\php_soap.dll
ModLoad: 71150000 7115d000   c:\users\administrator.WVALLIANCE\php\ext\php_sockets.dll
ModLoad: 746e0000 746f9000   C:\Windows\SysWOW64\IPHLPAPI.DLL
ModLoad: 74220000 74255000   C:\Windows\SysWOW64\dhcpcsvc.DLL
ModLoad: 742f0000 742f7000   C:\Windows\SysWOW64\WINNSI.DLL
ModLoad: 741f0000 74212000   C:\Windows\SysWOW64\dhcpcsvc6.DLL
ModLoad: 6e580000 6e62b000   c:\users\administrator.WVALLIANCE\php\ext\php_sqlite3.dll
ModLoad: 73170000 731e6000   C:\Windows\SysWOW64\NETAPI32.DLL
(a94.1124): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=00000000 ebx=03119bf0 ecx=77cda9b5 edx=0115016c esi=00000000 edi=00000000
eip=00000000 esp=0015e618 ebp=00000011 iopl=0         nv up ei pl nz na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00210206
00000000 ??              ???
0:000> g
(a94.1124): Access violation - code c0000005 (!!! second chance !!!)
eax=00000000 ebx=03119bf0 ecx=77cda9b5 edx=0115016c esi=00000000 edi=00000000
eip=00000000 esp=0015e618 ebp=00000011 iopl=0         nv up ei pl nz na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00210206
00000000 ??              ???
0:000> g
(a94.1124): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=00000000 ebx=03119bf0 ecx=77cda9b5 edx=0115016c esi=00000000 edi=00000000
eip=00000000 esp=0015e618 ebp=00000011 iopl=0         nv up ei pl nz na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00210206
00000000 ??              ???
 [2013-07-24 15:59 UTC] ab@php.net
-Status: Assigned +Status: Feedback
 [2013-07-24 15:59 UTC] ab@php.net
Thanks for posting. From what I see here, you're using the Apache VC10 build, 
however we build PHP 5.4 with VC9. Also to see that they both load openssl.

I expect that to be the source of trouble. Please get an VC9 build of Apache 
with openssl 0.9.x series from here 
http://www.apachelounge.com/download/additional/ . CRT and openssl versions have 
to match. That's the basic requirement for the further debugging.

Thanks.
 [2013-07-29 14:30 UTC] craiga at wvhmhc dot org
-Status: Feedback +Status: Assigned
 [2013-07-29 14:30 UTC] craiga at wvhmhc dot org
The Apache version you recommended works!
This bug can be closed.
Thank you for your help!
 [2013-07-29 17:50 UTC] ab@php.net
-Status: Assigned +Status: Closed
 [2013-07-29 17:50 UTC] ab@php.net
Great, thanks for staying on that :)
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Nov 29 10:03:14 2021 UTC