php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44719 session_cache_expire() fails to allocate large amount of memory
Submitted: 2008-04-14 15:47 UTC Modified: 2008-04-15 00:39 UTC
From: antphill at uk dot ibm dot com Assigned:
Status: Closed Package: Session related
PHP Version: 6CVS-2008-04-14 (snap) OS: SUSE Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: antphill at uk dot ibm dot com
New email:
PHP Version: OS:

 

 [2008-04-14 15:47 UTC] antphill at uk dot ibm dot com
Description:
------------
When I call session_cache_expire() on Linux to get the current cache time (but not set it) I get this weird error message saying that a large amount of memory is being allocated. This does not reproduce on Windows but also appears on a separate Linux build server we have.

This scenario occurs with both unicode enabled and disabled.

=====================================================================
PHP         : /home/ant/php/php6.0/install/bin/php
PHP_SAPI    : cli
PHP_VERSION : 6.0.0-dev
ZEND_VERSION: 3.0.0-dev
PHP_OS      : Linux - Linux linux 2.6.16.21-0.8-default #1 Mon Jul 3 18:25:39 UTC 2006 i686
UNICODE     : OFF
INI actual  : /home/ant/php/php6.0/install/bin
More .INIs  :
CWD         : /home/ant/php/php6.0/install/bin
Extra dirs  :
VALGRIND    : Not used
=====================================================================
R

Reproduce code:
---------------
<?php
var_dump(session_cache_expire());
?>

Expected result:
----------------
int(180)


Actual result:
--------------
ant@linux:~/php/php6.0/install/bin> ./php  /mnt/hgfs/Projects/Session/php-6.0/Test.php

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 3067441245 bytes) in /mnt/hgfs/Projects/Session/php-6.0/Test.php on line 3


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-14 16:13 UTC] antphill at uk dot ibm dot com
This weirdness also seems to affect session_cache_expire():

--TEST--
Test session_cache_expire() function : variation
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php

ob_start();

/* 
 * Prototype : int session_cache_expire([int $new_cache_expire])
 * Description : Return current cache expire
 * Source code : ext/session/session.c 
 */

echo "*** Testing session_cache_expire() : variation ***\n";

ini_set("session.cache_expire", 360);
var_dump(session_cache_expire());
var_dump(session_cache_expire(999));
var_dump(session_cache_expire(180));
var_dump(session_start());
var_dump(session_cache_expire());
var_dump(session_destroy());
var_dump(session_cache_expire());

echo "Done";
ob_end_flush();
?>
--EXPECTF--
*** Testing session_cache_expire() : variation ***
int(360)
int(0)
int(999)
bool(true)
int(180)
bool(true)
int(0)
Done
 [2008-04-15 00:39 UTC] scottmac@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 14:01:34 2025 UTC