php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20249 Apache child segfaults when using OCILogon.
Submitted: 2002-11-04 16:43 UTC Modified: 2002-12-01 16:34 UTC
Votes:7
Avg. Score:4.7 ± 0.5
Reproduced:6 of 6 (100.0%)
Same Version:2 (33.3%)
Same OS:1 (16.7%)
From: bdabney at dallasnews dot com Assigned:
Status: No Feedback Package: OCI8 related
PHP Version: 4.2.3 OS: Solaris 9
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bdabney at dallasnews dot com
New email:
PHP Version: OS:

 

 [2002-11-04 16:43 UTC] bdabney at dallasnews dot com
I get the following messages in my Apache 1.3.27 error log whenever I try to use OCILogon:

[Mon Nov  4 15:32:46 2002] [notice] Apache/1.3.27 (Unix) PHP/4.2.3 configured -- resuming normal ope
rations
[Mon Nov  4 15:32:46 2002] [notice] Accept mutex: fcntl (Default: fcntl)
[Mon Nov  4 15:33:00 2002] [notice] child pid 13088 exit signal Segmentation Fault (11)
[Mon Nov  4 15:33:00 2002] [notice] child pid 13086 exit signal Segmentation Fault (11)
[Mon Nov  4 15:33:00 2002] [notice] child pid 13085 exit signal Segmentation Fault (11)
[Mon Nov  4 15:33:00 2002] [notice] child pid 13084 exit signal Segmentation Fault (11)
[Mon Nov  4 15:33:00 2002] [notice] child pid 13083 exit signal Segmentation Fault (11)
[Mon Nov  4 15:33:00 2002] [notice] child pid 13082 exit signal Segmentation Fault (11)
[Mon Nov  4 15:33:01 2002] [notice] child pid 13090 exit signal Segmentation Fault (11)
[Mon Nov  4 15:33:01 2002] [notice] child pid 13089 exit signal Segmentation Fault (11)
[Mon Nov  4 15:33:02 2002] [notice] child pid 13092 exit signal Segmentation Fault (11)
[Mon Nov  4 15:33:02 2002] [notice] child pid 13091 exit signal Segmentation Fault (11)

Here is the script I tested with:

<?

$SID = "(DESCRIPTION = 
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.140)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = TESTDB.WORLD)
    )
)";

$conn = OCILogon ("scott", "tiger",$SID);

print "Connected!<br>\n";
?>

Here are my configure lines:

For apache :

OPTIM="-g -m64" CFLAGS="-DDYNAMIC_MODULE_LIMIT=0" ./configure --mandir=/usr/local/man --activate-module=src/modules/php4/libphp4.a --enable-module=php4 --server-uid=www --server-gid=www

For PHP

CFLAGS="-g -m64" ./configure --with-apache=../apache_1.3.27 --with-xml --with-oci8=/usr/local/oracle/OraHome --with-zlib --enable-inline-optimization --enable-bcmath --enable-debug

They were both compiled with gcc-3.2.

Here are the environment variable settings from my httpd.conf:

SetEnv ORACLE_BASE /usr/local/oracle
SetEnv ORACLE_HOME /usr/local/oracle/OraHome
SetEnv ORACLE_SID TESTDB.WORLD
SetEnv TNS_ADMIN /usr/local/oracle/OraHome/network/admin/tnsnames.ora
SetEnv TWO_TASK /usr/local/oracle/OraHome/network/admin/tnsnames.ora
SetEnv NLS_LANG English_America.WE8ISO8859P1

And here is the backtrace:

bash-2.05# gdb /usr/local/apache/bin/httpd 
GNU gdb 5.2.1
Copyright 2002 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 "sparc-sun-solaris2.9"...
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X

Program received signal SIGSEGV, Segmentation fault.
0xffffffff7d03b84c in strlen () from /usr/lib/64/libc.so.1
(gdb) bt
#0  0xffffffff7d03b84c in strlen () from /usr/lib/64/libc.so.1
#1  0xffffffff7d843e68 in snauca_check_adapter ()
   from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#2  0xffffffff7d841d58 in nau_viat () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#3  0xffffffff7d838454 in nau_gettab () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#4  0xffffffff7d8360a0 in nau_ini () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#5  0xffffffff7d827084 in nainit () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#6  0xffffffff7d7ce8b0 in nsnainit () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#7  0xffffffff7d7c0070 in nsopen () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#8  0xffffffff7d7a59e0 in nscall1 () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#9  0xffffffff7d7a4e28 in nscall () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#10 0xffffffff7d85e6dc in niotns () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#11 0xffffffff7d857fe8 in nigcall () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#12 0xffffffff7d7dfd54 in osncon () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#13 0xffffffff7d5b39dc in kpuadef () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#14 0xffffffff7d67b5fc in upiini () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#15 0xffffffff7d666554 in upiah0 () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#16 0xffffffff7d5b3308 in kpuatch () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#17 0xffffffff7d657084 in OCIServerAttach () from /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
#18 0x10007684c in _oci_open_server (
    dbname=0x10048fc30 "(DESCRIPTION = \n    (ADDRESS_LIST =\n      (ADDRESS = (PROTOCOL = TCP)(HOST = 176.175.0.140)(PORT = 1521))\n    )\n    (CONNECT_DATA =\n      (SERVICE_NAME = ldrbrd.world)\n    )\n)", persistent=0) at oci8.c:2427
#19 0x100077684 in oci_do_connect (ht=3, return_value=0x10048fe80, this_ptr=0x0, 
    return_value_used=1, persistent=0, exclusive=0) at oci8.c:2578
#20 0x10007f0a0 in zif_ocilogon (ht=3, return_value=0x10048fe80, this_ptr=0x0, return_value_used=1)
    at oci8.c:4203
#21 0x1001e5a28 in execute (op_array=0x10048b0f0) at zend_execute.c:1598
#22 0x1001a1700 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:812
#23 0x10002c100 in php_execute_script (primary_file=0xffffffff7ffff130) at main.c:1383
#24 0x1001b67b4 in apache_php_module_main (r=0x1004804c0, display_source_mode=0)
    at sapi_apache.c:90
#25 0x100024b30 in send_php (r=0x1004804c0, display_source_mode=0, 
    filename=0x100481598 "/usr/local/apache/htdocs/test.php") at mod_php4.c:575
#26 0x100024bc0 in send_parsed_php (r=0x1004804c0) at mod_php4.c:590
#27 0x10021fb58 in ap_invoke_handler (r=0x1004804c0) at http_config.c:518
#28 0x1002480fc in process_request_internal (r=0x1004804c0) at http_request.c:1308
#29 0x10024819c in ap_process_request (r=0x1004804c0) at http_request.c:1324
#30 0x1002370b4 in child_main (child_num_arg=0) at http_main.c:4603
---Type <return> to continue, or q <return> to quit---
#31 0x100237428 in make_child (s=0x100408a30, slot=0, now=1036448741) at http_main.c:4718
#32 0x100237728 in startup_children (number_to_start=5) at http_main.c:4800
#33 0x1002386f4 in standalone_main (argc=2, argv=0xffffffff7ffffc98) at http_main.c:5108
#34 0x100239ab4 in main (argc=2, argv=0xffffffff7ffffc98) at http_main.c:5456
(gdb) frame 21
#21 0x1001e5a28 in execute (op_array=0x10048b0f0) at zend_execute.c:1598
1598                                                    ((zend_internal_function *) EX(function_state).function)->handler(EX(opline)->extended_value, EX(Ts)[EX(opline)->result.u.var].var.ptr, EX(object).ptr, return_value_used TSRMLS_CC);
(gdb)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-04 16:52 UTC] bdabney at dallasnews dot com
This is with Oracle 9i Release 2.
 [2002-11-04 17:15 UTC] michael dot mauch at gmx dot de
Using Apache's  SetEnv doesn't work for PHP/Oracle. You have to set these really in Apache's environment (e.g. in apachectl).

If that alone doesn't help: did you see the "big fat note" at <http://www.php3.de/manual/en/ref.oci8.php>:

If your webserver doesn't start or crashes at startup:  Check that Apache is linked with the pthread library: [...]
 [2002-11-05 10:15 UTC] bdabney at dallasnews dot com
Ok, I had put those SetEnv statements in Apache to see if they would help. I do have the same environment variables set in apachectl when I run Apache.

And I did read the note. Here is output from ldd:

# ldd /usr/local/apache/bin/httpd
        libpam.so.1 =>   /usr/lib/64/libpam.so.1
        libz.so.1 =>     /usr/lib/64/libz.so.1
        libcrypt_i.so.1 =>       /usr/lib/64/libcrypt_i.so.1
        libresolv.so.2 =>        /usr/lib/64/libresolv.so.2
        libm.so.1 =>     /usr/lib/64/libm.so.1
        libdl.so.1 =>    /usr/lib/64/libdl.so.1
        libnsl.so.1 =>   /usr/lib/64/libnsl.so.1
        libsocket.so.1 =>        /usr/lib/64/libsocket.so.1
        libgen.so.1 =>   /usr/lib/64/libgen.so.1
        libclntsh.so.9.0 =>      /usr/local/oracle/OraHome/lib/libclntsh.so.9.0
        libpthread.so.1 =>       /usr/lib/64/libpthread.so.1
        libc.so.1 =>     /usr/lib/64/libc.so.1
        libcmd.so.1 =>   /usr/lib/64/libcmd.so.1
        libmp.so.2 =>    /usr/lib/64/libmp.so.2
        libwtc9.so =>    /usr/local/oracle/OraHome/lib/libwtc9.so
        libaio.so.1 =>   /usr/lib/64/libaio.so.1
        librt.so.1 =>    /usr/lib/64/librt.so.1
        libmd5.so.1 =>   /usr/lib/64/libmd5.so.1
        libthread.so.1 =>        /usr/lib/64/libthread.so.1
        /usr/platform/SUNW,Sun-Blade-100/lib/sparcv9/libc_psr.so.1
        /usr/platform/SUNW,Sun-Blade-100/lib/sparcv9/libmd5_psr.so.1

Could the fact that it's linked to both the pthread and the thread library be causing a problem? If so, how do I prevent it from linking to the thread library?
 [2002-11-06 10:14 UTC] bdabney at dallasnews dot com
Ok, doing an ldd on /usr/lib/64/libpthread.so.1 answered that question. It uses libthread.
 [2002-11-07 19:12 UTC] sniper@php.net
Please try using this CVS snapshot:

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


 [2002-11-21 17:10 UTC] sniper@php.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 "Open". Thank you.


 [2002-11-21 17:12 UTC] bdabney at dallasnews dot com
This is still an issue.
 [2002-11-21 17:20 UTC] sniper@php.net
Please try using this CVS snapshot:

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


 [2002-12-01 16:34 UTC] sniper@php.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 "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC