|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-01-31 18:38 UTC] giodev at panozzo dot it
Description:
------------
I'm running PHP 5.6.5 x64 nts on Windows Server 2012, 64bit, fastcgi.
When I execute odbc_exec from a table with ntext field, selecting the ntext field, PHP crashes my script with the following error:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate
1073741824 bytes) in C:\Users\username1\Desktop\odbc_exec_crash_test.php on line 16
The same problem persists with almost all previous versions available on the download site, both 32 and 64 bits, non-thread-safe:
php 5.6.5 i386 nts
php 5.5.21 x64 nts
php 5.4.37 i386 nts
Test script:
---------------
<?php
$dbloc_dsn_srv = "DRIVER={SQL Server Native Client 11.0};Server=MYSERVER\MYINSTANCE".
";ExtendedAnsiSQL=1;Database=mydb;UID=userweb1;PWD=pwdweb";
$cn = odbc_pconnect($dbloc_dsn_srv,"","")
or die("Error connecting to DB\n".odbc_errormsg());
print "PHP version ".phpversion()."\n";
$qry = "IF OBJECT_ID('test1', 'U') IS NOT NULL DROP TABLE test1";
$res = odbc_exec($cn,$qry) or die("Drop query error: $qry\n");
$qry = "CREATE TABLE test1 ( id integer not null, field ntext default '' not null, primary key(id))";
$res = odbc_exec($cn,$qry) or die("Query error: $qry\n");
$qry = "SELECT field from test1";
$res = odbc_exec($cn,$qry) or die("Query error: $qry\n");
while( $row = odbc_fetch_object($res) ) {
print $row->field."\n";
}
print "Done without errors\n";
?>
Expected result:
----------------
PHP version 5.6.5
Done without errors
Actual result:
--------------
PHP version 5.6.5
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1073741824 bytes) in C:\Users\username1\Desktop\odbc_exec_crash_test.php on line 16
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
The bug is still there in PHP-5.6.6 [16-Mar-2015 08:40:10] WARNING: [pool www] child 63955 said into stderr: "NOTICE: PHP message: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 4294967293 bytes) in /var/www/stpdn.ut.mephi.ru/root/main.php on line 950" # php --version PHP 5.6.6-2 (cli) (built: Feb 24 2015 10:07:30) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies