ID: 43082
Comment by: zvika at zend dot com
Reported By: php at danielknell dot co dot uk
Status: No Feedback
Bug Type: ODBC related
Operating System: fedora7
PHP Version: 5.2.4
New Comment:
Got this happening on Redhat5.4 64bit with Zend Server 4.0.6 PHP
5.2.11, unixODBC-2.2.11-7.1, mysql-connector-odbc-3.51.26r1127-1.el5
MySQL schema:
CREATE TABLE `test_null` (
`col1` char(5) default NULL,
`col2` char(20) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `test_null` VALUES ('AA','AA1'),('BB',NULL);
Ran a simple PHP script to select values using odbc_connect(DSN) +
odbc_exec(select)
Apache crashed on odbc_fetch_array() with core dump, I followed php.net
recommendation for debugging and here is the summary:
full backtrace up to first "execute" (frame 11)
(gdb) bt full
#0 0x00002b47dc9d246e in malloc_consolidate () from /lib64/libc.so.6
No symbol table info available.
#1 0x00002b47dc9d4a1a in _int_malloc () from /lib64/libc.so.6
No symbol table info available.
#2 0x00002b47dc9d6bee in malloc () from /lib64/libc.so.6
No symbol table info available.
#3 0x00002b47dca48094 in backtrace_symbols () from /lib64/libc.so.6
No symbol table info available.
#4 0x00002b47f716f24a in print_backtrace () at ZendExtUtil.c:57
array = {0x2b47f716f23a, 0x2b47f716f2d5, 0x2b47dc9922d0,
0x2b47dc9de06b, 0x2b47e7186608,
0x2b47f228ddfe, 0x2b47e71c0ce2, 0x2b47e71bfc5c, 0x2b47fcacb842,
0x2b47fd2ea879}
size = 10
strings = <value optimized out>
#5 0x00002b47f716f2d5 in segvwait () at ZendExtUtil.c:383
No locals.
#6 <signal handler called>
No symbol table info available.
#7 0x00002b47dc9de06b in memcpy () from /lib64/libc.so.6
No symbol table info available.
#8 0x00002b47e7186608 in _estrndup (s=0x2b47fdf1da20 "AA1",
length=<value optimized out>)
at /php-5.2.11/Zend/zend_alloc.c:2444
p = 0x2b47fdff1fe8 "\220?ס‎G+"
#9 0x00002b47f228ddfe in ?? () from
/usr/local/zend/lib/php_extensions/odbc.so
No symbol table info available.
#10 0x00002b47e71c0ce2 in zend_do_fcall_common_helper_SPEC
(execute_data=0x7fffb2d46fb0)
at /php-5.2.11/Zend/zend_vm_execute.h:200
return_reference = 0 '\0'
opline = (zend_op *) 0x2b47f89fbf60
original_return_value = <value optimized out>
current_scope = (zend_class_entry *) 0x0
current_this = (zval *) 0x0
return_value_used = 2097152
should_change_scope = 0 '\0'
#11 0x00002b47e71bfc5c in execute (op_array=0x2b47fdf1d228) at
/php-5.2.11/Zend/zend_vm_execute.h:92
execute_data = {opline = 0x2b47f89fbf60, function_state =
{function_symbol_table = 0x3,
function = 0x2b47f85a6d20, reserved = {0x2b47dac9cd15,
0x2b4700000001, 0x0, 0x23}}, fbc = 0x0,
op_array = 0x2b47fdf1d228, object = 0x0, Ts = 0x7fffb2d46f50, CVs =
0x7fffb2d46f20,
original_in_execution = 0 '\0', symbol_table = 0x2b47e7780308,
prev_execute_data = 0x0,
old_error_reporting = 0x0}
...
...
(gdb) frame 11
#11 0x00002b47e71bfc5c in execute (op_array=0x2b47fdf1d228) at
/php-5.2.11/Zend/zend_vm_execute.h:92
92 /php-5.2.11/Zend/zend_vm_execute.h: No such file or directory.
in /php-5.2.11/Zend/zend_vm_execute.h
(gdb) print (char
*)(executor_globals.function_state_ptr->function)->common.function_name
$1 = 0x2b47f228fba4 "odbc_fetch_array"
(gdb)
Is there anything I can run on the machine / Core dump to give you more
information?
Thanks
Zvika
Previous Comments:
------------------------------------------------------------------------
[2007-11-02 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".
------------------------------------------------------------------------
[2007-10-25 13:42:57] [email protected]
You need to compile PHP with --enable-debug set in your configure line
to get an useful backtrace.
------------------------------------------------------------------------
[2007-10-25 13:41:41] php at danielknell dot co dot uk
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912496243712 (LWP 7734)]
0x00000000005aa9da in _zend_hash_add_or_update ()
(gdb) bt
#0 0x00000000005aa9da in _zend_hash_add_or_update ()
#1 0x00002aaab139a6d7 in ?? () from /usr/lib64/php/modules/odbc.so
#2 0x00000000005cc792 in ?? ()
#3 0x00000000005bd94c in execute ()
#4 0x000000000059e6a3 in zend_execute_scripts ()
#5 0x000000000055eb78 in php_execute_script ()
#6 0x000000000061e966 in main ()
------------------------------------------------------------------------
[2007-10-25 13:24:11] [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 for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32
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.
------------------------------------------------------------------------
[2007-10-25 13:00:03] php at danielknell dot co dot uk
php -f ./test.php
Segmentation fault
<?php
$db = odbc_connect('test1', 'test', 'test');
$result = odbc_exec($db, 'select null;');
var_dump(odbc_fetch_array($result));
------------------------------------------------------------------------
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/43082
--
Edit this bug report at http://bugs.php.net/?id=43082&edit=1