php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40805 Failure executing function ibase_execute()
Submitted: 2007-03-14 18:06 UTC Modified: 2007-03-16 01:17 UTC
From: michael at bluemoon dot com Assigned:
Status: Closed Package: InterBase related
PHP Version: 5.2.1 OS: Red Hat Ent. Linux WS rel 4
Private report: No CVE-ID:
 [2007-03-14 18:06 UTC] michael at bluemoon dot com
Description:
------------
Script fails when it encounters ibase_execute() function; blank white screen is displayed.

No problem in PHP 5.2.0. Stopped working in 5.2.1.

No exception is thrown. No errors/warnings shown when running w/ error_reporting(E_ALL).

If I insert die('Hello, world!') immediately before line containing ibase_execute() statement, screen outputs "Hello, world!" If I insert same die() statement after ibase_execute(), I just get a blank screen.

Reproduce code:
---------------
Not possible to paste a discrete, reproducible snippet from my own codebase here, given the unique attributes of my database connection, but this is the gist of what I am trying to do:

$query = "UPDATE CUSTOMER SET FIELD2 = ?, FIELD3 = ? WHERE FIELD1 = 'A'";

// $trh is resource ID of current transaction
if ($result = ibase_prepare($trh, $query)) {
  if (ibase_execute($result, 'B', 'C')) echo "Operation Successful";
  else echo "Operation Failed";
}

Expected result:
----------------
"Operation Successful" or "Operation Failed"

Actual result:
--------------
<blank screen>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-14 18:11 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2007-03-15 02:52 UTC] michael at bluemoon dot com
Tried the latest CVS snapshot; same problem.
 [2007-03-15 13:00 UTC] tony2001@php.net
Check your Apache error_log.
 [2007-03-15 16:28 UTC] michael at bluemoon dot com
Checked Apache error_log. This is the entry that is logged at time of failure:

[Thu Mar 15 11:22:59 2007] [notice] child pid 29396 exit signal Segmentation fault (11)
 [2007-03-15 16:37 UTC] tony2001@php.net
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-03-15 21:32 UTC] michael at bluemoon dot com
For some reason, I can't seem to get a successful core dump.  Here is 
the backtrace though...

[root@test tmp]# gdb /usr/local/apache/sbin/httpd
GNU gdb Red Hat Linux (6.3.0.0-1.132.EL4rh)
Copyright 2004 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 "i386-redhat-linux-gnu"...Using host 
libthread_db lib
rary "/lib/tls/libthread_db.so.1".

(gdb) run -X
Starting program: /usr/local/apache/sbin/httpd -X
[Thread debugging using libthread_db enabled] 
[New Thread -1208407840 (LWP 19291)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208407840 (LWP 19291)]
0x0028676a in __strptime_internal () from /lib/tls/libc.so.6
(gdb) bt 
#0  0x0028676a in __strptime_internal () from /lib/tls/libc.so.6
#1  0x00285728 in strptime () from /lib/tls/libc.so.6
#2  0x00e3a22c in _php_ibase_bind (sqlda=0xb7a57734, 
b_vars=0xbfe9b4b4,
    buf=0xb7a6963c, ib_query=0xb7b28170) 
    at /home/lee/php5.2-200703142330/ext/interbase/ibase_query.c:691
#3  0x00e3aeb0 in _php_ibase_exec (ht=484, return_value=0xb7aadd34,
    return_value_ptr=0x0, this_ptr=0x0, return_value_used=1,
    ib_resultp=0xbfe9bc64, ib_query=0xb7b28170, args=0xbfe9b4b4) 
    at /home/lee/php5.2-200703142330/ext/interbase/ibase_query.c:947
#4  0x00e3d48b in zif_ibase_execute (ht=484, return_value=0xb7aadd34,
    return_value_ptr=0x0, this_ptr=0x0, return_value_used=1)
    at /home/lee/php5.2-200703142330/ext/interbase/ibase_query.c:1843 
#5  0x01053369 in zend_do_fcall_common_helper_SPEC 
(execute_data=0xbfea0910)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:200
#6  0x01057dc2 in ZEND_DO_FCALL_SPEC_CONST_HANDLER 
(execute_data=0xbfea0910) 
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:1681
#7  0x01052f7e in execute (op_array=0xb7ab61c8)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:92
#8  0x0105da80 in ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER ( 
    execute_data=0xbfea1e50)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:4597
