php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12634 Segfaults due to possible memory leak??
Submitted: 2001-08-07 17:13 UTC Modified: 2002-01-02 14:00 UTC
From: katz at advanced dot org Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.0.6 OS: Linux 2.4
Private report: No CVE-ID: None
 [2001-08-07 17:13 UTC] katz at advanced dot org
Under 4.0.6, my apache processes start segfaulting with 
the following problem after running (stable) for a period 
of time:
   
    [Tue Aug  7 16:53:30 2001] [notice] child pid 7139 
exit signal Segmentation fault (11)


Once this starts happening, it continues until i kill and 
restart the server.  It will then run fine for some time, 
then happen again.  The period of time that it runs stable 
decreases as hits increase .. 

Running with --enable-debug I get the following in the 
apache error log (I had issues generating a gdb backtrace, 
but if needed I can attempt again):

/usr/www/thinkquest/common/nav_menu.inc(330) : Fatal error 
- Allowed memory size of 12582912 bytes exhausted at 
../../Zend/zend_opcode.c:48 (tried to allocate 184320 
bytes)
/usr/www/thinkquest/common/scripts.inc(3062) : Fatal error 
- Allowed memory size of 12582912 bytes exhausted at 
../../Zend/zend_opcode.c:48 (tried to allocate 11520 bytes)
[Tue Aug  7 16:53:23 2001]  Script:  
'/usr/www/thinkquest/index.html'
---------------------------------------
../../Zend/zend_opcode.c(172) : Block 0x08138E90 status:
Beginning:      Overrun (magic=0x401E8080, 
expected=0x7312F8DC)
      End:      Unknown
---------------------------------------
/usr/www/thinkquest/common/nav_menu.inc(330) : Fatal error 
- Allowed memory size of 12582912 bytes exhausted at 
../../Zend/zend_opcode.c:48 (tried to allocate 184320 
bytes)
/usr/www/thinkquest/common/scripts.inc(1870) : Fatal error 
- Allowed memory size of 12582912 bytes exhausted at 
../../Zend/zend_opcode.c:48 (tried to allocate 184320 
bytes)

... and similar, over and over again.. however the script 
that it occurs in, and the line, are always different..   
I tried increasing the amount of memory allowed per 
script, but it just uses all that up too.. 

As a note... everything runs fine under 4.0.5 .... 

I have cvs updates up to July 20.. The configuration 
parameters I used are:

"../configure" \
"--prefix=/usr" \
"--with-apxs=/usr/bin/apxs" \
"--with-regex=system" \
"--with-config-file-path=/etc/php4/apache" \
"--disable-rpath" \
"--enable-debug" \
"--enable-memory-limit" \
"--enable-calendar" \
"--enable-sysvsem" \
"--enable-sysvshm" \
"--enable-track-vars" \
"--enable-trans-sid" \
"--enable-bcmath" \
"--with-bz2" \
"--enable-ctype" \
"--with-db2" \
"--with-ndbm" \
"--with-ldap=/usr" \
"--with-oci8=/usr/oracle/product/8.1.6" \
"--enable-sigchild" \
"--enable-exif" \
"--enable-filepro" \
"--enable-ftp" \
"--with-gettext" \
"--enable-mbstring" \
"--enable-mbstr-enc-trans" \
"--with-pcre-regex=/usr" \
"--enable-shmop" \
"--enable-sockets" \
"--enable-wddx" \
"--with-xml=/usr" \
"--with-expat-dir=/usr" \
"--enable-yp" \
"--with-zlib" \
"--without-pgsql" \
"--disable-static" \
"--with-layout=GNU" \
"--with-curl=shared,/usr" \
"--with-dom=shared,/usr" \
"--with-gd=shared,/usr" \
"--with-jpeg-dir=shared,/usr" \
"--with-xpm-dir=shared,/usr/X11R6" \
"--with-png-dir=shared,/usr" \
"--with-freetype-dir=shared,/usr" \
"--with-imap=shared,/usr" \
"--with-mcal=shared,/usr" \
"--with-mhash=shared,/usr" \
"--with-mysql=shared,/usr" \
"--with-sablot=shared,/usr" \
"--with-snmp=shared" \
"--with-sybase-ct=shared,/usr" \
"--with-ttf=shared,/usr" \
"--with-t1lib=shared,/usr"

The extension order i use is:

gd.so
imap.so
mhash.so
domxml.so
mysql.so
curl.so

( I tried removing domxml, mhash and curl and the problems 
were still there ) ... 

Also to throw in, I have OCI8 configured with Oracle 8.1.6 
(as seen above) .. linked with pthreads and using Apache 
1.3.20...

Any more info if needed can be provided.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-19 05:05 UTC] sniper@php.net
Does this happen with specific script?

 [2001-08-19 21:36 UTC] katz at advanced dot org
No, it appears to be almost random.... The script names (and line numbers) that appear in the logs are always different.

I was able to force the problem for any script by using the apache benchmark utility (ab) and blasting a script with generated hits .. when doing this the seg faults start almost immediately (and again for any php script i point it at).. if this helps....
 [2001-08-19 21:40 UTC] katz at advanced dot org
Also .. keep in mind my stuff uses OCI-8 (with oracle 8.1.6), so that may be linked (since no one else has reported this problem)....  ??
 [2001-10-03 14:21 UTC] katz at advanced dot org
As a follow-up on this bug report .. Just today I installed a recent cvs version (called "4.0.7RC2" in the Debian unstable distribution)... 

So far the system has been running almost an entire day without a problem .. I noticed in the change log that there were some LDAP memory leak fixes ... that may have been the problem as our site also relies heavily upon ldap .. 

So far .. So good.

 [2001-12-12 04:08 UTC] yohgaki@php.net
Do you still have problems with 4.1.0?
Is it ok to be closed?
 [2001-12-12 04:13 UTC] yohgaki@php.net
Status = Feedback
 [2002-01-02 14:00 UTC] lobbin@php.net
No feedback. Closing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC