|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79310 ibase_fetch_* makes server crashes because of out of memory
Submitted: 2020-02-26 22:18 UTC Modified: 2021-03-31 11:42 UTC
From: nicolasv dot poubelle at gmail dot com Assigned:
Status: Suspended Package: InterBase related
PHP Version: 7.3.15 OS: debian 10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: nicolasv dot poubelle at gmail dot com
New email:
PHP Version: OS:


 [2020-02-26 22:18 UTC] nicolasv dot poubelle at gmail dot com
Hello everyone,

We have an old PHP application we want to upgrade from PHP 5.6 to PHP 7.3. 
The database is managed by a Firebird server.

We found a weird behaviour with PHP Interbase extension (PHP 7.3.15), and before qualify it as a bug, I wanted to know if other people had the same issue.

- ibase_connect to database
- create an array of ~200 queries (with INNER JOIN on some big tables)
- make a call to ibase_query
- make a call to ibase_fetch_* (no need to fetch all rows)

If you take care about the Firebird server memory usage, it will increase by ~5MB for each queries, without releasing memory. 

But if you make a call to ibase_free_result just after the call of ibase_fetch, memory is released on *server* side.

I tried to search in source code, problem seems to be about the call of isc_dsql_fetch, but I can't find any relevant difference between 5.6 source code and 7.3.

Thanks by advance!

Test script:

$arr = array(/* queries on our firebird server */);
foreach ($arr as $query)
   $res = ibase_query($query);

   //if you make a call at ibase_free_result($res), memory on firebird server is released 

Expected result:
With PHP 5.6, the call of ibase_free_result isn't needed (memory usage is stable).

Actual result:
Memory usage on firebird server increases until server crashes:

In firebird.log :
SERVER/process_packet: out of memory
fbserver.exe: terminated abnormally (3221225477)

In PHP script :
Error reading data from the connection


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-02-26 22:21 UTC] nicolasv dot poubelle at gmail dot com
-: nicolas dot vannier at dunordausud dot fr +: nicolasv dot poubelle at gmail dot com
 [2020-02-26 22:21 UTC] nicolasv dot poubelle at gmail dot com
 [2021-03-31 11:42 UTC]
-Status: Open +Status: Suspended
 [2021-03-31 11:42 UTC]
The interbase extension is moved to PECL[1] as of PHP 7.4.0, and
is looking for a new maintainer.  Until a new maintainer is found,
I suspend this ticket.

Consider to use the bundled PDO_Firebird extension, or the
php-firebird package[2] instead.

[1] <>
[2] <>
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon May 16 08:05:44 2022 UTC