php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23144 crash with oracle 9.2.0.1 from OCIPLogon
Submitted: 2003-04-09 18:59 UTC Modified: 2003-04-30 18:33 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: ldemailly at qualys dot com Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4CVS-2003-04-30 (stable) OS: Linux 2.4.20
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ldemailly at qualys dot com
New email:
PHP Version: OS:

 

 [2003-04-09 18:59 UTC] ldemailly at qualys dot com
With php4-STABLE-200304092130
And httpd-2.0.45
And Oracle9i Release 2 : 9.2.0.1 (latest avail on oracle.com)
And doing
./configure --with-oci8 --with-apxs2=/usr/local/apache2/bin/apxs --enable-sysvshm --enable-trackvars --without-mysql --enable-sysvsem

and a crash.php :
<?php
echo (@OCIPLogon("foo","bar","DB"));
?>
Starting program: /usr/local/apache2/bin/httpd -X
[New Thread 16384 (LWP 3823)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 3823)]
0x40556eca in kpuhhaloc () from /usr/local/oracle/lib/libclntsh.so.9.0
(gdb) bt
#0  0x40556eca in kpuhhaloc () from /usr/local/oracle/lib/libclntsh.so.9.0
#1  0x4056722f in kpughndl0 () from /usr/local/oracle/lib/libclntsh.so.9.0
#2  0x4056d613 in kpughndl () from /usr/local/oracle/lib/libclntsh.so.9.0
#3  0x405c1ea6 in OCIHandleAlloc () from /usr/local/oracle/lib/libclntsh.so.9.0
#4  0x40318b4f in _oci_open_session (server=0x81a2df0, username=0x8193f64 "foo", password=0x8193f9c "bar", persistent=1, exclusive=0,
    charset=0x402ed2e0 "") at /home/dl/php4-STABLE-200304092130/ext/oci8/oci8.c:2247
#5  0x40319960 in oci_do_connect (ht=3, return_value=0x8193fec, this_ptr=0x0, return_value_used=1, persistent=1, exclusive=0)
    at /home/dl/php4-STABLE-200304092130/ext/oci8/oci8.c:2682
#6  0x4031c98f in zif_ociplogon (ht=3, return_value=0x8193fec, this_ptr=0x0, return_value_used=1)
    at /home/dl/php4-STABLE-200304092130/ext/oci8/oci8.c:4314
#7  0x403d7bdc in execute (op_array=0x818f8ac) at /home/dl/php4-STABLE-200304092130/Zend/zend_execute.c:1606
#8  0x403c56c0 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/dl/php4-STABLE-200304092130/Zend/zend.c:864
#9  0x4039ef1c in php_execute_script (primary_file=0xbffff5a0) at /home/dl/php4-STABLE-200304092130/main/main.c:1636
#10 0x403dfb7e in php_handler (r=0x8187e20) at /home/dl/php4-STABLE-200304092130/sapi/apache2handler/sapi_apache2.c:517
#11 0x0807b00e in ap_run_handler (r=0x8187e20) at config.c:194
#12 0x0807b529 in ap_invoke_handler (r=0x8187e20) at config.c:401
#13 0x0806b9df in ap_process_request (r=0x8187e20) at http_request.c:288
#14 0x08067b48 in ap_process_http_connection (c=0x8183c08) at http_core.c:293
#15 0x08083af6 in ap_run_process_connection (c=0x8183c08) at connection.c:85
#16 0x08079cc1 in child_main (child_num_arg=0) at prefork.c:696
#17 0x08079d74 in make_child (s=0x80b4fa0, slot=0) at prefork.c:736
#18 0x08079e5e in startup_children (number_to_start=5) at prefork.c:808
#19 0x0807a160 in ap_mpm_run (_pconf=0x80b2898, plog=0x80ea978, s=0x80b4fa0) at prefork.c:1024
#20 0x0807f407 in main (argc=2, argv=0xbffff874) at main.c:660
#21 0x401db4ad in __libc_start_main () from /lib/libc.so.6


sqlplus on the command line works fine, so it does
not seem like the oracle install is the issue... but
maybe oracle 9.2.0.1 does not work well with PHP4's
oci8's support ?

Help appreciated, Thanks

-- dl

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-28 12:56 UTC] ldemailly at qualys dot com
(reopening, updating summary with new crash info
(maybe I should open a new bug instead ?))
 [2003-04-28 13:01 UTC] ldemailly at qualys dot com
