php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45849 segmentation fault accessing mssql with pdo/odbc
Submitted: 2008-08-18 10:06 UTC Modified: 2008-10-16 01:00 UTC
Votes:6
Avg. Score:3.5 ± 0.8
Reproduced:4 of 5 (80.0%)
Same Version:1 (25.0%)
Same OS:2 (50.0%)
From: dk at trick dot ca Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.2.6 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dk at trick dot ca
New email:
PHP Version: OS:

 

 [2008-08-18 10:06 UTC] dk at trick dot ca
Description:
------------
PHP Segfaults when I query MS SQL Server 2005 via an ODBC DSN with PDO.
The query returns fine using tsql, and there is nothing wrong in the freetds log.



Reproduce code:
---------------
(names/credentials changed)

testpdo.php:

<?php
$d = new PDO('odbc:MYDSN','MYDUSERID', 'MYPASSWORD);
foreach ($d->query('SELECT * from MYTABLE') as $row) {
      print_r($row);
}


odbc.ini:

[MYDSN]
Driver = /usr/lib/libtdsodbc.so.0
Description = MYDSN
Trace = Yes
Servername = MYSERVER
Database = MYDATABASE

freetds.conf:

[MYSERVER]
host = MYHOST
port = 1433
tds version = 8.0




Expected result:
----------------
print results or some sort of error.

Actual result:
--------------
# php testpdo.php
Segmentation fault


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-18 10:08 UTC] dk at trick dot ca
typo, first line of testpdo.pgp does have a missing quote:

$d = new PDO('odbc:MYDSN','MYDUSERID', 'MYPASSWORD');
 [2008-08-18 11:28 UTC] dk at trick dot ca
further investigation shows this error occurs when a field of type "text" or "varchar(max)" is included in the query.
 [2008-08-18 12:20 UTC] dk at trick dot ca
Possibly related to 41399?

http://bugs.php.net/bug.php?id=41888
 [2008-10-08 10:45 UTC] felipe@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.


 [2008-10-16 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-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 09:01:27 2025 UTC