php.net |  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
Votes:1
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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zazell at targetmedia dot nl
New email:
PHP Version: OS:

 

 [2015-01-22 13:27 UTC] zazell at targetmedia dot nl
Description:
------------
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:
---------------
<?php
$drv = "/usr/local/lib/libtdsodbc.so; 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");
$stmt->execute();

$resultArr = $stmt->fetchAll();
var_dump($resultArr[0]['bundle_id']);

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/libcrypto.so.8
(gdb) bt
#0  0x000000080645c7c9 in sk_free () from /usr/local/lib/libcrypto.so.8
#1  0x00000008063d8d68 in int_free_ex_data () from /usr/local/lib/libcrypto.so.8
#2  0x0000000806498d78 in X509_STORE_free () from /usr/local/lib/libcrypto.so.8
#3  0x00000008061435b4 in SSL_CTX_free () from /usr/local/lib/libssl.so.8
#4  0x0000000812c07722 in ?? () from /usr/local/lib/libtdsodbc.so
#5  0x0000000800bb3650 in ?? () from /libexec/ld-elf.so.1
#6  0x0000000812c42831 in _fini () from /usr/local/lib/libtdsodbc.so
#7  0x0000000800a16c80 in ?? ()
#8  0x00000008009a1ea7 in dlinfo () from /libexec/ld-elf.so.1
#9  0x00000008009a49a5 in dlsym () from /libexec/ld-elf.so.1
#10 0x0000000801dd42b4 in __cxa_finalize () from /lib/libc.so.7
#11 0x0000000801d7c127 in exit () from /lib/libc.so.7
#12 0x00000000006496b9 in main ()
#13 0x000000000041cdb1 in _start ()
#14 0x00000008009b7000 in ?? ()
#15 0x0000000000000000 in ?? ()

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-23 19:53 UTC] aharvey@php.net
-Status: Open +Status: Feedback
 [2015-01-23 19:53 UTC] aharvey@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Mon Oct 14 08:01:27 2024 UTC