php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73729 out of memory while doing session_start(session handler memcache)
Submitted: 2016-12-13 06:49 UTC Modified: 2021-03-25 16:46 UTC
Votes:9
Avg. Score:4.7 ± 0.7
Reproduced:9 of 9 (100.0%)
Same Version:5 (55.6%)
Same OS:4 (44.4%)
From: mahesh dot patade at network18tech dot com Assigned: cmb (profile)
Status: Closed Package: memcache (PECL)
PHP Version: 7.0.14 OS: CentOS 6.5
Private report: No CVE-ID: None
 [2016-12-13 06:49 UTC] mahesh dot patade at network18tech dot com
Description:
------------
PHP Version details:

php-7.0.14-1.el6.remi.x86_64
php-cli-7.0.14-1.el6.remi.x86_64
php-common-7.0.14-1.el6.remi.x86_64
php-devel-7.0.14-1.el6.remi.x86_64
php-gd-7.0.14-1.el6.remi.x86_64
php-imap-7.0.14-1.el6.remi.x86_64
php-json-7.0.14-1.el6.remi.x86_64
php-mbstring-7.0.14-1.el6.remi.x86_64
php-mcrypt-7.0.14-1.el6.remi.x86_64
php-mysqlnd-7.0.14-1.el6.remi.x86_64
php-odbc-7.0.14-1.el6.remi.x86_64
php-pdo-7.0.14-1.el6.remi.x86_64
php-pear-1.10.1-8.el6.remi.noarch
php-pear-Auth-SASL-1.0.6-1.el6.remi.noarch
php-pear-Mail-1.3.0-1.el6.remi.noarch
php-pear-Net-SMTP-1.7.2-1.el6.remi.noarch
php-pear-Net-Socket-1.0.14-1.el6.remi.noarch
php-pecl-apcu-5.1.7-1.el6.remi.7.0.x86_64
php-pecl-apcu-bc-1.0.3-1.el6.remi.7.0.x86_64
php-pecl-igbinary-2.0.0-1.el6.remi.7.0.x86_64
php-pecl-mailparse-3.0.2-1.el6.remi.7.0.x86_64
php-pecl-memcache-3.0.9-0.7.20161124gitdf7735e.el6.remi.7.0.x86_64
php-pecl-msgpack-2.0.2-1.el6.remi.7.0.x86_64
php-pecl-redis-3.0.0-1.el6.remi.7.0.x86_64
php-pecl-zip-1.13.5-1.el6.remi.7.0.x86_64
php-process-7.0.14-1.el6.remi.x86_64
php-soap-7.0.14-1.el6.remi.x86_64
php-xml-7.0.14-1.el6.remi.x86_64
php-xmlrpc-7.0.14-1.el6.remi.x86_64

List of modules:
apc
apcu
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
igbinary
imap
json
libxml
mailparse
mbstring
mcrypt
memcache
msgpack
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

PHP.INI
session.save_handler = memcache
session.save_path = "tcp://172.29.31.11:11211,tcp://172.29.31.15:11211,tcp://172.29.31.16:11211,tcp://172.29.31.17:11211,tcp://172.29.31.18:11211,tcp://172.29.31.19:11211,tcp://172.29.31.20:11211,tcp://172.29.31.111:11211,tcp://172.29.31.112:11211,tcp://172.29.31.113:11211,tcp://172.29.31.114:11211,tcp://172.29.31.115:11211,tcp://172.29.31.116:11211,tcp://172.29.31.117:11211,tcp://172.29.31.118:11211,tcp://172.29.31.119:11211,tcp://172.29.31.120:11211,tcp://172.29.31.121:11211"

Test script:
---------------
While setting simple session we are getting 500 with below error.
<?php session_start(); ?>


PHP Fatal error:  Out of memory (allocated 2097152) (tried to allocate 18446744073709551612 bytes) in


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-15 12:31 UTC] dl at europaymentgroup dot com
I think this is the same as https://bugs.php.net/bug.php?id=73539
 [2016-12-15 13:35 UTC] mahesh dot patade at network18tech dot com
