|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53426 Segmentation fault
Submitted: 2010-11-30 12:11 UTC Modified: 2010-12-03 12:51 UTC
From: dr4k0n at list dot ru Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.3.3 OS: Gentoo Linux 2.6.34-xenU-fly
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
48 - 17 = ?
Subscribe to this entry?

 [2010-11-30 12:11 UTC] dr4k0n at list dot ru
Everytime I start my script, I see segmentation fault (on my 32bit PHP version). On equivalent 64 bit system segmentation fault not appear.

I execute command:
$ export USE_ZEND_ALLOC=0 
$ valgrind --tool=memcheck --num-callers=30 --log-file=/var/www/ /usr/bin/php -f /var/www/ parsers update_actions
It looks like error on PCRE module.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-30 12:21 UTC]
-Status: Open +Status: Feedback
 [2010-11-30 12:21 UTC]
Please try with 5.3.4RC1.

It also looks like a mysql bug, not pcre. If the crash still occurs using 5.3.4RC1, please try using Mysqlnd instead of libmysql. (see configure --help for the options).
 [2010-11-30 12:26 UTC] dr4k0n at list dot ru
-Status: Feedback +Status: Open
 [2010-11-30 12:26 UTC] dr4k0n at list dot ru
I saw same segfault in PHP 5.2.14, so I update PHP to version 5.3.3-r1.
PHP 5.3.4 not exists in Gentoo portage repositary.
 [2010-11-30 12:30 UTC]
-Status: Open +Status: Feedback
 [2010-11-30 12:30 UTC]
Try with mysqlnd then. You can compile PHP in your home to try your script. That won't affect your system install.
 [2010-11-30 12:31 UTC]
And we still need a way to actually reproduce this crash, like a small script.
 [2010-11-30 12:32 UTC]
And please don't use distribution packages but build our sources. Gentoo and others apply patches we don't know and have no control over.
 [2010-12-01 00:46 UTC] dr4k0n at list dot ru
-Status: Feedback +Status: Open
 [2010-12-01 00:46 UTC] dr4k0n at list dot ru
I tried PHP 5.3.3 with enables mysqlnd and I disable all mysql connections... Not works: again segfault.
I tried PHP 5.3.4RC1: and again segfault. Report:
 [2010-12-02 08:47 UTC] dr4k0n at list dot ru
So, what about problem? It's really error in PCRE module? If it's problem in module, when it will be fixed? Do you need PHP scripts with code which makes segfault?
 [2010-12-02 11:34 UTC]
-Status: Open +Status: Feedback
 [2010-12-02 11:34 UTC]
It is most likely one of the pcre stack segfault, increase it (via php.ini's pcre.backtrack_limit setting) may fix this problem.

If it still crashes, we will need a short script to reproduce the problem, self containted too.
 [2010-12-03 07:22 UTC] dr4k0n at list dot ru
-Status: Feedback +Status: Open
 [2010-12-03 07:22 UTC] dr4k0n at list dot ru
PCRE related settings in php.ini not helps...

Full report:
PHP 5.3.3-pl1-gentoo (cli)

$news = file_get_contents ('news.dat');
$pregNews = '#<h1[^>]*>([^<]+)</h1>([^<]|<[^h]|<h[^2])*<h2>[^<]*<a href="(/actions/\?id=([\d]+))">(([^<]|<[^/]|</[^a])*)</a></h2>#sui';
preg_match_all ($pregNews, $news, $newsResult, PREG_SET_ORDER);

valgrind report:
 [2010-12-03 12:51 UTC]
-Status: Open +Status: Bogus
 [2010-12-03 12:51 UTC]
Ok, it is the pcre common problem. Pls see the other bug reports about this topic to get a full explanation.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jun 30 23:03:49 2022 UTC