#9  0x01052f7e in execute (op_array=0xb7bad424)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:92
#10 0x0105349e in zend_do_fcall_common_helper_SPEC 
(execute_data=0xbfea3200)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:234
#11 0x01053d7f in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(execute_data=0xbfea3200) 
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:322
#12 0x01052f7e in execute (op_array=0xb7be6684)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:92
#13 0x0105349e in zend_do_fcall_common_helper_SPEC 
(execute_data=0xbfea8df0) 
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:234
#14 0x01053d7f in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(execute_data=0xbfea8df0)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:322
#15 0x01052f7e in execute (op_array=0xb7ee1978) 
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:92
#16 0x01033c86 in zend_execute_scripts (type=8, retval=0x0, 
file_count=3)
    at /home/lee/php5.2-200703142330/Zend/zend.c:1134
#17 0x00fecf36 in php_execute_script (primary_file=0xbfeab0c0) 
    at /home/lee/php5.2-200703142330/main/main.c:1788
#18 0x0109926d in php_handler (r=0x8adc500)
    at /home/lee/php5.2-200703142330/sapi/apache2handler/
sapi_apache2.c:623
#19 0x08092d36 in ap_run_handler (r=0x8adc500) at config.c:151
#20 0x08093101 in ap_invoke_handler (r=0x8adc500) at config.c:363
#21 0x080828c1 in ap_process_request (r=0x8adc500) at http_request.c:
246
#22 0x0807e5d5 in ap_process_http_connection (c=0x8ad1fe8) at 
http_core.c:250 
#23 0x0809c1ae in ap_run_process_connection (c=0x8ad1fe8) at 
connection.c:42
#24 0x08091511 in child_main (child_num_arg=47) at prefork.c:609
#25 0x08091705 in make_child (s=0x8932fa0, slot=0) at prefork.c:649
#26 0x080917cc in startup_children (number_to_start=8) at prefork.c:
721
---Type <return> to continue, or q <return> to quit---
#27 0x08091e9f in ap_mpm_run (_pconf=0xbfeab400, plog=0x8966188, 
s=0xbfeab404) 
    at prefork.c:940
#28 0x08096f4f in main (argc=2, argv=0xbfeab5a4) at main.c:617
 [2007-03-15 21:38 UTC] tony2001@php.net
Please do the following after generating the backtrace (type these commands in GDB console):
f 2
p format
p t
p *t
p *b_var

And paste their output here. Thanks.
 [2007-03-15 22:10 UTC] michael at bluemoon dot com
Boy, you sure are making us work for this! :) Here you go...

[root@test tmp]# gdb /usr/local/apache/sbin/httpd
GNU gdb Red Hat Linux (6.3.0.0-1.132.EL4rh)
Copyright 2004 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 "i386-redhat-linux-gnu"...Using host 
libthread_db lib
rary "/lib/tls/libthread_db.so.1".

(gdb) run -X
Starting program: /usr/local/apache/sbin/httpd -X
[Thread debugging using libthread_db enabled] 
[New Thread -1208137504 (LWP 19391)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208137504 (LWP 19391)]
0x0028676a in __strptime_internal () from /lib/tls/libc.so.6
(gdb) bt 
#0  0x0028676a in __strptime_internal () from /lib/tls/libc.so.6
#1  0x00285728 in strptime () from /lib/tls/libc.so.6
#2  0x0108e22c in _php_ibase_bind (sqlda=0xb7a99734, 
b_vars=0xbfedb684,
    buf=0xb7aab63c, ib_query=0xb7b6a170) 
    at /home/lee/php5.2-200703142330/ext/interbase/ibase_query.c:691
#3  0x0108eeb0 in _php_ibase_exec (ht=484, return_value=0xb7aefd34,
    return_value_ptr=0x0, this_ptr=0x0, return_value_used=1,
    ib_resultp=0xbfedbe34, ib_query=0xb7b6a170, args=0xbfedb684) 
    at /home/lee/php5.2-200703142330/ext/interbase/ibase_query.c:947
#4  0x0109148b in zif_ibase_execute (ht=484, return_value=0xb7aefd34,
    return_value_ptr=0x0, this_ptr=0x0, return_value_used=1)
    at /home/lee/php5.2-200703142330/ext/interbase/ibase_query.c:1843 
