Bug #71305 [Com]: Crash when optional resource is omitted

From: Date: Mon, 11 Jan 2016 21:24:24 +0000
Subject: Bug #71305 [Com]: Crash when optional resource is omitted
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198583@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71305&edit=1

 ID:                 71305
 Comment by:         mikedeweese at hotmail dot com
 Reported by:        mikedeweese at hotmail dot com
 Summary:            Crash when optional resource is omitted
 Status:             Feedback
 Type:               Bug
 Package:            InterBase related
 Operating System:   Windows 10 x64
 PHP Version:        7.0.2
 Block user comment: N
 Private report:     N

 New Comment:

It is closer to working like it used to.

This now works

$db = ibase_connect("172.16.2.1:POEM_DEV", 'sysdba', 'masterkey');
$t = ibase_trans();  // This line crashes in the 7.0.2
$q = ibase_query($t, "SELECT FUSERID, FEMPNO FROM UTUSERS WHERE FUSERID =
'MJD'");
$r = ibase_fetch_object($q);
print_r($r);


but this still crashes

$db = ibase_connect("172.16.2.1:TESTDB", 'sysdba', 'masterkey');
$q = ibase_query("SELECT * FROM UTUSERS WHERE FUSERID = 'MJD'");
print "at end";


Previous Comments:
------------------------------------------------------------------------
[2016-01-11 15:51:02] ab@php.net

@mikedeweese please test the current development 7.0 branch. Several fixes was applied. Please fetch
this http://windows.php.net/downloads/snaps/php-7.0/rb188caf/
or any later snapshot.

Thanks.

------------------------------------------------------------------------
[2016-01-08 03:12:56] laruence@php.net

interbase is know broken in somehow. :<

please read: https://marc.info/?l=php-internals&m=145077389117375&w=2

------------------------------------------------------------------------
[2016-01-07 18:04:25] mikedeweese at hotmail dot com

Description:
------------
Calling ibase_query without a database link identifier crashes PHP.

In PHP5 and according to the manual, if omitted, the last opened link is assumed.  

functions ibase_trans and ibase_prepare also take an optional database link id and will also crash
if one is not given in php7.



Test script:
---------------
$db = ibase_connect("172.16.2.1:TESTDB", 'sysdba', 'masterkey');
$q = ibase_query("SELECT * FROM UTUSERS WHERE FUSERID = 'MJD'");
print "ok";

Expected result:
----------------
ok should print to the screen

Actual result:
--------------
A windows dialog with php icon. "CLI has stopped working.  A problem caused the program to stop
working correctly.  Please close the program."

If I put $db as the first param, there is no crash and ok prints as expected.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=71305&edit=1


Thread (8 messages)

« previous php.bugs (#198583) next »