looks like my new info got lost, here it is again:
did cvs update on PHP_4_3, then buildconf then
./configure  --with-oci8=$ORACLE_HOME              --with-apache=../../apache_1.3.27 --with-mcrypt=/usr/local              --enable-sysvsem --enable-sysvshm --enable-trackvars              --with-gd --with-png-dir=/usr              --with-jpeg-dir=/usr --with-zlib-dir=/usr              --without-mysql && make && sudo make install
then for apache:
 ./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/libphp4.a --enable-module=php4 && make && sudo make install
(ORACLE_HOME = where 9.2.0.1 for linux (redhat 9)
is installed)
then :

[dl@dl-pc apache_1.3.27]$ gdb /usr/local/apache/bin/httpd
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 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 conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(no debugging symbols found)...
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
(no debugging symbols found)...[New Thread 1084695168 (LWP 26951)]
 
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1084695168 (LWP 26951)]
0x4073a4e2 in sskgmstat () from /usr/local/oracle/lib/libclntsh.so.9.0
(gdb) where
#0  0x4073a4e2 in sskgmstat () from /usr/local/oracle/lib/libclntsh.so.9.0
#1  0x40734827 in skgmidrealm () from /usr/local/oracle/lib/libclntsh.so.9.0
#2  0x40734331 in skgmlocate () from /usr/local/oracle/lib/libclntsh.so.9.0
#3  0x40733d28 in skgmcrone () from /usr/local/oracle/lib/libclntsh.so.9.0
#4  0x407383dc in skgmcrmany () from /usr/local/oracle/lib/libclntsh.so.9.0
#5  0x40731c0d in skgmcreate () from /usr/local/oracle/lib/libclntsh.so.9.0
#6  0x4032f86b in kgupmcreate_sga ()
   from /usr/local/oracle/lib/libclntsh.so.9.0