#5  0x012a7369 in zend_do_fcall_common_helper_SPEC 
(execute_data=0xbfee0ae0)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:200
#6  0x012abdc2 in ZEND_DO_FCALL_SPEC_CONST_HANDLER 
(execute_data=0xbfee0ae0) 
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:1681
#7  0x012a6f7e in execute (op_array=0xb7af81c8)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:92
#8  0x012b1a80 in ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER ( 
    execute_data=0xbfee2020)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:4597
#9  0x012a6f7e in execute (op_array=0xb7bef424)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:92
#10 0x012a749e in zend_do_fcall_common_helper_SPEC 
(execute_data=0xbfee33d0)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:234
#11 0x012a7d7f in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(execute_data=0xbfee33d0) 
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:322
#12 0x012a6f7e in execute (op_array=0xb7c28684)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:92
#13 0x012a749e in zend_do_fcall_common_helper_SPEC 
(execute_data=0xbfee8fc0) 
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:234
#14 0x012a7d7f in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(execute_data=0xbfee8fc0)
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:322
#15 0x012a6f7e in execute (op_array=0xb7f23978) 
    at /home/lee/php5.2-200703142330/Zend/zend_vm_execute.h:92
#16 0x01287c86 in zend_execute_scripts (type=8, retval=0x0, 
file_count=3)
    at /home/lee/php5.2-200703142330/Zend/zend.c:1134
#17 0x01240f36 in php_execute_script (primary_file=0xbfeeb290) 
    at /home/lee/php5.2-200703142330/main/main.c:1788
#18 0x012ed26d in php_handler (r=0x969a4b8)
    at /home/lee/php5.2-200703142330/sapi/apache2handler/
sapi_apache2.c:623
#19 0x08092d36 in ap_run_handler (r=0x969a4b8) at config.c:151
#20 0x08093101 in ap_invoke_handler (r=0x969a4b8) at config.c:363
#21 0x080828c1 in ap_process_request (r=0x969a4b8) at http_request.c:
246
#22 0x0807e5d5 in ap_process_http_connection (c=0x968ffc0) at 
http_core.c:250 
#23 0x0809c1ae in ap_run_process_connection (c=0x968ffc0) at 
connection.c:42
#24 0x08091511 in child_main (child_num_arg=47) at prefork.c:609
#25 0x08091705 in make_child (s=0x94f0fa0, slot=0) at prefork.c:649
#26 0x080917cc in startup_children (number_to_start=8) at prefork.c:
721
#27 0x08091e9f in ap_mpm_run (_pconf=0xbfeeb5d0, plog=0x9524188, 
s=0xbfeeb5d4)
    at prefork.c:940
#28 0x08096f4f in main (argc=2, argv=0xbfeeb774) at main.c:617
(gdb) f 2
#2  0x0108e22c in _php_ibase_bind (sqlda=0xb7a99734, 
b_vars=0xbfedb684,
    buf=0xb7aab63c, ib_query=0xb7b6a170)
    at /home/lee/php5.2-200703142330/ext/interbase/ibase_query.c:691
691                                             if (!strptime
(Z_STRVAL_P(b_var), 
 format, t)) {
(gdb) p format
$1 = 0x13574bc "%Y-%m-%d %H:%M:%S"
(gdb) p t
$2 = (struct tm *) 0x0
(gdb) p *t
Cannot access memory at address 0x0
(gdb) p *b_var
$3 = {value = {lval = -1213666912, dval = 2.2742322573904564e-313, str 
= {
      val = 0xb7a8e9a0 "01/31/2099", len = 10}, ht = 0xb7a8e9a0, obj = 
{
      handle = 3081300384, handlers = 0xa}}, refcount = 1, type = 6 
'\006',
  is_ref = 0 '\0'} 
(gdb)
 [2007-03-15 22:34 UTC] tony2001@php.net
I can't test it myself, so please try the next snapshot (will be available in a couple of hours), the issue should be fixed there.
Thanks.
 [2007-03-16 01:17 UTC] michael at bluemoon dot com
Thank you so much!  The problem does now appear to be fixed.  We really 
appreciate your diligence in pursuing this issue on our behalf.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 05:03:21 2014 UTC