PHP version is diffrent.
 [2017-01-12 13:07 UTC] angel dot moreno at urv dot cat
We had the same behavior after applying the latest updates of some php7* packages on Ubuntu 16.04. Meanwhile, our solution has been changing the method for managing sessions (session.save_handler).

Updates were:
(from 7.0.8-0ubuntu0.16.04.3 to 7.0.13-0ubuntu0.16.04.1)

php7.0-cli: amd64 (7.0.8-0ubuntu0.16.04.3, 7.0.13-0ubuntu0.16.04.1)
php7.0-gd: amd64 (7.0.8-0ubuntu0.16.04.3, 7.0.13-0ubuntu0.16.04.1)
php7.0-opcache: amd64 (7.0.8-0ubuntu0.16.04.3, 7.0.13-0ubuntu0.16.04.1)
php7.0-common: amd64 (7.0.8-0ubuntu0.16.04.3, 7.0.13-0ubuntu0.16.04.1)
php7.0-json: amd64 (7.0.8-0ubuntu0.16.04.3, 7.0.13-0ubuntu0.16.04.1)
php7.0-mbstring: amd64 (7.0.8-0ubuntu0.16.04.3, 7.0.13-0ubuntu0.16.04.1)
php7.0-readline: amd64 (7.0.8-0ubuntu0.16.04.3, 7.0.13-0ubuntu0.16.04.1)
php7.0-xml: amd64 (7.0.8-0ubuntu0.16.04.3, 7.0.13-0ubuntu0.16.04.1)
php7.0-curl: amd64 (7.0.8-0ubuntu0.16.04.3, 7.0.13-0ubuntu0.16.04.1)
php7.0-zip: amd64 (7.0.8-0ubuntu0.16.04.3, 7.0.13-0ubuntu0.16.04.1)
php7.0-mcrypt: amd64 (7.0.8-0ubuntu0.16.04.3, 7.0.13-0ubuntu0.16.04.1)
libapache2-mod-php7.0: amd64 (7.0.8-0ubuntu0.16.04.3, 7.0.13-0ubuntu0.16.04.1)
php7.0-mysql: amd64 (7.0.8-0ubuntu0.16.04.3, 7.0.13-0ubuntu0.16.04.1)

PHP version:

  7.0.13-0ubuntu0.16.04.1 PHP (cli) (NTS)
  Copyright (c) 1997-2016 The PHP Group
  Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
      OPcache v7.0.13-0ubuntu0.16.04.1 with Zend, Copyright (c) 1999-2016, by Zend Technologies

Information of memcache module (cut from php -i):

  Memcache

  Memcache support => enabled
  Version => 3.0.9-dev
  Revision => $ Revision $

  Directive => Local Value => Master Value
  memcache.allow_failover => 1 => 1
  memcache.chunk_size => = 32768> 32768
  memcache.compress_threshold => = 20000> 20000
  memcache.default_port => = 11211> 11211
  memcache.hash_function => CRC32 => CRC32
  memcache.hash_strategy => consistent => consistent
  memcache.lock_timeout => 15 => 15
  memcache.max_failover_attempts => 20 => 20
  memcache.protocol => ascii => ascii
  memcache.redundancy => 1 => 1
  memcache.session_redundancy => 2 => 2

In Apache's error log we have messages like:

[Thu Jan 12 13:29:59.444784 2017] [:error] [pid 23281] [client xxxx:53788] PHP Fatal error: Out of memory (allocated 2097152) (tried to Allocate 18446744073709551612 bytes) in /x/x/x/lib/vendor/zf1/zend-session/library/Zend/Session.php on line 482

Line 482 contains a session_start().
 [2021-03-25 16:46 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-03-25 16:46 UTC] cmb@php.net
The official bug tracker for PECL/memcache is now at
<https://github.com/websupport-sk/pecl-memcache/issues>.

So, if this is still an issue with either of the current memcache
versions (4 or 8), please file an issue there.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 02:01:29 2024 UTC