Issue Details (XML | Word | Printable)

Key: CORE-1836
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Marc Muncke
Votes: 2
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Firebird Core

crash in libfbclient.so.2 with php5-interbase client

Created: 14/Apr/08 02:41 PM   Updated: 16/Mar/10 03:10 AM
Component/s: Engine
Affects Version/s: 2.0.3
Fix Version/s: None

Environment: FreeBSD-7.0 Release in x86


 Description  « Hide
I run a webpage that uses firebird and it ran fine in freebsd 6.2
The webpage uses php and it works fine on php5.2.3 with firebird 2.0.1

FreeBSD 7.0 comes with php 5.2.5 and firebird 2.0.3_2 what I installed successfully on a new server but the scripts wont execute.
I can connect to the server using isql on localhost and with IBOConsole

The problem is when a php script contains "ibase_query" I recieve a segmentation fault in libfbclient.so.2
The problem has been traced like this :

---Type <return> to continue, or q <return> to quit---
Program received signal SIGSEGV, Segmentation fault.
0x28b5adff in ThreadData::restoreSpecific ()
   from /usr/local/lib/libfbclient.so.2
(gdb)
(gdb)
(gdb) bt
#0 0x28b5adff in ThreadData::restoreSpecific ()
   from /usr/local/lib/libfbclient.so.2
#1 0x28b6fd1f in error () from /usr/local/lib/libfbclient.so.2
#2 0x28b7733a in REM_attach_database () from
/usr/local/lib/libfbclient.so.2
#3 0x28b64b1b in isc_attach_database () from
/usr/local/lib/libfbclient.so.2
#4 0x28b2f411 in _php_ibase_attach_db ()
   from /usr/local/lib/php/20060613-debug/interbase.so
#5 0x28b2f845 in _php_ibase_connect ()
   from /usr/local/lib/php/20060613-debug/interbase.so
#6 0x289107a0 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfbfcc78)
    at /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_vm_execute.h:200
#7 0x28916299 in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0xbfbfcc78)
    at /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_vm_execute.h:1681
#8 0x289102f2 in execute (op_array=0x28c48168)
    at /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_vm_execute.h:92
#9 0x2891091a in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfbfd018)
    at /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_vm_execute.h:234
#10 0x2891143d in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0xbfbfd018)
    at /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_vm_execute.h:322
#11 0x289102f2 in execute (op_array=0x28c483cc)
    at /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_vm_execute.h:92
#12 0x2891091a in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfbfd398)
    at /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_vm_execute.h:234
---Type <return> to continue, or q <return> to quit---
#13 0x2891143d in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0xbfbfd398)
    at /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_vm_execute.h:322
#14 0x289102f2 in execute (op_array=0x28c32258)
    at /usr/ports/lang/php5/work/php-5.2.5/Zend/zend_vm_execute.h:92
#15 0x288ea902 in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
    at /usr/ports/lang/php5/work/php-5.2.5/Zend/zend.c:1215
#16 0x28896406 in php_execute_script (primary_file=0xbfbfe98c)
    at /usr/ports/lang/php5/work/php-5.2.5/main/main.c:2025
#17 0x289665b2 in php_handler (r=0x28cc3050)
    at
/usr/ports/lang/php5/work/php-5.2.5/sapi/apache2handler/sapi_apache2.c:635
#18 0x08074559 in ap_run_handler ()
#19 0x08077827 in ap_invoke_handler ()
#20 0x08082650 in ap_process_request ()
#21 0x0807f8eb in ap_process_http_connection ()
#22 0x0807b759 in ap_run_process_connection ()
#23 0x08086c97 in child_main ()
#24 0x08086f63 in make_child ()
#25 0x08087b11 in ap_mpm_run ()
#26 0x08061fe5 in main ()

you may download a php source from www.trackseller.com/phpbug.txt




 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Marc Muncke added a comment - 12/May/08 07:42 AM - edited
The problem can not be reproduced on a FreeBSD-6.2 release with php 5.2.6 and firebird 2.0.3_2 relase.
Bug was reported on FreeBSD-7.0-RELEASE and php 5.2.5

Anders Rehnvall added a comment - 16/Mar/10 03:10 AM
Same issue on fresh install:

FreeBSD 8.0-RELEASE, GENERIC amd64
PHP 5.2.12
Firebird Client&Server 2.0.3_2

Running CLI, single line PHP trying to connect to local db causes segfault:

(gdb) backtrace
#0 0x0000000803098bf9 in ThreadData::restoreSpecific ()
   from /usr/local/lib/libfbclient.so.2
#1 0x00000008030adc19 in error () from /usr/local/lib/libfbclient.so.2
#2 0x00000008030b5cfd in REM_attach_database ()
   from /usr/local/lib/libfbclient.so.2
#3 0x00000008030a351b in isc_attach_database ()
   from /usr/local/lib/libfbclient.so.2
#4 0x0000000802f65e02 in _php_ibase_attach_db ()
   from /usr/local/lib/php/20060613/interbase.so
#5 0x0000000802f6621a in _php_ibase_connect ()
   from /usr/local/lib/php/20060613/interbase.so
#6 0x0000000000538a62 in zend_do_fcall_common_helper_SPEC ()
#7 0x000000000052b093 in execute ()
#8 0x000000000050a6b3 in zend_execute_scripts ()
#9 0x00000000004c5daf in php_execute_script ()
#10 0x0000000000591222 in main ()

Please contact me if I can help debugging/reproduce (ar_firebird@exys.net)