|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-10-03 09:05 UTC] max2k1 at yandex dot ru
Description:
------------
I'm trying to connect to my Oracle 10g DB, running on the same machine and mistyped dbname ("oci:dbname=orama" instead of "oci:dbname=oramax").
After execution i've got Segmentation fault. After doing some little research, i've found that segfault appears only if PDO_ATTR_PERSISTENT is set to true.
GDB output was:
Starting program: /usr/bin/php ./bug.php
[Thread debugging using libthread_db enabled]
[New Thread 182894211648 (LWP 27798)]
SQLSTATE[42S02]: pdo_oci_handle_factory: ORA-12154: TNS:could not resolve the connect identifier specified
(/home/users/php/src/compile/pdo/pecl/pdo_oci/oci_driver.c:463)
Failure :(
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 182894211648 (LWP 27798)]
0x0000002a9a702f26 in pdo_dbh_free_storage (dbh=0xa556f0) at /home/users/php/src/compile/pdo/pecl/PDO-1.0RC1/pdo_dbh.c:1161
1161 } else if (dbh->methods->persistent_shutdown) {
My info:
$ pear list
Package Version State
PDO 1.0RC1 beta
PDO_OCI 1.0RC1 beta
oci8 1.1 beta
$ php -v
PHP 5.0.4 (cli) (built: Sep 20 2005 20:41:23)
PHP Configure Command => './configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--enable-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-ncurses=shared' '--with-gd=shared' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config' '--with-oci8-instant-client=shared' '--enable-dom=shared' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-xsl=shared,/usr' '--enable-fastcgi'
Reproduce code:
---------------
<?php
$m_DSN = "oci:dbname=orama";
$m_user = "scott";
$m_password = "tiger";
try {
$m_dbh = new PDO($m_DSN, $m_user, $m_password,
array(PDO_ATTR_PERSISTENT => true));
echo "Success!\n";
} catch (PDOException $e) {
echo $e->getMessage();
die("\nFailure :(\n");
}
?>
Expected result:
----------------
SQLSTATE[42S02]: pdo_oci_handle_factory: ORA-12154: TNS:could not resolve the connect identifier specified
(/home/users/php/src/compile/pdo/pecl/pdo_oci/oci_driver.c:463)
Failure :(
Actual result:
--------------
SQLSTATE[42S02]: pdo_oci_handle_factory: ORA-12154: TNS:could not resolve the connect identifier specified
(/home/users/php/src/compile/pdo/pecl/pdo_oci/oci_driver.c:463)
Failure :(
Segmentation fault
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 13:00:01 2025 UTC |
diff that solved the problem for me: --- ./pdo_dbh.c 2005-09-10 23:48:43.000000000 +0600 +++ ../PDO-1.0RC1new/pdo_dbh.c 2005-10-03 19:11:04.238751673 +0600 @@ -1158,7 +1158,7 @@ if (!dbh->is_persistent) { dbh_free(dbh TSRMLS_CC); - } else if (dbh->methods->persistent_shutdown) { + } else if ((dbh->methods) && (dbh->methods->persistent_shutdown)) { dbh->methods->persistent_shutdown(dbh TSRMLS_CC); } }