php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22649 odbc_connect FATAL: erealloc()
Submitted: 2003-03-11 22:17 UTC Modified: 2003-03-12 10:25 UTC
From: ottawasixtyseven at hotmail dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 4CVS-2003-03-11 (stable) OS: Windows
Private report: No CVE-ID: None
 [2003-03-11 22:17 UTC] ottawasixtyseven at hotmail dot com
I can't get our application running on the latest snapshot. I can run phpinfo() but when I try to use $DB  = odbc_connect ( 'database', '', '' ); and then try to create a table I get errors:

    echo "THE VALUE OF THE DB IS : $DB";
    
    $SQL = "CREATE TABLE $TableName ($TableColumns)";
    if ( !odbc_exec ( $DB, $SQL ) )
    {
      echo "FAILURE OF '$SQL' !<br>\n";
      $Errors++;
    }
    else
    {
      echo "OK! <br>\n";
    }
    
For the first echo statement above I get "Resource id #3"
When I try to create the table I get:
"FATAL: erealloc(): Unable to allocate 1331643757 bytes"

I have tried installing the latest snapshot on three separate servers. Two that were already running PHP 4.3 and one clean server.

Ottawa

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-12 07:38 UTC] ottawasixtyseven at hotmail dot com
My programmers said my description was note quite accurate. Here is the programmers version of our problem:

I can't get our application running on the latest snapshot. I can run phpinfo() but when I try to use
 $DB  = odbc_connect ( 'database', '', ''); and then try to create a table I get errors:

include('common.php'); // this include has
$DB = odbc_connect ('dsn' ,'', '');
i do an echo of $DB in common.php and get Resource id #3
then in the main script.
    echo "THE VALUE OF THE DB IS : $DB";
    
    $SQL = "CREATE TABLE $TableName ($TableColumns)";
    if ( !odbc_exec ( $DB, $SQL ) )
    {
      echo "FAILURE OF '$SQL' !<br>\n";
      $Errors++;
    }
    else
    {
      echo "OK! <br>\n";
    }
    
when i echo $DB again just before the odbc_exec I get:
"FATAL: erealloc(): Unable to allocate 1331643757 bytes"
I have tried installing the latest snapshot on three separate servers.

Two that were already running PHP 4.3 and one clean server.

this code works on all other versions of php except the latest snapshot.

Ottawa
 [2003-03-12 09:40 UTC] ottawasixtyseven at hotmail dot com
This is fixed in the latest 4.3 snapshot March 12 2003.

Thank you for the quick response.

Ottawa
 [2003-03-12 10:25 UTC] moriyoshi@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

FYI: The bug was caused by wrong pointer reference passed to spprintf() (patched by Ilia).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 03:01:30 2024 UTC