[nycphp-talk] Re: talk Digest, Vol 11, Issue 18

Joshua Hart hart at
Sat Sep 8 23:08:44 EDT 2007

On 9/8/07 10:45 PM, "talk-request at"
<talk-request at> wrote:

>> Oracle is instantclient ia64-
>> oci8 version 1.2.3  revision
>> Here's my configure command for PHP:
>> './configure' '--with-zlib' '--with-gd' '--with-jpeg' '--with-png'
>> '--with-libxml2=/usr/bin' '--with-mysql=/usr/local/mysql5120'
>> '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-ftp'
>> '--with-imap-ssl=/usr/include/ssl'
>> '--with-imap=/space/custom_builds/imap-stuff/' '--with-openssl'
>> '--with-pam' '--with-dom' '--with-iconv' '--with-mbstring=all'
>> '--with-mbregex' '--with-domsxlt' '--with-mcrypt' '--with-xml'
>> '--with-mime-magic' '--enable-exif' '--enable-uploadprogress'
>> '--with-xmlrpc' '--with-gettext' '--with-pgsql'
>> '--with-oci8=instantclient,/usr/local/oracle'
> Hmm... since this is ia64, there is no lib64 anywhere right?  Make sure PHP
> is linking against the right libs.  Sometimes lib64'ness isn't always
> obvious.  Try adding --with-libdir=lib64 to the PHP ./configure, but I'm not
> sure on this.

Ldd on the cli for php gives:
ssaturn /usr/local# ldd /space/custom_builds/php-5.2.4/sapi/cli/php =>  (0xa000000000000000) => /lib/ (0x2000000000064000) =>
/space/custom_builds/imap-stuff//lib/ (0x20000000000b4000) => /usr/local/pgsql/lib/ (0x2000000000288000) => /lib/ (0x20000000002dc000) =>
/usr/local/mysql5120/lib/ (0x20000000002fc000) => /usr/lib/ (0x2000000000528000) => /usr/lib/ (0x2000000000588000) => /lib/ (0x20000000005a8000) => /lib/ (0x20000000005c0000) => /usr/lib/ (0x20000000005e8000) => /lib/ (0x200000000066c000) => /lib/ (0x20000000006a0000) => /lib/ (0x2000000000770000) => /usr/lib/ (0x20000000007ac000) => /usr/lib/
(0x200000000083c000) => /usr/local/oracle/
(0x2000000000aa8000) => /usr/lib/ (0x2000000002c90000) => /lib/ (0x2000000002f40000) => /opt/intel/cc/9.1.037/lib/
(0x2000000003190000) => /opt/intel/cc/9.1.037/lib/
(0x2000000003440000) => /usr/local/oracle/ (0x2000000003470000) => /lib/ (0x2000000003484000) => /lib/ (0x20000000034a4000)
        /lib/ (0x2000000000000000) => /lib/ (0x20000000034dc000) => /usr/local/oracle/ (0x2000000003510000) => /lib/ (0x2000000003898000)

> Another option would be to strip down the ./configure and add --disable-all.
> Perhaps there are some conflicts with Oracle, lib64, etc.  Then start to add
> extensions to see if you can isolate the problem.
>> Again, I can successfully login to the oracle database, and the
>> simplest of queries works. Anything "complicated" crashes the program.
> If I understand correctly - if you login via the Oracle client directly (so
> no PHP involved), it'll still segfault when there's a complicated query?

No.. What I was trying to say is that I can login to oracle via a PHP
script.  I can even do my query if I limit the data which is returned by
oracle to less than 5 rows. As soon as I ask it to return 5 or more rows I
get a segfault.

In order to test the instantclient installatiton I installed the sqlplus
"add on" for instantclient and it is able to connect to oracle and return
all requested rows.

When I use gdb to run the cli for php I get:

gdb /space/custom_builds/php-5.2.4/sapi/cli/php
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "ia64-suse-linux"...Using host libthread_db
library "/lib/".

(gdb) run /www/htdocs/nonsecure/con.html
Starting program: /space/custom_builds/php-5.2.4/sapi/cli/php
[Thread debugging using libthread_db enabled]
[New Thread 2305843009273028592 (LWP 27213)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 2305843009273028592 (LWP 27213)]
0x40000000005f6ba0 in _zval_ptr_dtor (zval_ptr=0x607ffffffebdb7f0) at
413             (*zval_ptr)->refcount--;
(gdb) where
#0  0x40000000005f6ba0 in _zval_ptr_dtor (zval_ptr=0x607ffffffebdb7f0) at
#1  0x400000000068d700 in zend_do_fcall_common_helper_SPEC
    at /space/custom_builds/php-5.2.4/Zend/zend_execute.h:155
#2  0x4000000000666a00 in execute (op_array=0x20000000039d4e40) at
#3  0x40000000006188e0 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /space/custom_builds/php-5.2.4/Zend/zend.c:1134
#4  0x4000000000577bb0 in php_execute_script (primary_file=Cannot access
memory at address 0x10
) at /space/custom_builds/php-5.2.4/main/main.c:1982
#5  0x400000000076fa30 in main (argc=Cannot access memory at address 0x0
) at /space/custom_builds/php-5.2.4/sapi/cli/php_cli.c:1140

>From the stacktrace above looks like something is overflowing its bounds...

I will try your suggested alternative option next and just build php with
oracle only to see if I get the same problem.

I also have started to download the full client from Oracle instead of the
instantclient to see if it makes any sort of difference.



More information about the talk mailing list