# 4.3.2RC4 OCI8 crash

- Thread: https://externals.io/message/2031
- Original archive: https://news-web.php.net/php.internals/2031
- Started by mbretter@jawa@Michael Bretterklieber on 2003-05-27T07:02:24+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #2031 — mbretter@jawa@Michael Bretterklieber — 2003-05-27T07:02:24+00:00

URL: https://externals.io/message/2031#2031

Hi,

we discovered a crash using 4.3.2RC4 with oci8, here's the bt:
(gdb) bt
#0  0x404422b4 in kghalp () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
#1  0x4044fd28 in kgebem () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
#2  0x404513de in kgedes () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
#3  0x401851ff in skgudmp () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
#4  0x4044e1bc in kgesiv () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
#5  0x4044dfb8 in kgesic1 () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
#6  0x4043d55a in kgherror () from
/opt/oracle/OraHome1/lib/libclntsh.so.8.0
#7  0x4044385f in kghfre () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
#8  0x400f7332 in kpuhhfre () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
#9  0x40101e1f in kpufhndl () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
#10 0x40130b67 in OCIHandleFree () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
#11 0x0809d2f5 in _oci_stmt_list_dtor (rsrc=0x8229554) at /daten1/software/php-4.3.2RC4/ext/oci8/oci8.c:774
#12 0x08166dce in list_entry_destructor (ptr=0x8ac1ff4) at /daten1/software/php-4.3.2RC4/Zend/zend_list.c:172
#13 0x08165546 in zend_hash_del_key_or_index (ht=0x81ef9a0, arKey=0x0, nKeyLength=0, h=222, flag=1)
    at /daten1/software/php-4.3.2RC4/Zend/zend_hash.c:514
#14 0x08166b45 in _zend_list_delete (id=222)
    at /daten1/software/php-4.3.2RC4/Zend/zend_list.c:56
#15 0x0815fa4d in _zval_dtor (zvalue=0x8abff34)
    at /daten1/software/php-4.3.2RC4/Zend/zend_variables.c:69
#16 0x08158b09 in _zval_ptr_dtor (zval_ptr=0x8abfc68)
    at /daten1/software/php-4.3.2RC4/Zend/zend_execute_API.c:291
#17 0x08165659 in zend_hash_destroy (ht=0x8ac0394)
    at /daten1/software/php-4.3.2RC4/Zend/zend_hash.c:543
#18 0x0815faab in _zval_dtor (zvalue=0xbfff1e10)
    at /daten1/software/php-4.3.2RC4/Zend/zend_variables.c:60
#19 0x08172126 in zend_assign_to_variable (result=0x409b9018, op1=0x8abff14, op2=0x409b9038, value=0x8ab9fa4, type=4, Ts=0xbfff1e60)
    at /daten1/software/php-4.3.2RC4/Zend/zend_execute.c:439
#20 0x0816f2fa in execute (op_array=0x824d924)
    at /daten1/software/php-4.3.2RC4/Zend/zend_execute.c:1349
#21 0x08161230 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /daten1/software/php-4.3.2RC4/Zend/zend.c:869
#22 0x08136eec in php_execute_script (primary_file=0xbffff570)
    at /daten1/software/php-4.3.2RC4/main/main.c:1671
#23 0x08173d8f in main (argc=2, argv=0xbffff5f4)
    at /daten1/software/php-4.3.2RC4/sapi/cli/php_cli.c:802
---Type <return> to continue, or q <return> to quit---
#24 0x408368ae in __libc_start_main () from /lib/libc.so.6

we started the script from the commandline:
# php spqm_sqp.php
Dachzierleiste200363.imp<br>Griffleiste200503.imp<br>********** Internal heap ERROR 17112 addr=0x8abd3e0 *********

 `phpinfo()` is here:
https://www.sqp.at/phpinfo.php

any suggestions?

bye,
--
------------------------------- ----------------------------------
Michael Bretterklieber          - http://www.bretterklieber.com
JAWA Management Software GmbH   - http://www.jawa.at
Tel: ++43-(0)316-403274-12      - GSM: ++43-(0)676-84 03 15 712
------------------------------- ----------------------------------
"...the number of UNIX installations has grown to 10, with more
expected..." - Dennis Ritchie and Ken Thompson, June 1972

---

## #2040 — Michael Mauch — 2003-05-27T18:00:04+00:00

URL: https://externals.io/message/2031#2040 · In reply to: #2031

Michael Bretterklieber wrote:

> we discovered a crash using 4.3.2RC4 with oci8, here's the bt:

Is your Apache linked to pthread, like it's written on
<http://www.php.net/oci8>?

And your extension_dir .../no-debug-non-zts-20020429
is probably the wrong one, as you are using --enable-debug.

Regards...
		Michael

---

## #2041 — mbretter@jawa@Michael Bretterklieber — 2003-05-27T18:35:37+00:00

URL: https://externals.io/message/2031#2041 · In reply to: #2040

> Michael Bretterklieber wrote:
>
> > […]
>
> Is your Apache linked to pthread, like it's written on
> <http://www.php.net/oci8>?
sure, and all other neat things like library-preload, etc.

we usualy start this script with the cli-php, but sometimes also from
apache.

