php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9816 FATAL: emalloc(): Unable to allocate
Submitted: 2001-03-18 00:00 UTC Modified: 2001-05-14 12:00 UTC
From: shazlista at usa dot net Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0.5 OS: windows 2000 sp1
Private report: No CVE-ID: None
 [2001-03-18 00:00 UTC] shazlista at usa dot net
When I query a "Query" from access with only 2087 rows( each row is 210 bytes size), I get this error:

FATAL: emalloc(): Unable to allocate 2147483599 bytes 


please help!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-23 03:32 UTC] shazlista at usa dot net
win2000 sp1 php4.0.2 - 4.0.4pl1
<?
$a=odbc_connect("oh","","");
$r=odbc_prepare($a,"SELECT 'a' FROM xx"); 
odbc_execute($r);
odbc_free_result($r);
odbc_close($a);
?>

xx is a table whith 1 integer field and 1 row.
I try to select constant literal.
("select * from xx" works fine!!!)
I get FATAL: emalloc(): Unable to allocate 2147483599 bytes 
!!! all so 2147483599 bytes 


 [2001-04-01 20:40 UTC] kalowsky@php.net
A) Unable to reproduce locally on Win98SE, and MSAccess 
with 4.0.5RC4

B) which version of PHP are you using?  Bug report says 
4.0.4pl1, but your sample script suggests 4.0.2 - 
4.0.1pl1... which is it?
 [2001-04-03 07:50 UTC] shazlista at usa dot net
I am sorry but I have no coments on you ...
In all versions from 4.0.2 till 4.0.4pl1.
Only in win2000 with srvice pack 1 installed.
Only, not in 95,98,me,nt and win2000 with out service pack 1.
This script 
<?
$a=odbc_connect("oh","","");
$r=odbc_prepare($a,"SELECT 'a' FROM xx"); 
odbc_execute($r);
odbc_free_result($r);
odbc_close($a);
?>
where
xx is a table whith 1 integer field and 1 row.
and oh is odbc system dsn for ms access file with only one table (xx). 
I get FATAL: emalloc(): Unable to allocate 2147483599 bytes 

 [2001-04-16 22:54 UTC] kalowsky@php.net
Can someone with access to Windows2000 please test this out and either confirm or deny this report?  User reports this won't happen under Win98SE and that is currently all I have access to...
 [2001-04-27 08:32 UTC] kalowsky@php.net
Another user commented:

I just have read the bug-report 9816 at php.net and want to answer your email.
 
Yes, the users are right: I had the same problems with FATAL:emalloc() using the same odbc-queries to get information out of two ms access tables. The first table only contains Customer-ID and pasword, the second contains customer adress and a remark-field (data type memo)
 
Tests:
user authentication for login taken from table 1 -> OK
hello text for user from table 2 -> FATAL:emalloc()
 
Result of Test enviroment - after some nights of installation :-) :
 
1) Win2000, MS Access2000, IIS5 and PHP4.0.4 : FATAL:emalloc()
2) Win2000, MS Access2000 SP1, IIS5 and PHP4.0.4 : FATL:emalloc()
3) Win2000, MS Access2000 SP1, Apache 1.3 and PHP 4.0.4 : FATAL:emalloc()
 
4) Win NT 4, MS Access2000, IIS4 and PHP 4.0.4: OK, no errors
5) Win NT 4, MS Access2000, Apache 1.3 and PHP 4.0.4: OK, no errors
 
The next days I try to debug the source code to find out what the trigger of emalloc() realy is.  Our new Webserver should be a Win2000 Server with Apache and PHP.  Therefore we need to know where the emalloc() error comes from.
 
If you want know our results of debugging please send me an email to joerg.andreas@matrix-computer.com.
 [2001-04-29 22:49 UTC] shazlista at usa dot net
I got the same error when I tried (in numerous ways) to get the concatenation of two fields returned "AS" a new fieldname:

My example query:

SELECT BorrowerId, [FirstName] & [LastName] AS BName FROM Borrowers

causes:
FATAL: emalloc(): Unable to allocate 2147483599 bytes 

I tried '+', '|', and '&' as concatenation operators, tried CONCAT(a, b) -- I had heard that there was supposedly an internal odbc function called CONCAT that's supposed to be driver independent, though I'm not quite sure how that would work in practice -- and I even tried creating an Access "Query"/View/StoredProcedure called BorrowerNames using the query above. When I then issued a "SELECT * FROM BorrowerNames", I still got the error.

Environment:
Windows 2000 Server, SP1
PHP 4.0.4pl1 (CGI)
Access 97
using odbc_exec() to Access 97 database


 [2001-05-07 21:35 UTC] kalowsky@php.net
Please try the recently released 4.0.5 to see if this is
corrected for you.
 [2001-05-10 08:38 UTC] kalowsky@php.net
user reports (btw please use the bug system):

*sigh*...Still fails in 4.0.5...thanks just the same. Let me know if there's
anything else I can do...

tested on:

Windows 2000 Server, SP1
PHP4.0.5 CGI
IIS5
Access97, called using odbc_exec

query: "SELECT LastName & ', ' & FirstName AS pName FROM Borrowers"

error: FATAL:  emalloc():  Unable to allocate 2147483599 bytes
 [2001-05-11 14:54 UTC] shazlista at usa dot net
This is a microsoft ODBC issue with Windows 2000 SP1, when you query with concatenated fields it returns a size of 2GB.  Read more at: http://support.microsoft.com/support/kb/articles/Q272/9/51.ASP?LN=EN-US&SD=gn&FR=0&qry=SQLDescribeCol%20out%20of%20memory&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=MDAC

They haven't released a fix for it yet, It seems that you could check to see if it returned 2GB.  Do you think there is any chance of us getting a patch for this?
 [2001-05-14 12:00 UTC] kalowsky@php.net
as the user has discovered the problem is with the microsoft code, and not the PHP code.  
 [2002-12-15 17:03 UTC] rich at ednet dot co dot uk
I am seeing this problem.  I have a script that connects to an Access DB and then uses vtemplate to generate a page for the returns.  It works fine on w2k, IIS 5 (which is my development envirnoment) but when I try exactly the same script & database on IIS4 on NT4 I get

--
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


FATAL:  erealloc():  Unable to allocate 40 bytes
--

I would be v.gratefull if you could re-investigate this problem as it still seems to be an issue.

thanks,

Rick.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 00:01:32 2024 UTC