Apache sometimes crashes when using odbc connections
Posted by: jgeerts (---.be.jnj.com)
Date: June 29, 2015 04:41PM

I'm using the latest 64-bit version of Wampserver and I noticed that the Apache process sometimes crashes when using the odbc connection.

This is what's been logged in the event viewer:

Faulting application name: httpd.exe, version: 2.4.9.0, time stamp: 0x53258cd5
Faulting module name: MSVCR110.dll, version: 11.0.51106.1, time stamp: 0x5098826e
Exception code: 0xc0000005
Fault offset: 0x000000000003c69e
Faulting process id: 0x5ac
Faulting application start time: 0x01d0a9c86c475dbd
Faulting application path: D:\wamp\bin\apache\apache2.4.9\bin\httpd.exe
Faulting module path: C:\windows\system32\MSVCR110.dll
Report Id: 2b3c262d-1e57-11e5-943b-005056915a28

I've a MS SQL database on a remote system and I'm accessing it using the 64-bit odbc driver (also the 32-bit odbc driver is installed).

Everything goes well when I'm accessing tables with less columns. If i'm doing a "Select * from table" on a table that has a lot of columns, the error occurs (so I'm able to reproduce the issue).

Any idea what could be wrong here?

Thanks,

Jos.

Options: ReplyQuote
Re: Apache sometimes crashes when using odbc connections
Posted by: RiggsFolly (---.as43234.net)
Date: June 29, 2015 05:02PM

This sounds like a problem for Microsoft or maybe whoever produced the ODBC drivers etc. Non of this is really anything WAMPServer related.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Apache sometimes crashes when using odbc connections
Posted by: jgeerts (---.be.jnj.com)
Date: June 30, 2015 01:54PM

Correct, it's not related to WAMPServer. It's a known bug which is still not resolved, not even in the latest releases of PHP (5.5.* or 5.6.*).
If you have a column in a table that is defined as nvarchar(max), apache will crash with the above noted error when you are using the "SQL Server Native Client xx.x" odbc drivers.

A workaround is to use the default "SQL Server" odbc driver (is always present in the "ODBC Data Source Administrator" program). This driver reports the nvarchar(max) columns as ntext columns with a maximum size instead of nvarchar columns with a size of zero (it's probably the zero value that is causing apache/php to crash).

I just changed the code (change dsn) to use the "old" driver (it's listed as version 6.01.7601.17514) and it works perfectly, even when accessing MS SQL server databases with version 12.*.

So my issue is resolved by this workaround but it would be a lot better if the bug would get resolved in the php_pdo_odbc.dll file (Windows), so that recent odbc drivers can be used in the future.

Options: ReplyQuote
Re: Apache sometimes crashes when using odbc connections
Posted by: RiggsFolly (---.as43234.net)
Date: June 30, 2015 05:01PM

Quote

it would be a lot better if the bug would get resolved in the php_pdo_odbc.dll file (Windows), so that recent odbc drivers can be used in the future.

Just in case you are confused, the WAMPServer ( Alterway ) guys do not maintain PHP or its extensions. They dont even compile it, they just package up the parts into a quick and easy preconfigured install.

If you want to register your disgust I suggest you go to the `php.net`site or more likely a microsoft site, and add your weight to this bug so people know it is important to get it fixed.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Apache sometimes crashes when using odbc connections
Posted by: jgeerts (---.be.jnj.com)
Date: July 01, 2015 10:43AM

Thanks for pointing me in the right direction.
I just submitted a bug report for this on php.net
Link can be found here: [bugs.php.net]

Options: ReplyQuote
Re: Apache sometimes crashes when using odbc connections
Posted by: RiggsFolly (---.as43234.net)
Date: July 01, 2015 12:50PM

I might be tempted to submit something here as well [connect.microsoft.com]

I would guess the issue is inside either the ODBC driver or the mssql.dll extension which is all Microsoft code and nothing to do with the guys that write PHP.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.