php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58145 BBCode extension crashes apache
Submitted: 2008-04-05 12:37 UTC Modified: 2008-08-17 08:51 UTC
From: soulhunter1987 at post dot ru Assigned:
Status: Closed Package: bbcode (PECL)
PHP Version: 5.2.5 OS: Gentoo Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: soulhunter1987 at post dot ru
New email:
PHP Version: OS:

 

 [2008-04-05 12:37 UTC] soulhunter1987 at post dot ru
Description:
------------
On my highloaded server bbcode extension behaves very unstable. Two types of errors occur very often on the same page when i simply reload it:

1) I get "502 bag Gateway" from nginx, that means that apache process craches. And in apache error_log appears a new line:
[Sat Apr 05 20:53:52 2008] [notice] child pid 14943 exit signal Segmentation fault (11)

2) I get "Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2843012053 bytes) in XXX on line XXX" on a random place where i use bbcode_parse();... Only when i set memory_limit to 1Gb the problem doesn't appear. But there is one very strange moment here: when i use memory_get_peak_usage at the end of the script - it returns always just 1Mb, and never more!

And some times the page loads as expexted.

And that's all, nothing more in any logs...

I thought that xcache might cause this problems, but when i turned it off nothing changed.

Looks like the problem is in callbacks because when i don't use them i my bbcode stack - everything is perfect.

Reproduce code:
---------------
My php Configure Command: './configure' '--prefix=/usr/lib/php5' '--host=i686-pc-linux-gnu' '--mandir=/usr/lib/php5/man' '--infodir=/usr/lib/php5/info' '--sysconfdir=/etc' '--cache-file=./config.cache' '--disable-cli' '--with-apxs2=/usr/sbin/apxs2' '--with-config-file-path=/etc/php/apache2-php5' '--with-config-file-scan-dir=/etc/php/apache2-php5/ext-active' '--without-pear' '--enable-bcmath' '--with-bz2' '--disable-calendar' '--with-curl' '--with-curlwrappers' '--disable-dbase' '--enable-exif' '--without-fbsql' '--without-fdftk' '--enable-ftp' '--with-gettext' '--without-gmp' '--disable-ipv6' '--without-kerberos' '--enable-mbstring' '--with-mcrypt' '--with-mhash' '--without-msql' '--without-mssql' '--without-ncurses' '--with-openssl' '--with-openssl-dir=/usr' '--enable-pcntl' '--disable-pdo' '--without-pgsql' '--without-pspell' '--without-recode' '--disable-reflection' '--enable-shmop' '--with-snmp' '--enable-soap' '--enable-sockets' '--disable-spl' '--without-sybase' '--without-sybase-ct' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--without-tidy' '--disable-tokenizer' '--disable-wddx' '--with-xmlrpc' '--with-xsl' '--enable-zip' '--with-zlib' '--disable-debug' '--enable-dba' '--without-cdb' '--with-db4' '--without-flatfile' '--without-gdbm' '--without-inifile' '--without-qdbm' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--disable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--without-xpm-dir' '--with-gd' '--with-imap' '--with-imap-ssl' '--with-mysql=/usr' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-readline' '--without-libedit' '--with-mm' '--without-sqlite'

reproduce code of the class is here: http://video.interzet.ru/bbclass.php


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-11 03:23 UTC] xdecock at gmail dot com
It seems that i forgot to reference decrement the object given as callback (or make a bad usage of callback)

I'll need to add a ressource release callback to the mail library :)

I'll do it asap

thanks for the bug report :)
 [2008-05-25 17:59 UTC] soulhunter1988 at post dot ru
When can we wait for a bugfix? I'm just waiting for it to begin using this extension...
 [2008-08-17 08:51 UTC] xdecock at gmail dot com
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/bbcode


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 06:01:27 2025 UTC