php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52977 php cli & apache crash
Submitted: 2010-10-03 08:20 UTC Modified: 2013-02-18 00:34 UTC
Votes:2
Avg. Score:4.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: epopen at gmail dot com Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5.3.3 OS: FreeBSD 8.1 i386
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: epopen at gmail dot com
New email:
PHP Version: OS:

 

 [2010-10-03 08:20 UTC] epopen at gmail dot com
Description:
------------
Hi PHP DEV team.

My system have a crash problem.
My PHP installed from FreeBSD ports system.

My apache always complain look like
  [Thu Sep 30 11:47:21 2010] [notice] child pid 96860 exit signal Illegal instruction (4)
  [Thu Sep 30 11:48:52 2010] [notice] child pid 62054 exit signal Segmentation fault (11)
And php cli also problem like
  # php
  Segmentation fault (core dumped)
But I cleared my extensions.ini empty, php cli work fine.
I can't identify extensions cause crash, Because random extensions cause crash.
Under is my extensions.ini
extension=fileinfo.so
extension=imagick.so
extension=memcache.so
extension=apc.so
extension=zip.so
extension=mysqli.so
extension=simplexml.so
extension=mysql.so
extension=hash.so
extension=gettext.so
extension=ctype.so
extension=gd.so
extension=ftp.so
extension=bz2.so
extension=xml.so
extension=openssl.so
extension=mbstring.so
extension=mcrypt.so
extension=json.so
extension=imap.so
extension=ldap.so
extension=iconv.so
extension=filter.so
extension=readline.so
extension=session.so
extension=xmlrpc.so
extension=zlib.so
extension=dom.so

Today I tried set PHP debug complier flag, and use GDB for debug.
GDB debug output in Actual result.
Please help for debug
Thanks very much.

Expected result:
----------------
See 'NO SEG FAULT' printed to screen and work fine

Actual result:
--------------
# php
Segmentation fault (core dumped)

# gdb /usr/local/bin/php ./php.core
Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.5...done.
Loaded symbols for /lib/libcrypt.so.5
Reading symbols from /lib/libz.so.5...done.
Loaded symbols for /lib/libz.so.5
Reading symbols from /usr/local/lib/libpcre.so.0...done.
Loaded symbols for /usr/local/lib/libpcre.so.0
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /usr/local/lib/libxml2.so.5...done.
Loaded symbols for /usr/local/lib/libxml2.so.5
Reading symbols from /usr/local/lib/libiconv.so.3...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x0806676e in guess_timezone (tzdb=0x83a7db8, tsrm_ls=0x28802040) at /usr/ports/lang/php5/work/php-5.3.3/ext/date/php_date.c:844
844     /usr/ports/lang/php5/work/php-5.3.3/ext/date/php_date.c: No such file or directory.
        in /usr/ports/lang/php5/work/php-5.3.3/ext/date/php_date.c
(gdb) bt
#0  0x0806676e in guess_timezone (tzdb=0x83a7db8, tsrm_ls=0x28802040) at /usr/ports/lang/php5/work/php-5.3.3/ext/date/php_date.c:844
#1  0x08066a43 in get_timezone_info (tsrm_ls=0x28802040) at /usr/ports/lang/php5/work/php-5.3.3/ext/date/php_date.c:939
#2  0x0806869f in php_format_date (format=0x83de55b "d-M-Y H:i:s", format_len=11, ts=1286040963, localtime=1, tsrm_ls=0x28802040)
    at /usr/ports/lang/php5/work/php-5.3.3/ext/date/php_date.c:1189
#3  0x081d63ce in php_log_err (
    log_message=0x2882c4e0 "PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-zts-debug/fileinfo.so' - Cannot open \"/usr/local/lib/php/20090626-zts-debug/fileinfo.so\" in Unknown on line 0", tsrm_ls=0x28802040)
    at /usr/ports/lang/php5/work/php-5.3.3/main/main.c:586
#4  0x081d76e8 in php_error_cb (type=32, error_filename=0x83f3cb7 "Unknown", error_lineno=0, format=0x83de558 "%s", args=0xbfbfe3e8 "\030�\202(")
    at /usr/ports/lang/php5/work/php-5.3.3/main/main.c:1004
#5  0x08266175 in zend_error (type=32, format=0x83de558 "%s") at /usr/ports/lang/php5/work/php-5.3.3/Zend/zend.c:1092
#6  0x081d6f73 in php_verror (docref=0x0, params=0x83dcac9 "", type=32, format=0x83c5650 "Unable to load dynamic library '%s' - %s",
    args=0xbfbfe4c0 "�\222\202(`\024C(\b忿\177�&\b", tsrm_ls=0x28802040) at /usr/ports/lang/php5/work/php-5.3.3/main/main.c:808
#7  0x081d6feb in php_error_docref0 (docref=0x0, tsrm_ls=0x28802040, type=32, format=0x83c5650 "Unable to load dynamic library '%s' - %s")
    at /usr/ports/lang/php5/work/php-5.3.3/main/main.c:820
#8  0x0810f017 in php_load_extension (filename=0x28828118 "fileinfo.so", type=1, start_now=0, tsrm_ls=0x28802040)
    at /usr/ports/lang/php5/work/php-5.3.3/ext/standard/dl.c:158
#9  0x081e21fa in php_load_php_extension_cb (arg=0x28802ef8, tsrm_ls=0x28802040) at /usr/ports/lang/php5/work/php-5.3.3/main/php_ini.c:350
#10 0x08258f15 in zend_llist_apply (l=0x8417a5c, func=0x81e21d0 <php_load_php_extension_cb>, tsrm_ls=0x28802040)
    at /usr/ports/lang/php5/work/php-5.3.3/Zend/zend_llist.c:385
#11 0x081e30ec in php_ini_register_extensions (tsrm_ls=0x28802040) at /usr/ports/lang/php5/work/php-5.3.3/main/php_ini.c:724
#12 0x081daa2b in php_module_startup (sf=0x8404de0, additional_modules=0x0, num_additional_modules=0)
    at /usr/ports/lang/php5/work/php-5.3.3/main/main.c:2036
#13 0x08350d51 in php_cli_startup (sapi_module=0x8404de0) at /usr/ports/lang/php5/work/php-5.3.3/sapi/cli/php_cli.c:401
#14 0x08351b2c in main (argc=1, argv=0xbfbfe850) at /usr/ports/lang/php5/work/php-5.3.3/sapi/cli/php_cli.c:775

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-04 10:36 UTC] kalle@php.net
-Status: Open +Status: Feedback
 [2010-10-04 10:36 UTC] kalle@php.net
Try fix the following problem within the backtrace and see if it fixes the segfault:
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-zts-debug/fileinfo.so' - Cannot open "/usr/local/lib/php/20090626-zts-debug/fileinfo.so" in Unknown on line 0
 [2010-10-05 05:15 UTC] epopen at gmail dot com
-Status: Feedback +Status: Open
 [2010-10-05 05:15 UTC] epopen at gmail dot com
Hi PHP DEV team.
Thanks reply quickly.
1. If extensions.ini had any "ONE or more" extension=***.so, php cli always "Segmentation fault".
2. Later I close PHP debug complie flag and recomplie. php cli hadn't anyone printout.
"php -v" hadn't any result printout also.

I remember, Before 5.3.3 and no debug flag, php always "Segmentation fault".
Disable few extensions(eg. memchche.so), work fine.
In fact, Before the bug report, I never saw "20090626-zts-debug" message, only "20090626-zts" only.

Thanks very much.
 [2011-02-10 15:32 UTC] raphaelm@php.net
Automatic comment from SVN on behalf of raphaelm
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=308195
Log: bug #52977: the messages for ftp_connect and ftp_ssl_connect are mixed up in German translation
 [2011-07-10 13:34 UTC] felipe@php.net
-Status: Open +Status: Feedback
 [2011-07-10 13:34 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2011-07-13 03:29 UTC] epopen at gmail dot com
-Status: Feedback +Status: Open
 [2011-07-13 03:29 UTC] epopen at gmail dot com
Hi felipe

Thanks your suggest.
But it is hard, Because I installed PHP from FreeBSD ports system.
I can't modified it.

Newest status report (2011-07-13):
Current FreeBSD: 8.2, PHP:5.3.6
Same "Segmentation fault (core dumped)" if "extension=memcache.so" is not least row in extensions.ini
The "memcache.so" is known reproduce issue easily extensions.

Thanks a lot.
 [2011-07-13 03:33 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2011-07-13 03:33 UTC] pajoye@php.net
Are you saying that it does not crash if the memcache extension is not enabled?
 [2011-07-13 04:03 UTC] epopen at gmail dot com
-Status: Feedback +Status: Open
 [2011-07-13 04:03 UTC] epopen at gmail dot com
Hi pajoye.

Thanks reply.
>>Are you saying that it does not crash if the memcache extension is not enabled?
Yes, doesn't crash when memcache extension disable...
But not only memcache extension, but also other one cause crash(random).

When PHP upgrade by ports in FreeBSD, extensions row order change randomly.
So crash after upgrade sometime.
Memcache is known issue until today.(Order between extensions I think)

Thanks a lot.
 [2011-07-13 04:09 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2011-07-13 04:09 UTC] pajoye@php.net
please try using php only without any non core extensions.

Also try using 5.3.6, you can compile it yourself in your home directory without 
having to install it.

If you can't do it, please report this bug to FreeBSD so they can either fix their 
packages or help you fixing this issue.
 [2011-07-14 06:32 UTC] epopen at gmail dot com
Hi pajoye
>please try using php only without any non core extensions.
I remove /usr/local/etc/php/extensions.ini and execute # php -v, work fine.
Result
# php -v
  PHP 5.3.6 with Suhosin-Patch (cli) (built: Jul  4 2011 22:18:16)
  Copyright (c) 1997-2011 The PHP Group
  Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

>Also try using 5.3.6, you can compile it yourself in your home directory without 
>having to install it.
OK
1.I fetch snapshot from http://snaps.php.net/php5.3-latest.tar.gz
2.untar
3.# ./configure
4.# make
5.PHP cli Result
  /tmp/php5.3-201107140430/sapi/cli]# ./php -v
  PHP 5.3.7RC3-dev (cli) (built: Jul 14 2011 14:31:47)
  Copyright (c) 1997-2011 The PHP Group
  Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
Look like good?

>If you can't do it, please report this bug to FreeBSD so they can either fix their 
>packages or help you fixing this issue.
I think it is not FreeBSD issue, between extensions interference maybe.

Thanks you.
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 12:01:31 2024 UTC