LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
Search this Thread
Old 10-10-2008, 11:00 PM   #1
ohcarol
Member
 
Registered: Dec 2004
Location: Nepal
Posts: 86

Rep: Reputation: 15
php core dump with segmentation fault


Hi all,

I have FreeBSD6.0 installed with php5.2.6 and apache 2.2.9. My problem is php always core dump with Segmentation fault. Below is the debug of gdb output:

localhost# gdb /usr/local/bin/php php.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...(no debugging symbols found)...
Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypt.so.3
Reading symbols from /lib/libm.so.4...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.4
Reading symbols from /usr/local/lib/libxml2.so.5...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libxml2.so.5
Reading symbols from /lib/libz.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/libz.so.3
Reading symbols from /usr/local/lib/libiconv.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /usr/local/lib/php/20060613/session.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/php/20060613/session.so
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x29a13f54 in __do_global_dtors_aux () from /usr/local/lib/php/20060613/session.so
#2 0x29a1a7b8 in _fini () from /usr/local/lib/php/20060613/session.so
#3 0x2824b018 in tls_dtv_generation () from /libexec/ld-elf.so.1
#4 0x2824c3d8 in ?? () from /libexec/ld-elf.so.1
#5 0xbfbfea48 in ?? ()
#6 0x28233076 in elf_hash () from /libexec/ld-elf.so.1
#7 0x28235958 in dlclose () from /libexec/ld-elf.so.1
#8 0x081373d4 in zend_hash_apply_deleter ()
#9 0x0813746f in zend_hash_graceful_reverse_destroy ()
#10 0x0812d968 in zend_shutdown ()
#11 0x080f466f in php_module_shutdown ()
#12 0x081ab276 in main ()
===========================
Due to this my apache server also crash with core dump and I have to start it manually again. Debug output of gdb for httpd:

localhost# gdb /usr/local/sbin/httpd httpd.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...(no debugging symbols found)...
Core was generated by `httpd'.
Program terminated with signal 11, Segmentation fault.
Error while mapping shared library sections:
/usr/local/lib/php/20060613/ZendExtensionManager.so: No such file or directory.
Error while mapping shared library sections:
/usr/local/lib/php/20060613/Optimizer/php-5.2.x/ZendOptimizer.so: No such file or directory.
Reading symbols from /lib/libm.so.4...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.4
Reading symbols from /usr/local/lib/libaprutil-1.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libaprutil-1.so.3
Reading symbols from /usr/local/lib/libexpat.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libexpat.so.6
Reading symbols from /usr/local/lib/libiconv.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /usr/local/lib/libapr-1.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libapr-1.so.3
Reading symbols from /lib/libcrypt.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypt.so.3
Reading symbols from /usr/lib/libpthread.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libpthread.so.2
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /usr/local/libexec/apache22/mod_authn_file.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_authn_file.so
Reading symbols from /usr/local/libexec/apache22/mod_authn_dbm.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_authn_dbm.so
Reading symbols from /usr/local/libexec/apache22/mod_authn_anon.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_authn_anon.so
Reading symbols from /usr/local/libexec/apache22/mod_authn_default.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_authn_default.so
Reading symbols from /usr/local/libexec/apache22/mod_authz_host.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_authz_host.so
Reading symbols from /usr/local/libexec/apache22/mod_authz_groupfile.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_authz_groupfile.so
Reading symbols from /usr/local/libexec/apache22/mod_authz_user.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_authz_user.so
Reading symbols from /usr/local/libexec/apache22/mod_authz_dbm.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_authz_dbm.so
Reading symbols from /usr/local/libexec/apache22/mod_authz_owner.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_authz_owner.so
Reading symbols from /usr/local/libexec/apache22/mod_authz_default.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_authz_default.so
Reading symbols from /usr/local/libexec/apache22/mod_auth_basic.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_auth_basic.so
Reading symbols from /usr/local/libexec/apache22/mod_auth_digest.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_auth_digest.so
Reading symbols from /usr/local/libexec/apache22/mod_file_cache.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_file_cache.so
Reading symbols from /usr/local/libexec/apache22/mod_cache.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_cache.so
Reading symbols from /usr/local/libexec/apache22/mod_disk_cache.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_disk_cache.so
Reading symbols from /usr/local/libexec/apache22/mod_include.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_include.so
Reading symbols from /usr/local/libexec/apache22/mod_filter.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_filter.so
Reading symbols from /usr/local/libexec/apache22/mod_charset_lite.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_charset_lite.so
Reading symbols from /usr/local/libexec/apache22/mod_deflate.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_deflate.so
Reading symbols from /lib/libz.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/libz.so.3
Reading symbols from /usr/local/libexec/apache22/mod_log_config.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_log_config.so
Reading symbols from /usr/local/libexec/apache22/mod_logio.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_logio.so
Reading symbols from /usr/local/libexec/apache22/mod_env.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_env.so
Reading symbols from /usr/local/libexec/apache22/mod_mime_magic.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_mime_magic.so
Reading symbols from /usr/local/libexec/apache22/mod_cern_meta.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_cern_meta.so
Reading symbols from /usr/local/libexec/apache22/mod_expires.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_expires.so
Reading symbols from /usr/local/libexec/apache22/mod_headers.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_headers.so
Reading symbols from /usr/local/libexec/apache22/mod_usertrack.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_usertrack.so
Reading symbols from /usr/local/libexec/apache22/mod_unique_id.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_unique_id.so
Reading symbols from /usr/local/libexec/apache22/mod_setenvif.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_setenvif.so
Reading symbols from /usr/local/libexec/apache22/mod_ssl.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_ssl.so
Reading symbols from /usr/local/lib/libssl.so.4...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libssl.so.4
Reading symbols from /usr/local/lib/libcrypto.so.4...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libcrypto.so.4
Reading symbols from /usr/local/libexec/apache22/mod_mime.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_mime.so
Reading symbols from /usr/local/libexec/apache22/mod_dav.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_dav.so
Reading symbols from /usr/local/libexec/apache22/mod_status.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_status.so
Reading symbols from /usr/local/libexec/apache22/mod_autoindex.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_autoindex.so
Reading symbols from /usr/local/libexec/apache22/mod_asis.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_asis.so
Reading symbols from /usr/local/libexec/apache22/mod_info.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_info.so
Reading symbols from /usr/local/libexec/apache22/mod_cgi.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_cgi.so
Reading symbols from /usr/local/libexec/apache22/mod_dav_fs.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_dav_fs.so
Reading symbols from /usr/local/libexec/apache22/mod_vhost_alias.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_vhost_alias.so
Reading symbols from /usr/local/libexec/apache22/mod_negotiation.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_negotiation.so
Reading symbols from /usr/local/libexec/apache22/mod_dir.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_dir.so
Reading symbols from /usr/local/libexec/apache22/mod_imagemap.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_imagemap.so
Reading symbols from /usr/local/libexec/apache22/mod_actions.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_actions.so
Reading symbols from /usr/local/libexec/apache22/mod_speling.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_speling.so
Reading symbols from /usr/local/libexec/apache22/mod_userdir.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_userdir.so
Reading symbols from /usr/local/libexec/apache22/mod_alias.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_alias.so
Reading symbols from /usr/local/libexec/apache22/mod_rewrite.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/mod_rewrite.so
Reading symbols from /usr/local/libexec/apache22/libphp5.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/libexec/apache22/libphp5.so
Reading symbols from /usr/local/lib/libxml2.so.5...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libxml2.so.5
Error while reading shared library symbols:
/usr/local/lib/php/20060613/ZendExtensionManager.so: No such file or directory.
Reading symbols from /usr/local/lib/php/20060613/session.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/php/20060613/session.so
Error while reading shared library symbols:
/usr/local/lib/php/20060613/Optimizer/php-5.2.x/ZendOptimizer.so: No such file or directory.
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x00000000 in ?? ()
[New LWP 100200]
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x29cc9f54 in __do_global_dtors_aux () from /usr/local/lib/php/20060613/session.so
#2 0x29cd07b8 in _fini () from /usr/local/lib/php/20060613/session.so
#3 0x280b3018 in tls_dtv_generation () from /libexec/ld-elf.so.1
#4 0x280b43d8 in ?? () from /libexec/ld-elf.so.1
#5 0xbfbfeac8 in ?? ()
#6 0x2809b076 in elf_hash () from /libexec/ld-elf.so.1
#7 0x2809d958 in dlclose () from /libexec/ld-elf.so.1
#8 0x287075fc in zend_hash_apply_deleter () from /usr/local/libexec/apache22/libphp5.so
#9 0x28707697 in zend_hash_graceful_reverse_destroy () from /usr/local/libexec/apache22/libphp5.so
#10 0x286fdb90 in zend_shutdown () from /usr/local/libexec/apache22/libphp5.so
#11 0x286c4897 in php_module_shutdown () from /usr/local/libexec/apache22/libphp5.so
#12 0x286c494f in php_module_shutdown_wrapper () from /usr/local/libexec/apache22/libphp5.so
#13 0x2877b005 in php_apache_server_shutdown () from /usr/local/libexec/apache22/libphp5.so
#14 0x28216af5 in run_cleanups () from /usr/local/lib/libapr-1.so.3
#15 0x28217bc9 in apr_pool_clear () from /usr/local/lib/libapr-1.so.3
#16 0x08063520 in main ()
===========================
 
Old 10-11-2008, 03:33 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Did you install php5 from a binary package, or using ports? If the latter, post the contents of your /etc/make.conf.
 
Old 10-12-2008, 12:14 AM   #3
ohcarol
Member
 
Registered: Dec 2004
Location: Nepal
Posts: 86

Original Poster
Rep: Reputation: 15
I have installed php5 from ports. Below is my /etc/make.conf

ENABLE_SUIDPERL=true
#CPUTYPE?=pentium4
CFLAGS= -O2 -pipe
CXXFLAGS+= -fconserve-space
COPTFLAGS= -O2 -pipe
UP_UPDATE=yes
SUP=/usr/local/bin/cvsup
SUPFLAGS= -g -L 2
SUPHOST=cvsup1.freebsd.org
SUPFILE=/usr/local/etc/cvsup/src-stable-supfile
PORTSSUPFILE=/usr/local/etc/cvsup/ports-current-supfile

#Optimization
WITH_OPTIMIZED_FLAGS=YES
WITH_OPTIMIZED_CFLAGS=YES
WITH_OPTIMIZED_CXXFLAGS=YES
WITH_OPTIMIZED_CXXLAGS=YES
WITH_OPT_CFLAGS=YES
WITH_CPUFLAGS=YES
WITH_OPTIMIZATION=YES
X11BASE=${LOCALBASE}
# no X
WITHOUT_X=YES
WITHOUT_X11=YES
# added by use.perl 2007-12-03 09:34:36
PERL_VER=5.8.8
PERL_VERSION=5.8.8
 
Old 10-12-2008, 02:01 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Get ride of your make.conf:
# mv /etc/make.conf /etc/make.conf.gone

Rebuild and reinstall php5 from ports (probably apache too), and try again. It's generally not a good idea to mess around with make.conf.

Please read this entire (closely related) thread from start to finish, especially post #17, #22, and #23: http://daemonforums.org/showthread.php?t=2116
 
Old 10-13-2008, 12:36 AM   #5
ohcarol
Member
 
Registered: Dec 2004
Location: Nepal
Posts: 86

Original Poster
Rep: Reputation: 15
While removing /etc/make.conf I am still getting core dump for php

localhost# php -v
Failed loading /usr/local/lib/php/20060613/ZendExtensionManager.so: Cannot open "/usr/local/lib/php/20060613/ZendExtensionManager.so"
PHP 5.2.6 with Suhosin-Patch 0.9.6.2 (cli) (built: Oct 13 2008 11:17:01)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
Segmentation fault (core dumped)
 
Old 10-13-2008, 12:40 AM   #6
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
Did you actually rebuild PHP after removing make.conf, though?
 
Old 10-13-2008, 01:41 AM   #7
ohcarol
Member
 
Registered: Dec 2004
Location: Nepal
Posts: 86

Original Poster
Rep: Reputation: 15
I am getting the following error after I completly remove the make.conf file. Before I removed CFLAGS variables

localhost# make install clean
On FreeBSD before 6.2 ports system unfortunately can not set default X11BASE by itself so please help it a bit by setting X11BASE=${LOCALBASE} in make.conf.
On the other hand, if you do wish to use non-default X11BASE, please set variable USE_NONDEFAULT_X11BASE.
*** Error code 1

Stop.
 
Old 10-13-2008, 11:40 AM   #8
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
That makes sense (because of the Xorg bump to 7, which IIRC was while 6.2 was the current RELEASE...).

Ok, so keep just these lines in /etc/make.conf:
Code:
X11BASE=${LOCALBASE}
# added by use.perl 2007-12-03 09:34:36
PERL_VER=5.8.8
PERL_VERSION=5.8.8
Now, as mentioned, you have to rebuild php5 (and probably apache) for this to have any effect.
 
Old 10-13-2008, 10:18 PM   #9
ohcarol
Member
 
Registered: Dec 2004
Location: Nepal
Posts: 86

Original Poster
Rep: Reputation: 15
now I have only following things in /etc/make.conf but still getting core dumped.
localhost# cat /etc/make.conf
ENABLE_SUIDPERL=true
X11BASE=${LOCALBASE}
PERL_VER=5.8.8
PERL_VERSION=5.8.8


localhost# php -v
Failed loading /usr/local/lib/php/20060613/ZendExtensionManager.so: Cannot open "/usr/local/lib/php/20060613/ZendExtensionManager.so"
PHP 5.2.6 with Suhosin-Patch 0.9.6.2 (cli) (built: Oct 14 2008 08:35:48)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
Segmentation fault (core dumped)
 
Old 10-14-2008, 09:19 AM   #10
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Work with us here... what have you rebuilt? If the answer is 'php5' and 'apache', then I'd recommend rebuilding world.

Lots of effort, but sometimes difficult lessons are the easiest to remember.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to force a core-dump...segmentation fault johnpaulodonnell Programming 2 10-23-2008 06:05 AM
Segmentation Fault (core dumped) doing su - Blinker_Fluid Solaris / OpenSolaris 5 10-07-2008 06:04 PM
How to take core dump for a application crashing with segmentation fault wjkkwjkf Red Hat 2 08-25-2008 12:30 PM
PHP-ODBC on OpenBSD 4.1 causes Segmentation fault IMNOboist *BSD 0 06-04-2007 12:33 PM
Segmentation Fault (core dumped) newuser455 Linux - Software 3 08-28-2004 02:39 PM


All times are GMT -5. The time now is 07:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration