php.net |  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
 [2010-11-30 12:11 UTC] dr4k0n at list dot ru
Description:
------------
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/infoskidka.ru/www/common/php_debug_2010.11.30.txt /usr/bin/php -f /var/www/infoskidka.ru/www/cli.php parsers update_actions
---------------------------------------------
Result: http://www.infoskidka.ru/common/php_debug_2010.11.30.txt
It looks like error on PCRE module.




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-30 12:21 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2010-11-30 12:21 UTC] pajoye@php.net
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] pajoye@php.net
-Status: Open +Status: Feedback
 [2010-11-30 12:30 UTC] pajoye@php.net
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] pajoye@php.net
And we still need a way to actually reproduce this crash, like a small script.
 [2010-11-30 12:32 UTC] johannes@php.net
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: http://www.infoskidka.ru/common/php_debug_segfault_5.3.4RC1.txt
 [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] pajoye@php.net
-Status: Open +Status: Feedback
 [2010-12-02 11:34 UTC] pajoye@php.net
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)

script:
$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);

news.dat: http://www.infoskidka.ru/common/news.dat
valgrind report: http://www.infoskidka.ru/common/news_segfault.txt
 [2010-12-03 12:51 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2010-12-03 12:51 UTC] pajoye@php.net
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: Sat May 28 03:04:04 2022 UTC