ID:               24531
 Updated by:       [EMAIL PROTECTED]
 Reported By:      Manfred dot Metz at rsd dot rohde-schwarz dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         OCI8 related
 Operating System: Solaris 8 (SPARC)
 PHP Version:      4.3.3RC2-dev
 New Comment:

Can you please provide the patch in unified diff format?
(diff -u)



Previous Comments:
------------------------------------------------------------------------

[2003-07-09 08:28:08] Manfred dot Metz at rsd dot rohde-schwarz dot com

Both ocilogon and ociplogon are working fine and stable when i use
parts of the patch provided by Massimo Squillace. Here is my diff:

diff -cw -r php4-STABLE-200307080530/ext/oci8/oci8.c
php-4.3.3RC2-dev/ext/oci8/oci8.c
*** php4-STABLE-200307080530/ext/oci8/oci8.c    Fri May  2 11:05:44
2003
--- php-4.3.3RC2-dev/ext/oci8/oci8.c    Tue Jul  8 12:57:41 2003
***************
*** 2153,2158 ****
--- 2153,2160 ----
        oci_session *session = 0, *psession = 0;
        OCISvcCtx *svchp = 0;
        char *hashed_details;
+       struct timeval tv;
+       int sec, usec;
  #ifdef HAVE_OCI_9_2
        ub2 charsetid = 0;
  #endif
***************
*** 2167,2172 ****
--- 2169,2175 ----
           but only as pesistent requested connections will be kept
between requests!
        */

+       if (! exclusive) {
        hashed_details = (char *)
malloc(strlen(SAFE_STRING(username))+
                                                                       
 strlen(SAFE_STRING(password))+
                                                                       
 strlen(SAFE_STRING(server->dbname))+1);
***************
*** 2176,2182 ****
                        SAFE_STRING(password),
                        SAFE_STRING(server->dbname));

-       if (! exclusive) {
                zend_hash_find(OCI(user), hashed_details,
strlen(hashed_details)+1, (void **) &session);

                if (session) {
--- 2179,2184 ----
***************
*** 2191,2196 ****
--- 2193,2207 ----
                                /* breakthru to open */
                        }
                }
+       } else {
+       gettimeofday((struct timeval *) &tv, (struct timezone *)
NULL);
+       sec = (int) tv.tv_sec;
+       usec = (int) (tv.tv_usec % 1000000);
+       /* The max value usec can have is 0xF423F, so we use only five
+        hex digits for usec and eigth hex digits for sec. */
+       hashed_details = (char *) malloc(8+5+1); /* always enough */
+       sprintf(hashed_details, "%08x%05x", tv.tv_sec, tv.tv_usec);
+
        }

        session = calloc(1,sizeof(oci_session));
***************
*** 2679,2685 ****
                persistent = 0;
        } else {
                /* if our server-context is not persistent we can't */
!               persistent = server->persistent;
        }

        session =
_oci_open_session(server,username,password,persistent,exclusive,charset);
--- 2690,2696 ----
                persistent = 0;
        } else {
                /* if our server-context is not persistent we can't */
!               persistent = server->persistent ? persistent : 0;
        }

        session =
_oci_open_session(server,username,password,persistent,exclusive,charset);

------------------------------------------------------------------------

[2003-07-08 05:02:26] Manfred dot Metz at rsd dot rohde-schwarz dot com

After switching to persistant OCI connections the error seems to be
gone?!?!?!?!?!

------------------------------------------------------------------------

[2003-07-08 02:42:07] Manfred dot Metz at rsd dot rohde-schwarz dot com

Description:
------------
When running a PHP Skript with Oracle calls then very often the apache
process dies and produces a SIGSEV error.

My configuration is:

./configure
--with-apache=../apache_1.3.27
--with-xml
--enable-wddx
--with-ldap=/usr/local
--with-openssl=/usr/local/ssl
--with-curl=/usr/local
--with-zlib
--with-oci8=/opt/oracle/ora920
--without-mysql
--with-config-file-path=/etc/apache
--enable-debug
--prefix=/usr/local

The first occurrence of the error has the following backtrace:

Program received signal SIGSEGV, Segmentation fault.
0xfebf0b1c in sltstcu () from /opt/ora920/ora920/lib/libclntsh.so.9.0
(gdb) bt
#0  0xfebf0b1c in sltstcu () from
/opt/ora920/ora920/lib/libclntsh.so.9.0
#1  0xfe57aa24 in kpusattr () from
/opt/ora920/ora920/lib/libclntsh.so.9.0
#2  0xc03fc in _oci_close_session (session=0x3f3200)
    at /data/src/php4-STABLE-200307080530/ext/oci8/oci8.c:2410
#3  0xbbda8 in _oci_session_list_dtor (rsrc=0x374a58)
    at /data/src/php4-STABLE-200307080530/ext/oci8/oci8.c:935
#4  0x91790 in list_entry_destructor (ptr=0x374a58)
    at /data/src/php4-STABLE-200307080530/Zend/zend_list.c:177
#5  0x8e7ec in zend_hash_apply_deleter (ht=0x28bb4c, p=0x4b3df0)
    at /data/src/php4-STABLE-200307080530/Zend/zend_hash.c:598
#6  0x8eb5c in zend_hash_graceful_reverse_destroy (ht=0x28bb4c)
    at /data/src/php4-STABLE-200307080530/Zend/zend_hash.c:664
#7  0x91984 in zend_destroy_rsrc_list (ht=0x28bb4c)
    at /data/src/php4-STABLE-200307080530/Zend/zend_list.c:233
#8  0x755bc in shutdown_executor ()
    at /data/src/php4-STABLE-200307080530/Zend/zend_execute_API.c:213
#9  0x85878 in zend_deactivate ()
    at /data/src/php4-STABLE-200307080530/Zend/zend.c:666
#10 0x3c3b4 in php_request_shutdown (dummy=0x0)
    at /data/src/php4-STABLE-200307080530/main/main.c:995
#11 0xa552c in apache_php_module_main (r=0x34ab58,
display_source_mode=0)
    at /data/src/php4-STABLE-200307080530/sapi/apache/sapi_apache.c:60
#12 0x30fa8 in send_php ()
---Type <return> to continue, or q <return> to quit---
#13 0x31018 in send_parsed_php ()
#14 0x1ed94c in ap_invoke_handler ()
#15 0x20e2f0 in process_request_internal ()
#16 0x20e37c in ap_process_request ()
#17 0x200630 in child_main ()
#18 0x2009d4 in make_child ()
#19 0x200aec in startup_children ()
#20 0x201514 in standalone_main ()
#21 0x2021ac in main ()



All subsequent occurrences have this backtrace:

Program received signal SIGSEGV, Segmentation fault.
0xfe3428d4 in t_splay () from /usr/lib/libc.so.1
(gdb) bt
#0  0xfe3428d4 in t_splay () from /usr/lib/libc.so.1
#1  0xfe342740 in t_delete () from /usr/lib/libc.so.1
#2  0xfe342344 in realfree () from /usr/lib/libc.so.1
#3  0xfe342b84 in _free_unlocked () from /usr/lib/libc.so.1
#4  0xfe342ad4 in free () from /usr/lib/libc.so.1
#5  0xfe823230 in nlad_destroy_node ()
   from /opt/ora920/ora920/lib/libclntsh.so.9.0
#6  0xfe82320c in nlad_destroy_node ()
   from /opt/ora920/ora920/lib/libclntsh.so.9.0
#7  0xfe822424 in nladtrm () from
/opt/ora920/ora920/lib/libclntsh.so.9.0
#8  0xfe71fe50 in nsopen_cleanup ()
   from /opt/ora920/ora920/lib/libclntsh.so.9.0
#9  0xfe71f83c in nsclose () from
/opt/ora920/ora920/lib/libclntsh.so.9.0
#10 0xfe702ec4 in nsdisc () from
/opt/ora920/ora920/lib/libclntsh.so.9.0
#11 0xfe7a9bc8 in nioqds () from
/opt/ora920/ora920/lib/libclntsh.so.9.0
#12 0xfe53abbc in upidhs () from
/opt/ora920/ora920/lib/libclntsh.so.9.0
#13 0xfe55dcb0 in kpudtch () from
/opt/ora920/ora920/lib/libclntsh.so.9.0
#14 0xc0bbc in _oci_close_server (server=0x323790)
    at /data/src/php4-STABLE-200307080530/ext/oci8/oci8.c:2595
#15 0xbbd60 in _oci_server_list_dtor (rsrc=0x7bb930)
    at /data/src/php4-STABLE-200307080530/ext/oci8/oci8.c:921
#16 0x91790 in list_entry_destructor (ptr=0x7bb930)
    at /data/src/php4-STABLE-200307080530/Zend/zend_list.c:177
---Type <return> to continue, or q <return> to quit---
#17 0x8e7ec in zend_hash_apply_deleter (ht=0x28bb4c, p=0x49b508)
    at /data/src/php4-STABLE-200307080530/Zend/zend_hash.c:598
#18 0x8eb5c in zend_hash_graceful_reverse_destroy (ht=0x28bb4c)
    at /data/src/php4-STABLE-200307080530/Zend/zend_hash.c:664
#19 0x91984 in zend_destroy_rsrc_list (ht=0x28bb4c)
    at /data/src/php4-STABLE-200307080530/Zend/zend_list.c:233
#20 0x755bc in shutdown_executor ()
    at /data/src/php4-STABLE-200307080530/Zend/zend_execute_API.c:213
#21 0x85878 in zend_deactivate ()
    at /data/src/php4-STABLE-200307080530/Zend/zend.c:666
#22 0x3c3b4 in php_request_shutdown (dummy=0x0)
    at /data/src/php4-STABLE-200307080530/main/main.c:995
#23 0xa552c in apache_php_module_main (r=0x34abb8,
display_source_mode=0)
    at /data/src/php4-STABLE-200307080530/sapi/apache/sapi_apache.c:60
#24 0x30fa8 in send_php ()
#25 0x31018 in send_parsed_php ()
#26 0x1ed94c in ap_invoke_handler ()
#27 0x20e2f0 in process_request_internal ()
#28 0x20e37c in ap_process_request ()
#29 0x200630 in child_main ()
#30 0x2009d4 in make_child ()
#31 0x200f40 in perform_idle_server_maintenance ()
#32 0x20182c in standalone_main ()
---Type <return> to continue, or q <return> to quit---
#33 0x2021ac in main ()






------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24531&edit=1

Reply via email to