>
> And your extension_dir .../no-debug-non-zts-20020429
> is probably the wrong one, as you are using --enable-debug.
>
we don't load any extensions dynamicaly (all exts are staticaly
compiled in) and usualy we use a non debug-build :-)

however we could workaround this, we had a function like this:

function foo()
{
    $db = new DB;
    $db->query(..)
    ..
}

this function was invoked several times, and our database-objects
connected also several times to oracle, then I declared $db static:
function foo()
{
    static $db;
    $db = new DB;
    $db->query(..)
    ..
}

et voila, the script didn't crashed anymore :-)

It looks like that the oci extension has some bugs in freeing resources,
because according to the bt, the oci module freees an already freeed
resource, if I'm right, or maybe a problem with the reference counting,
...

tomorrow I can send the output with ociinternaldebug(true)

another hint, I tried all php versions down to 4.2.1, and all versions
caused the script to crash.

bye,
--
------------------------------- ----------------------------------
Michael Bretterklieber          - http://www.bretterklieber.com
JAWA Management Software GmbH   - http://www.jawa.at
Tel: ++43-(0)316-403274-12      - GSM: ++43-(0)676-84 03 15 712
------------------------------- ----------------------------------
"...the number of UNIX installations has grown to 10, with more
expected..." - Dennis Ritchie and Ken Thompson, June 1972

---

## #2045 — mbretter@jawa@Michael Bretterklieber — 2003-05-28T07:21:25+00:00

URL: https://externals.io/message/2031#2045 · In reply to: #2031

Hi,

here's the output with ociinternaldebug(1):
http://www.bretterklieber.com/php/oci8_crash.log

FYI: the file has about 800KB


> Hi,
>
> we discovered a crash using 4.3.2RC4 with oci8, here's the bt:
> (gdb) bt
> #0  0x404422b4 in kghalp () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
> #1  0x4044fd28 in kgebem () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
> #2  0x404513de in kgedes () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
> #3  0x401851ff in skgudmp () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
> #4  0x4044e1bc in kgesiv () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
> #5  0x4044dfb8 in kgesic1 () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
> #6  0x4043d55a in kgherror () from
> /opt/oracle/OraHome1/lib/libclntsh.so.8.0
> #7  0x4044385f in kghfre () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
> #8  0x400f7332 in kpuhhfre () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
> #9  0x40101e1f in kpufhndl () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
> #10 0x40130b67 in OCIHandleFree () from /opt/oracle/OraHome1/lib/libclntsh.so.8.0
> #11 0x0809d2f5 in _oci_stmt_list_dtor (rsrc=0x8229554) at /daten1/software/php-4.3.2RC4/ext/oci8/oci8.c:774
> #12 0x08166dce in list_entry_destructor (ptr=0x8ac1ff4) at /daten1/software/php-4.3.2RC4/Zend/zend_list.c:172
> #13 0x08165546 in zend_hash_del_key_or_index (ht=0x81ef9a0, arKey=0x0, nKeyLength=0, h=222, flag=1)
>     at /daten1/software/php-4.3.2RC4/Zend/zend_hash.c:514
> #14 0x08166b45 in _zend_list_delete (id=222)
>     at /daten1/software/php-4.3.2RC4/Zend/zend_list.c:56
> #15 0x0815fa4d in _zval_dtor (zvalue=0x8abff34)
>     at /daten1/software/php-4.3.2RC4/Zend/zend_variables.c:69
> #16 0x08158b09 in _zval_ptr_dtor (zval_ptr=0x8abfc68)
>     at /daten1/software/php-4.3.2RC4/Zend/zend_execute_API.c:291
> #17 0x08165659 in zend_hash_destroy (ht=0x8ac0394)
>     at /daten1/software/php-4.3.2RC4/Zend/zend_hash.c:543
> #18 0x0815faab in _zval_dtor (zvalue=0xbfff1e10)
>     at /daten1/software/php-4.3.2RC4/Zend/zend_variables.c:60
> #19 0x08172126 in zend_assign_to_variable (result=0x409b9018, op1=0x8abff14, op2=0x409b9038, value=0x8ab9fa4, type=4, Ts=0xbfff1e60)
>     at /daten1/software/php-4.3.2RC4/Zend/zend_execute.c:439
> #20 0x0816f2fa in execute (op_array=0x824d924)
>     at /daten1/software/php-4.3.2RC4/Zend/zend_execute.c:1349
> #21 0x08161230 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
>     at /daten1/software/php-4.3.2RC4/Zend/zend.c:869
> #22 0x08136eec in php_execute_script (primary_file=0xbffff570)
>     at /daten1/software/php-4.3.2RC4/main/main.c:1671
> #23 0x08173d8f in main (argc=2, argv=0xbffff5f4)
>     at /daten1/software/php-4.3.2RC4/sapi/cli/php_cli.c:802
> ---Type <return> to continue, or q <return> to quit---
> #24 0x408368ae in __libc_start_main () from /lib/libc.so.6
>

bye,
--
------------------------------- ----------------------------------
Michael Bretterklieber          - http://www.bretterklieber.com
JAWA Management Software GmbH   - http://www.jawa.at
Tel: ++43-(0)316-403274-12      - GSM: ++43-(0)676-84 03 15 712
------------------------------- ----------------------------------
"...the number of UNIX installations has grown to 10, with more
expected..." - Dennis Ritchie and Ken Thompson, June 1972
