Ticket #248 (closed defect: duplicate)

Opened 3 years ago

Last modified 2 years ago

Memory leak with xcache with constant caching

Reported by: nijel Owned by: moo
Priority: major Milestone: 1.3.2
Component: cacher Version: 1.3.0
Keywords: Cc: Olaf van der Spek <olaf@…>
Blocked By: PHP Version:
Application: Need User Feedback: no
Other Exts: SAPI: Irrelevant
Probability: Blocking:

Description

xcache extension seems to cause memory leak under some conditions just by using opcode cache.

According to some valgrind logs, it looks like the leak is happening through zend_hash_copy, which is used only in few places, but I fail to see where leak could happen.

More information is available in Debian BTS:
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=577009

Adding original reporter to CC.

Change History

Changed 3 years ago by nijel

Also this seems to happen just with CGI build of PHP, not with CLI one.

Changed 3 years ago by moo

i'll keep track of this issue

but only malloc() would cause memory leak. most of php extension including use emalloc() all the time. it will be auto free by zend engine. exception is for some persistent data, malloc() is used carefully

cli is not supported. XCache disable itself for php cli

Changed 3 years ago by nijel

  • summary changed from Memory leak with xcache to Memory leak with xcache with constant caching

The problem seems to be caused by --enable-xcache-constant, so there is obviously problem in this part of code.

Changed 3 years ago by nijel

Also commenting out following line in xc_sandbox_free seems to "fix" the issue:

TG(zend_constants).pDestructor = NULL;

Changed 2 years ago by moo

  • status changed from new to closed
  • resolution set to duplicate

thanks for your feedback. this dup of #258 and was fixed

Note: See TracTickets for help on using tickets.