php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17040 ibase_close() crashes PHP when there is some open blobs
Submitted: 2002-05-06 08:50 UTC Modified: 2002-05-14 14:36 UTC
From: flying at dom dot natm dot ru Assigned:
Status: Closed Package: InterBase related
PHP Version: 4.2.0 OS: Windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: flying at dom dot natm dot ru
New email:
PHP Version: OS:

 

 [2002-05-06 08:50 UTC] flying at dom dot natm dot ru
 This bug is similar to already resolved bugs 14558 and 15419, but problem is still persists when there is available some code to work with BLOBs. 

 Here is example:

CREATE TABLE TEST_TABLE (
    ID INTEGER NOT NULL,
    STR_CONTENT VARCHAR(100),
    BLOB_CONTENT BLOB SUB_TYPE 1 SEGMENT SIZE 80
);

$db = ibase_connect($database,$user,$password);

$result = ibase_query($db,'select * from test_table');
while($row = ibase_fetch_row($result))
{
    $info = ibase_blob_info($row[2]);
    $data = '';
    $blob = ibase_blob_open($bid);
    for($i=0;$i<$info[1];$i++)
        $data .= ibase_blob_get($blob,$info[2]);
    ibase_blob_close($blob);
    echo $data;
};
ibase_free_result($result);

ibase_close();

 This code works fine, but if i remove ibase_blob_close() function call (and therefore leave BLOB open) - PHP will crash on calling ibase_close().

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-06 08:51 UTC] mfischer@php.net
To properly diagnose this bug, 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".
 [2002-05-06 09:00 UTC] flying at dom dot natm dot ru
Unfortunatelly i don't compile PHP by myself (i use windows binaries of PHP, downloaded from www.php.net). And i have no access to unix box. So i'm unable to create backtrace, you asking me for.
 [2002-05-07 03:53 UTC] daniela@php.net
ok....I can reproduced it
assigned to me
 [2002-05-14 14:02 UTC] daniela@php.net
Fixed both in CVS and release.
Now, if you don't explicitly close blobs before ibase_close() you 'll receive an error.
Always call ibase_blob_close() after reading or writing it to not lose data.

Documentation still lacking .... :(


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 17:01:31 2024 UTC