|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68886 segfault when executing query
Submitted: 2015-01-22 13:27 UTC Modified: 2015-02-01 04:22 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: zazell at targetmedia dot nl Assigned:
Status: No Feedback Package: PDO ODBC
PHP Version: 5.6.4 OS: FreeBSD 9.3
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.
Block user comment
Status: Assign to:
Bug Type:
From: zazell at targetmedia dot nl
New email:
PHP Version: OS:


 [2015-01-22 13:27 UTC] zazell at targetmedia dot nl
Im trying to get my php script to work on freeBSD and having them connect to a Sql Server 2008 database, while the connection is now working, im getting a segfault when i try to execute any query. The segfault seems to occure at the end of the execution of the script, since the data is returned and displayed (when executing the script on the cli.) 

I'm using freetds-0.91.103, unixODBC-2.3.2, Sql Server 2008
I tried with both dblib and odbc and both give me the same result. 

The configure line of my php installation is:
'./configure' '--with-layout=GNU' '--localstatedir=/var' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--enable-libxml' '--enable-mysqlnd' '--with-libxml-dir=/usr/local' '--with-pcre-regex=/usr/local' '--with-zlib-dir=/usr' '--program-prefix=' '--disable-cli' '--disable-cgi' '--with-apxs2=/usr/local/sbin/apxs' '--with-regex=php' '--with-zend-vm=CALL' '--enable-maintainer-zts' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=amd64-portbld-freebsd9.3' 'build_alias=amd64-portbld-freebsd9.3' 'CC=cc' 'CFLAGS=-O2 '-pipe' '-fstack-protector' '-fno-strict-aliasing'' 'LDFLAGS= '-fstack-protector'' 'LIBS=-pthread' 'CPPFLAGS=' 'CPP=cpp' 'CXX=c++' 'CXXFLAGS=-O2 '-pipe' '-fstack-protector' '-fno-strict-aliasing''

When i run the script on the commandline, i get:
# php mssqltest.php
string(6) "918420" // this is the expected result
Segmentation fault: 11

Test script:
$drv = "/usr/local/lib/; TDS_Version=7.2; Port=1433";
$pdo = new PDO('odbc:Driver='.$drv.';Server=[redacted];Database=[redacted];APP=[redacted];UID=[redacted];PWD=[redacted]');
$stmt = $pdo->prepare("select * from bundles where bundle_id=918420");

$resultArr = $stmt->fetchAll();

Actual result:
gdb gives me: (removed the (no debugging symbols found)... messages) 

(gdb) run mssqltest.php
Starting program: /usr/local/bin/php mssqltest.php
[New LWP 100977]
[New Thread 802407400 (LWP 100977/php)]
string(6) "918420"

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 802407400 (LWP 100977/php)]
0x000000080645c7c9 in sk_free () from /usr/local/lib/
(gdb) bt
#0  0x000000080645c7c9 in sk_free () from /usr/local/lib/
#1  0x00000008063d8d68 in int_free_ex_data () from /usr/local/lib/
#2  0x0000000806498d78 in X509_STORE_free () from /usr/local/lib/
#3  0x00000008061435b4 in SSL_CTX_free () from /usr/local/lib/
#4  0x0000000812c07722 in ?? () from /usr/local/lib/
#5  0x0000000800bb3650 in ?? () from /libexec/
#6  0x0000000812c42831 in _fini () from /usr/local/lib/
#7  0x0000000800a16c80 in ?? ()
#8  0x00000008009a1ea7 in dlinfo () from /libexec/
#9  0x00000008009a49a5 in dlsym () from /libexec/
#10 0x0000000801dd42b4 in __cxa_finalize () from /lib/
#11 0x0000000801d7c127 in exit () from /lib/
#12 0x00000000006496b9 in main ()
#13 0x000000000041cdb1 in _start ()
#14 0x00000008009b7000 in ?? ()
#15 0x0000000000000000 in ?? ()


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-23 19:53 UTC]
-Status: Open +Status: Feedback
 [2015-01-23 19:53 UTC]
This looks suspiciously like an issue further down the stack than PHP, but can you rebuild PHP with --enable-debug in your configure line and regenerate the stack trace, please, so we can see the PHP symbols as well?
 [2015-02-01 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Jun 07 21:03:41 2023 UTC