#33383 [Opn-Fbk]: PHP crashes while retrieving data from Oracle
ID: 33383 Updated by: [EMAIL PROTECTED] Reported By: johnny at ouranous dot idv dot tw -Status: Open +Status: Feedback Bug Type: OCI8 related Operating System: Solaris 9 -PHP Version: 5.0.4 +PHP Version: 5CVS-2005-10-06 (snap, oci8-beta) Assigned To: tony2001 New Comment: Do not load the extension with dl()!! Put it in php.ini. Using dl() is known to cause crashes in all usual and unusual ways.. Previous Comments: [2005-10-07 06:36:32] johnny at ouranous dot idv dot tw Description: Crashed where clob field contains no data. Reproduce code: --- ?php if (!extension_loaded('oci8')) { dl('oci8.so'); } $db_connect_id = OCINLogon( username, passwd, dbserver ); $query = SELECT guid,objcontent FROM objectcontent WHERE rownum 10; $stmt = OCIParse ($db_connect_id, $query); OCIExecute($stmt, OCI_DEFAULT); while( true ) { if( !OCIFetchInto($stmt, $arr, OCI_ASSOC|OCI_RETURN_LOBS) ) break; while( list($key,$val)=each($arr) ) { echo Key:.$key.\tVal:.$val.\n; } } ? Expected result: Key:GUIDVal:0011856596F1-423F9E4F-05E6-C367-9C3C Key:OBJCONTENT Val:¢Xþ³ ïy ¡Óa ü îûec Ä2 ®: Key:GUIDVal:0011856596F1-423F906A-0575-4A3D-F21A Key:OBJCONTENT Val: Key:GUIDVal:0011856596F1-423F906C-01C6-8953-3638 Key:OBJCONTENT Val: Key:GUIDVal:0011856596F1-423F906E-02D6-EED9-B606 Key:OBJCONTENT Val:¢Xþ³ ïy ¡Óa ü îûec Ä2 ®: Key:GUIDVal:0011856596F1-423F9070-002C-1E4F-B904 Key:OBJCONTENT Val:¢Xþ³ ïy ¡Óa ü îûec Ä2 ®: Key:GUIDVal:0011856596F1-423F9072-022E-F935-14B2 Key:OBJCONTENT Val:¢Xþ³ ïy ¡Óa ü îûec Ä2 ®: Key:GUIDVal:0011856596F1-423F9074-0118-D30B-B890 Key:OBJCONTENT Val:¢Xþ³ ïy ¡Óa ü îûec Ä2 ®: Key:GUIDVal:0011856596F1-423F9075-0489-6151-A41E Key:OBJCONTENT Val:¢Xþ³ ïy ¡Óa ü îûec Ä2 ®: Actual result: -- Key:GUIDVal:0011856596F1-423F9E4F-05E6-C367-9C3C Key:OBJCONTENT Val:¢Xþ³ ïy ¡Óa ü îûec Ä2 ®: Segmentation Fault (core dumped) [2005-10-04 08:54:10] johnny at ouranous dot idv dot tw oci8-beta still got crashed. And there was something I forgot to mention. My Oracle 9i is configured to use UTF8. [2005-09-08 11:51:36] [EMAIL PROTECTED] Please try OCI8 v.1.1, which is available in CVS HEAD and PECL (use `pear install oci8-beta` to install it). [2005-06-17 13:05:18] johnny at ouranous dot idv dot tw Description: I think this bug is simular to Bug #6561 but in Solaris I've test 3 different version of php in CGI/CLI mode all happended. Here is my enviornment configuration: Sun V240(sparc) Solaris 9 gcc 3.4.2 Oracle 9.2.0.4 php 4.3.11 CFLAGS=`getconf LFS_CFLAGS` ./configure --prefix=/usr/local/php4 --with-oci8=/data/oracle/OraHome1 --with-ncurses=/usr/local/lib --enable-pcntl --with-readline=/usr/local/lib --enable-mbstring=all php 5.0.3 CFLAGS=`getconf LFS_CFLAGS` ./configure --prefix=/usr/local/php5 --with-oci8=/data/oracle/OraHome1 --with-ncurses=/usr/local/lib --enable-pcntl --with-readline=/usr/local/lib --enable-mbstring=all php 5.0.4 CFLAGS=`getconf LFS_CFLAGS` ./configure --prefix=/usr/local/php5 --with-oci8=/data/oracle/OraHome1 --with-ncurses=/usr/local/lib --enable-mbstring=all (cannot build with --enable-pcntl --with-readline=/usr/local/lib) modified 1. phpdir/configure 2. phpdir/ext/oci8/config.m4 OCI8_DIR/lib - OCI8_DIR/lib32 OCI8_DIR/rdbms/lib - OCI8_DIR/rdbms/lib32 CGI/CLI crashed (core dumped) at some CLOB field at ociFetchInto when ociFetchInto with OCI_RETURN_LOBS, and crashed at -load() when ociFetchInto without OCI_RETURN_LOBS, same code runs fine is PHP4/PHP5 on windows Reproduce code: --- Very hard to reproduce exactly. It happens while retrieving data from an Oracle 8 database. The same code works fine in Windows Environment. Expected result: $query = SELECT field1, clob1, field2 FROM table1; $stmt = OCIParse ($conn, $query); OCIExecute($stmt, OCI_DEFAULT); while( true ) { if( !OCIFetchInto($stmt, $arr, OCI_ASSOC|OCI_RETURN_LOBS) ) break; while( list($key,$val)=each($arr) ) { echo Key:.$key.\tVal:.$val.\n; } echo \n; } Actual result: -- Key: Val: yy Key: Val: yy Key: Val: yy Key: Val: yy -- Edit this bug report at http://bugs.php.net/?id=33383edit=1
#33383 [Opn-Fbk]: PHP crashes while retrieving data from Oracle
ID: 33383 Updated by: [EMAIL PROTECTED] Reported By: johnny at ouranous dot idv dot tw -Status: Open +Status: Feedback Bug Type: OCI8 related Operating System: Solaris 9 PHP Version: 5.0.4 Assigned To: tony2001 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with ?php and ends with ?, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. Previous Comments: [2005-10-04 08:54:10] johnny at ouranous dot idv dot tw oci8-beta still got crashed. And there was something I forgot to mention. My Oracle 9i is configured to use UTF8. [2005-09-17 01:00:01] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2005-09-09 08:28:53] [EMAIL PROTECTED] http://www.php.net/anoncvs.php (And please leave at Feedback until you can provide more information) [2005-09-09 05:07:50] johnny at ouranous dot idv dot tw Sorry, I'm having a business trip now, will not be able to test until October. And I have no experience of build php from CVS, where can I get information about it? [2005-09-08 11:51:36] [EMAIL PROTECTED] Please try OCI8 v.1.1, which is available in CVS HEAD and PECL (use `pear install oci8-beta` to install it). The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/33383 -- Edit this bug report at http://bugs.php.net/?id=33383edit=1
#33383 [Opn-Fbk]: PHP crashes while retrieving data from Oracle
ID: 33383 Updated by: [EMAIL PROTECTED] Reported By: johnny at ouranous dot idv dot tw -Status: Open +Status: Feedback Bug Type: OCI8 related Operating System: Solaris 9 PHP Version: 5.0.4 Assigned To: tony2001 New Comment: http://www.php.net/anoncvs.php (And please leave at Feedback until you can provide more information) Previous Comments: [2005-09-09 05:07:50] johnny at ouranous dot idv dot tw Sorry, I'm having a business trip now, will not be able to test until October. And I have no experience of build php from CVS, where can I get information about it? [2005-09-08 11:51:36] [EMAIL PROTECTED] Please try OCI8 v.1.1, which is available in CVS HEAD and PECL (use `pear install oci8-beta` to install it). [2005-06-20 11:39:06] johnny at ouranous dot idv dot tw http://snaps.php.net/php5-latest.tar.gz did not work, either. After some simple but stupid work by added some oci_debug in ext/oci8/oci8.c, I found the program crashed at line 2254: CALL_OCI_RETURN(connection-error, OCILobRead( connection-pServiceContext, connection-pError, mydescr-ocidescr, readlen, /* IN/OUT bytes toread/read */ siz + 1, /* offset (starts with 1) */ (dvoid *) ((char *) buf + siz), readlen, /* size of buffer */ (dvoid *)0, (OCICallbackLobRead) 0, /* callback... */ (ub2) connection-session-charsetId, /* The character set ID of the buffer data. */ (ub1) SQLCS_IMPLICIT /* The character set form of the buffer data. */ ) ); when readlen == 1 and whenever the real data store in lob field is ' ' or not. (I was mistake in previous post, there is a ' ' in the clob field) I tried add readlen++; before buf = emalloc(readlen + 1); and it works in all my test case but I don't know if this is the correctly way to solve it. [2005-06-19 21:36:26] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip [2005-06-19 17:30:59] johnny at gorilla dot com dot tw Configuration: CFLAGS=`getconf LFS_CFLAGS` ./configure --prefix=/usr/local/php5 --with-oci8=/data/oracle/OraHome1 --with-ncurses=/usr/local/lib --enable-mbstring=all --enable-debug $gdb /usr/local/php5/bin/php core GNU gdb 6.0 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 sparc-sun-solaris2.9... Core was generated by `/usr/local/php5/bin/php -q test.php'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/local/lib/libpanel.so.5...done. Loaded symbols for /usr/local/lib/libpanel.so.5 Reading symbols from /usr/local/lib/libncurses.so.5...done. Loaded symbols for /usr/local/lib/libncurses.so.5 Reading symbols from /usr/lib/libresolv.so.2...done. Loaded symbols for /usr/lib/libresolv.so.2 Reading symbols from /usr/lib/libm.so.1...done. Loaded symbols for /usr/lib/libm.so.1 Reading symbols from /usr/lib/libdl.so.1...done. Loaded symbols for /usr/lib/libdl.so.1 Reading symbols from /usr/lib/libnsl.so.1...done. Loaded symbols for /usr/lib/libnsl.so.1 Reading symbols from /usr/lib/libsocket.so.1...done. Loaded symbols for /usr/lib/libsocket.so.1 Reading symbols from /usr/lib/libz.so.1...done. Loaded symbols for /usr/lib/libz.so.1 Reading symbols from /usr/lib/libgen.so.1...done. Loaded symbols for /usr/lib/libgen.so.1 Reading symbols from /usr/lib/libsched.so.1...done. Loaded symbols for /usr/lib/libsched.so.1 Reading symbols from /data/oracle/OraHome1/lib32/libclntsh.so.9.0...done. Loaded symbols for /data/oracle/OraHome1/lib32/libclntsh.so.9.0 Reading symbols from /usr/local/lib/libxml2.so.2...done. Loaded symbols for
#33383 [Opn-Fbk]: PHP crashes while retrieving data from Oracle
ID: 33383 Updated by: [EMAIL PROTECTED] Reported By: johnny at gorilla dot com dot tw -Status: Open +Status: Feedback Bug Type: OCI8 related Operating System: Solaris 9 PHP Version: 5.0.4 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Previous Comments: [2005-06-19 17:30:59] johnny at gorilla dot com dot tw Configuration: CFLAGS=`getconf LFS_CFLAGS` ./configure --prefix=/usr/local/php5 --with-oci8=/data/oracle/OraHome1 --with-ncurses=/usr/local/lib --enable-mbstring=all --enable-debug $gdb /usr/local/php5/bin/php core GNU gdb 6.0 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 sparc-sun-solaris2.9... Core was generated by `/usr/local/php5/bin/php -q test.php'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/local/lib/libpanel.so.5...done. Loaded symbols for /usr/local/lib/libpanel.so.5 Reading symbols from /usr/local/lib/libncurses.so.5...done. Loaded symbols for /usr/local/lib/libncurses.so.5 Reading symbols from /usr/lib/libresolv.so.2...done. Loaded symbols for /usr/lib/libresolv.so.2 Reading symbols from /usr/lib/libm.so.1...done. Loaded symbols for /usr/lib/libm.so.1 Reading symbols from /usr/lib/libdl.so.1...done. Loaded symbols for /usr/lib/libdl.so.1 Reading symbols from /usr/lib/libnsl.so.1...done. Loaded symbols for /usr/lib/libnsl.so.1 Reading symbols from /usr/lib/libsocket.so.1...done. Loaded symbols for /usr/lib/libsocket.so.1 Reading symbols from /usr/lib/libz.so.1...done. Loaded symbols for /usr/lib/libz.so.1 Reading symbols from /usr/lib/libgen.so.1...done. Loaded symbols for /usr/lib/libgen.so.1 Reading symbols from /usr/lib/libsched.so.1...done. Loaded symbols for /usr/lib/libsched.so.1 Reading symbols from /data/oracle/OraHome1/lib32/libclntsh.so.9.0...done. Loaded symbols for /data/oracle/OraHome1/lib32/libclntsh.so.9.0 Reading symbols from /usr/local/lib/libxml2.so.2...done. Loaded symbols for /usr/local/lib/libxml2.so.2 Reading symbols from /usr/lib/libpthread.so.1...done. Loaded symbols for /usr/lib/libpthread.so.1 Reading symbols from /usr/local/lib/libiconv.so.2...done. Loaded symbols for /usr/local/lib/libiconv.so.2 ---Type return to continue, or q return to quit--- Reading symbols from /usr/lib/libc.so.1...done. Loaded symbols for /usr/lib/libc.so.1 Reading symbols from /usr/lib/libmp.so.2...done. Loaded symbols for /usr/lib/libmp.so.2 Reading symbols from /data/oracle/OraHome1/lib32/libwtc9.so...done. Loaded symbols for /data/oracle/OraHome1/lib32/libwtc9.so Reading symbols from /usr/lib/libaio.so.1...done. Loaded symbols for /usr/lib/libaio.so.1 Reading symbols from /usr/lib/librt.so.1...done. Loaded symbols for /usr/lib/librt.so.1 Reading symbols from /usr/local/lib/libgcc_s.so.1...done. Loaded symbols for /usr/local/lib/libgcc_s.so.1 Reading symbols from /usr/lib/libmd5.so.1...done. Loaded symbols for /usr/lib/libmd5.so.1 Reading symbols from /usr/platform/SUNW,Sun-Fire-V240/lib/libc_psr.so.1...done. Loaded symbols for /usr/platform/SUNW,Sun-Fire-V240/lib/libc_psr.so.1 Reading symbols from /usr/lib/libthread.so.1...done. Loaded symbols for /usr/lib/libthread.so.1 #0 0xfe924eb4 in ttci2u () from /data/oracle/OraHome1/lib32/libclntsh.so.9.0 (gdb) bt #0 0xfe924eb4 in ttci2u () from /data/oracle/OraHome1/lib32/libclntsh.so.9.0 #1 0xfe604060 in kpulbcr () from /data/oracle/OraHome1/lib32/libclntsh.so.9.0 #2 0xfe8f0ab0 in ttcdrv () from /data/oracle/OraHome1/lib32/libclntsh.so.9.0 (gdb) And I found one thing, everytime crashed, always because there is an empty value of clob fileds. But I don't know if this is caused by OCI itself, I'll try to write a small C program to test it tomorrow morning. [2005-06-17 13:08:25] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to Open. Thank you for helping us make PHP better. And please try fresh snapshot from http://snaps.php.net [2005-06-17 13:05:18] johnny at gorilla dot com dot tw Description: I think this bug is simular to Bug #6561 but in Solaris I've test 3 different version of php in CGI/CLI
#33383 [Opn-Fbk]: PHP crashes while retrieving data from Oracle
ID: 33383 Updated by: [EMAIL PROTECTED] Reported By: johnny at gorilla dot com dot tw -Status: Open +Status: Feedback Bug Type: OCI8 related Operating System: Solaris 9 PHP Version: 5.0.4 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to Open. Thank you for helping us make PHP better. And please try fresh snapshot from http://snaps.php.net Previous Comments: [2005-06-17 13:05:18] johnny at gorilla dot com dot tw Description: I think this bug is simular to Bug #6561 but in Solaris I've test 3 different version of php in CGI/CLI mode all happended. Here is my enviornment configuration: Sun V240(sparc) Solaris 9 gcc 3.4.2 Oracle 9.2.0.4 php 4.3.11 CFLAGS=`getconf LFS_CFLAGS` ./configure --prefix=/usr/local/php4 --with-oci8=/data/oracle/OraHome1 --with-ncurses=/usr/local/lib --enable-pcntl --with-readline=/usr/local/lib --enable-mbstring=all php 5.0.3 CFLAGS=`getconf LFS_CFLAGS` ./configure --prefix=/usr/local/php5 --with-oci8=/data/oracle/OraHome1 --with-ncurses=/usr/local/lib --enable-pcntl --with-readline=/usr/local/lib --enable-mbstring=all php 5.0.4 CFLAGS=`getconf LFS_CFLAGS` ./configure --prefix=/usr/local/php5 --with-oci8=/data/oracle/OraHome1 --with-ncurses=/usr/local/lib --enable-mbstring=all (cannot build with --enable-pcntl --with-readline=/usr/local/lib) modified 1. phpdir/configure 2. phpdir/ext/oci8/config.m4 OCI8_DIR/lib - OCI8_DIR/lib32 OCI8_DIR/rdbms/lib - OCI8_DIR/rdbms/lib32 CGI/CLI crashed (core dumped) at some CLOB field at ociFetchInto when ociFetchInto with OCI_RETURN_LOBS, and crashed at -load() when ociFetchInto without OCI_RETURN_LOBS, same code runs fine is PHP4/PHP5 on windows Reproduce code: --- Very hard to reproduce exactly. It happens while retrieving data from an Oracle 8 database. The same code works fine in Windows Environment. Expected result: $query = SELECT field1, clob1, field2 FROM table1; $stmt = OCIParse ($conn, $query); OCIExecute($stmt, OCI_DEFAULT); while( true ) { if( !OCIFetchInto($stmt, $arr, OCI_ASSOC|OCI_RETURN_LOBS) ) break; while( list($key,$val)=each($arr) ) { echo Key:.$key.\tVal:.$val.\n; } echo \n; } Actual result: -- Key: Val: yy Key: Val: yy Key: Val: yy Key: Val: yy -- Edit this bug report at http://bugs.php.net/?id=33383edit=1