#7  0x4032d0c8 in kgup_startup () from /usr/local/oracle/lib/libclntsh.so.9.0
#8  0x40276033 in kpushInit () from /usr/local/oracle/lib/libclntsh.so.9.0
#9  0x40740607 in kpummpin () from /usr/local/oracle/lib/libclntsh.so.9.0
#10 0x40276389 in kpupin () from /usr/local/oracle/lib/libclntsh.so.9.0
#11 0x402cabbc in OCIInitialize () from /usr/local/oracle/lib/libclntsh.so.9.0
#12 0x080cb9dc in zm_startup_oci ()
#13 0x080a3a83 in zend_startup_module ()
#14 0x08084cad in php_startup_extensions ()
#15 0x080afa6e in php_startup_internal_extensions ()
#16 0x08085043 in php_module_startup ()
#17 0x0807e6cb in ap_get_server_built ()
#18 0x0807f075 in ap_get_server_built ()
#19 0x0807f15f in ap_get_server_built ()
#20 0x08146baa in ap_clear_module_list ()
#21 0x0814746e in ap_handle_command ()
#22 0x081474f5 in ap_srm_command_loop ()
#23 0x0814aa5c in ap_limit_section ()
#24 0x08146a24 in ap_clear_module_list ()
#25 0x0814746e in ap_handle_command ()
#26 0x081474f5 in ap_srm_command_loop ()
#27 0x08147c81 in ap_process_resource_config ()
#28 0x0814853f in ap_read_config ()
#29 0x08152b5d in main ()
#30 0x420156a4 in __libc_start_main () from /lib/tls/libc.so.6
(gdb)
 [2003-04-30 06:27 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Use THIS snapshot, do NOT try with anything else.
Otherwise we can't be sure it's not your tools that cause the problems. (DO NOT USE cvsclean / buildconf!!)

And remove the existing php4 module from the apache sources first.

Use THIS configure line:

./configure --disable-all --with-oci8=$ORACLE_HOME --enable-debug --with-apache=../../apache_1.3.27

Also make sure your apache is linked with libpthread.

 [2003-04-30 18:32 UTC] ldemailly at qualys dot com
Got the latest:
php4-STABLE-200304301930
cleaned apache (rm -rf src/modules/php4)
configured as below

it crashes during make install : (first time it rans php):

... make install normal output...
ranlib .libs/libphp4.a
creating libphp4.la
(cd .libs && rm -f libphp4.la && ln -s ../libphp4.la libphp4.la)
Installing PHP SAPI module
Installing shared extensions:     /usr/local/lib/php/extensions/debug-non-zts-20020429/
Installing PEAR environment:      /usr/local/lib/php/
make[1]: *** [install-pear-installer] Segmentation fault (core dumped)
make: *** [install-pear] Error 2
[dl@dl-pc php4-STABLE-200304301930]$ gdb sapi/cli/php core.21542
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 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 conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
Core was generated by `/home/dl/php4-STABLE-200304301930/sapi/cli/php -n -dsafe_mode=0 /home/dl/php4-S'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /lib/tls/libm.so.6...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /usr/local/oracle/lib/libclntsh.so.9.0...done.
Loaded symbols for /usr/local/oracle/lib/libclntsh.so.9.0
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /usr/local/oracle/lib/libwtc9.so...done.
Loaded symbols for /usr/local/oracle/lib/libwtc9.so
Reading symbols from /lib/tls/libpthread.so.0...done.
Loaded symbols for /lib/tls/libpthread.so.0
#0  0x406b14e2 in sskgmstat () from /usr/local/oracle/lib/libclntsh.so.9.0
(gdb) where
#0  0x406b14e2 in sskgmstat () from /usr/local/oracle/lib/libclntsh.so.9.0
#1  0x406ab827 in skgmidrealm () from /usr/local/oracle/lib/libclntsh.so.9.0
#2  0x406ab331 in skgmlocate () from /usr/local/oracle/lib/libclntsh.so.9.0
#3  0x406aad28 in skgmcrone () from /usr/local/oracle/lib/libclntsh.so.9.0
#4  0x406af3dc in skgmcrmany () from /usr/local/oracle/lib/libclntsh.so.9.0
#5  0x406a8c0d in skgmcreate () from /usr/local/oracle/lib/libclntsh.so.9.0
#6  0x402a686b in kgupmcreate_sga ()
   from /usr/local/oracle/lib/libclntsh.so.9.0
#7  0x402a40c8 in kgup_startup () from /usr/local/oracle/lib/libclntsh.so.9.0
#8  0x401ed033 in kpushInit () from /usr/local/oracle/lib/libclntsh.so.9.0
#9  0x406b7607 in kpummpin () from /usr/local/oracle/lib/libclntsh.so.9.0
#10 0x401ed389 in kpupin () from /usr/local/oracle/lib/libclntsh.so.9.0
#11 0x40241bbc in OCIInitialize () from /usr/local/oracle/lib/libclntsh.so.9.0
#12 0x0805b886 in zm_startup_oci (type=1, module_number=2)
    at /home/dl/php4-STABLE-200304301930/ext/oci8/oci8.c:489
#13 0x080fd819 in zend_startup_module (module=0x813a380)
    at /home/dl/php4-STABLE-200304301930/Zend/zend_API.c:1005
#14 0x080cb324 in php_startup_extensions (ptr=0x8143410, count=2)
    at /home/dl/php4-STABLE-200304301930/main/main.c:1032
#15 0x08110e51 in php_startup_internal_extensions ()
    at main/internal_functions_cli.c:53
#16 0x080cb77f in php_module_startup (sf=0x8143380, additional_modules=0x0,
    num_additional_modules=0)
---Type <return> to continue, or q <return> to quit---
    at /home/dl/php4-STABLE-200304301930/main/main.c:1199
#17 0x08110055 in main (argc=7, argv=0xbfffe644)
    at /home/dl/php4-STABLE-200304301930/sapi/cli/php_cli.c:508
#18 0x420156a4 in __libc_start_main () from /lib/tls/libc.so.6
(gdb)

but ! if I run it as root it does not crash right away !
after comparing the strace output for root and non root
I isolated it to :
shmctl(52723762, IPC_64|IPC_STAT, 0xbfffa8f4) = -1 EACCES (Permission denied)
failing when ran as user

removing (ipcrm -m) segments owned by root and not in use (ipcs -m) fixed that initial crash
(putting this in the bug as it may help people encountering the same odd behaviour. maybe it is worth an FAQ too ?)
I think when there was the actual bug, it crashed and left some memory segment dangling
(It should still not crash imo, on perm error, but that looks like an Oracle bug and not a PHP one)

It now works ! Thanks !
 [2003-04-30 18:33 UTC] ldemailly at qualys dot com
(it is fixed, can be closed, thx again)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 19:01:33 2024 UTC