468,133 Members | 1,156 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

what is a segmentation fault, and why is it killing PHP on my server?


We made some changes to our server yesterday, and ever since, every
single installation of WordPress that was on the server has stopped
running. Other PHP scripts still run fine, but WordPress is dead.

I logged into the server using ssh and looked the Apache error_log. The
only thing there was a whole bunch of lines like this:

[Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
Segmentation fault (11)
I'm not finding any PHP errors that might tell me what is wrong with
WordPress.

Can anyone give me advice about what to do?

Aug 18 '06 #1
8 4628
On 18 Aug 2006 15:08:33 -0700, "lawrence k" <lk******@geocities.comwrote:

Re: the subject line:

http://www.google.co.uk/search?q=segmentation+fault

This first hit is informative.
>We made some changes to our server yesterday,
What changes did you make?
>and ever since, every
single installation of WordPress that was on the server has stopped
running. Other PHP scripts still run fine, but WordPress is dead.
OK, so you should reverse the changes you made.

And, this should serve as a lesson to make changes to a test server first,
assuming this is a server where the application is worth some amount of money
greater than zero.
>I logged into the server using ssh and looked the Apache error_log. The
only thing there was a whole bunch of lines like this:

[Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
Segmentation fault (11)

I'm not finding any PHP errors that might tell me what is wrong with
WordPress.

Can anyone give me advice about what to do?
PHP should never suffer a segmentation fault; if it does, then there is
either:

(a) a bug in PHP
(b) a bug in a PHP extension
(c) a bug in a library loaded by PHP core
(d) a bug in a library loaded by a PHP extension
(e) something bizarrely wrong with your system as a whole

In any case:

http://bugs.php.net/how-to-report.php

And to make a bug report that is possible to act on, you need a backtrace to
identify what's causing the segfault:

http://bugs.php.net/bugs-generating-backtrace.php

Without this it's impossible to even guess what's wrong.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Aug 18 '06 #2
*** lawrence k escribió/wrote (18 Aug 2006 15:08:33 -0700):
[Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
Segmentation fault (11)

I'm not finding any PHP errors that might tell me what is wrong with
WordPress.
A segfault means that the PHP interpreter crashed. It's almost certainly a
bug or a damaged installation. WordPress code, no matter how good or bad,
cannot do it by its own.

You either forgot something when you did such changes to your server, or
the new version of whatever you installed is buggy or not compatible.
Hmmm... You aren't using Red Hat 9, are you?

--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Aug 18 '06 #3

lawrence k wrote:
We made some changes to our server yesterday, and ever since, every
single installation of WordPress that was on the server has stopped
running. Other PHP scripts still run fine, but WordPress is dead.

I logged into the server using ssh and looked the Apache error_log. The
only thing there was a whole bunch of lines like this:

[Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
Segmentation fault (11)

Thanks for the feedback that I got. I'm sorry if I didn't include
enough information the first time. Here is more info:

We have a server that we lease from Rackspace, a linux box running Red
Hat Enterprise Linux 3. Yesterday we tried to get some e-commerce
software going and we realized our build of PHP didn't have mhash
installed. So we called Rackspace and asked them to rebuild our copy of
PHP, this time including mhash. Rackspace did so. And then all of our
WordPress blogs died.

If you go here, you'll see that our WordPress blog is dead:

http://www.monkeyclaus.org/

also on the same server:

http://www.bluewallllc.com/blog/

All you'll see is what I'm echoing to the screen.

It turns out WordPress is now dying on this line:

$this->col_info[$i] = mysql_fetch_field($this->result);

That line is in wp-db.php (which is in the wp-includes folder).

Other sites on our server, including PHP/MySql sites, are having no
problem:

accumulist.com/

We're currently running version 4.3.2 of PHP.

The configure command for the new build of PHP was this:

'./configure' '--host=i686-redhat-linux-gnu'
'--build=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu'
'--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
'--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib'
'--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--cache-file=../config.cache'
'--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d'
'--enable-force-cgi-redirect' '--disable-debug' '--enable-pic'
'--disable-rpath' '--enable-inline-optimization' '--with-bz2'
'--with-db4=/usr' '--with-curl' '--with-dom=/usr'
'--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr'
'--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf'
'--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv'
'--with-mhash=/usr/lib' '--with-jpeg-dir=/usr' '--with-openssl'
'--with-png' '--with-pspell' '--with-regex=system' '--with-xml'
'--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib'
'--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp'
'--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets'
'--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path'
'--enable-track-vars' '--enable-trans-sid' '--enable-yp'
'--enable-wddx' '--enable-mbstring' '--enable-mbstr-enc-trans'
'--enable-mbregex' '--with-pear=/usr/share/pear' '--with-imap=shared'
'--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared'
'--with-mysql=shared,/usr' '--with-pgsql=shared'
'--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath'
'--enable-shmop' '--enable-versioning' '--enable-calendar'
'--enable-dbx' '--enable-dio' '--enable-mcal'
'--with-apxs2filter=/usr/sbin/apxs'

Does anyone see anything missing? I assume that
'--with-mysql=shared,/usr' covers all the MySql stuff.

Any ideas?

Aug 19 '06 #4

Andy Hassall wrote:
On 18 Aug 2006 15:08:33 -0700, "lawrence k" <lk******@geocities.comwrote:
I logged into the server using ssh and looked the Apache error_log. The
only thing there was a whole bunch of lines like this:

[Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
Segmentation fault (11)

I'm not finding any PHP errors that might tell me what is wrong with
WordPress.

Can anyone give me advice about what to do?

PHP should never suffer a segmentation fault; if it does, then there is
either:

(a) a bug in PHP
(b) a bug in a PHP extension
(c) a bug in a library loaded by PHP core
(d) a bug in a library loaded by a PHP extension
(e) something bizarrely wrong with your system as a whole

Could something have gone wrong in the build process? If so, what? I'm
going to call Rackspace and talk it over with them, but I'd like to do
some research first, so I sound intelligent. But my experience building
stuff on Linux is pretty basic.

Aug 19 '06 #5

Andy Hassall wrote:
On 18 Aug 2006 15:08:33 -0700, "lawrence k" <lk******@geocities.comwrote:

Re: the subject line:

http://www.google.co.uk/search?q=segmentation+fault

This first hit is informative.
We made some changes to our server yesterday,

What changes did you make?
and ever since, every
single installation of WordPress that was on the server has stopped
running. Other PHP scripts still run fine, but WordPress is dead.

OK, so you should reverse the changes you made.

And, this should serve as a lesson to make changes to a test server first,
assuming this is a server where the application is worth some amount of money
greater than zero.
I logged into the server using ssh and looked the Apache error_log. The
only thing there was a whole bunch of lines like this:

[Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
Segmentation fault (11)

I'm not finding any PHP errors that might tell me what is wrong with
WordPress.

Can anyone give me advice about what to do?

PHP should never suffer a segmentation fault; if it does, then there is
either:

(a) a bug in PHP
(b) a bug in a PHP extension
(c) a bug in a library loaded by PHP core
(d) a bug in a library loaded by a PHP extension
(e) something bizarrely wrong with your system as a whole
(f) Seg faults can also occur if there is too much recursion, which can
be caused by user PHP code.

Aug 19 '06 #6
Richard Levasseur wrote:
Andy Hassall wrote:
>>On 18 Aug 2006 15:08:33 -0700, "lawrence k" <lk******@geocities.comwrote:

Re: the subject line:

http://www.google.co.uk/search?q=segmentation+fault

This first hit is informative.

>>>We made some changes to our server yesterday,

What changes did you make?

>>>and ever since, every
single installation of WordPress that was on the server has stopped
running. Other PHP scripts still run fine, but WordPress is dead.

OK, so you should reverse the changes you made.

And, this should serve as a lesson to make changes to a test server first,
assuming this is a server where the application is worth some amount of money
greater than zero.

>>>I logged into the server using ssh and looked the Apache error_log. The
only thing there was a whole bunch of lines like this:

[Fri Aug 18 18:00:25 2006] [notice] child pid 27827 exit signal
Segmentation fault (11)

I'm not finding any PHP errors that might tell me what is wrong with
WordPress.

Can anyone give me advice about what to do?

PHP should never suffer a segmentation fault; if it does, then there is
either:

(a) a bug in PHP
(b) a bug in a PHP extension
(c) a bug in a library loaded by PHP core
(d) a bug in a library loaded by a PHP extension
(e) something bizarrely wrong with your system as a whole


(f) Seg faults can also occur if there is too much recursion, which can
be caused by user PHP code.
I've also had bad PHP code cause segfaults. It shouldn't happen, but
the interpreter isn't perfect.

Never had good PHP code cause a segfault, so that's good enough for me :-).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Aug 19 '06 #7
"lawrence k" <lk******@geocities.compíse v diskusním príspevku
news:11**********************@74g2000cwt.googlegro ups.com...
>
lawrence k wrote:
[... ]
It turns out WordPress is now dying on this line:

$this->col_info[$i] = mysql_fetch_field($this->result);
Try to test mysql command out of PHP, eg. using mysql command line client.
Is the result as you expect?
That line is in wp-db.php (which is in the wp-includes folder).
Try to put this line into main php code without using include.

--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
Aug 19 '06 #8
On 19 Aug 2006 04:36:42 -0700, "Richard Levasseur" <ri********@gmail.com>
wrote:
> (a) a bug in PHP
(b) a bug in a PHP extension
(c) a bug in a library loaded by PHP core
(d) a bug in a library loaded by a PHP extension
(e) something bizarrely wrong with your system as a whole

(f) Seg faults can also occur if there is too much recursion, which can
be caused by user PHP code.
That's arguably a case of (a); the out of memory / stack overflow condition
should be caught and gracefully raised as a fatal error message, not as
segfaulting the process.

Although looking at bugs.php.net there's various reports of this, with the PHP
maintainers marking them as "Won't Fix" or "Bogus".

And: http://news.php.net/article.php?grou...s&article=8851

Admittedly, if you've already filled the stack, then calling an error handling
function may be a challenge ;-)

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Aug 19 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Justin Tang | last post: by
6 posts views Thread by jerrygarciuh | last post: by
3 posts views Thread by I_have_nothing | last post: by
5 posts views Thread by Fra-it | last post: by
27 posts views Thread by Paminu | last post: by
7 posts views Thread by pycraze | last post: by
3 posts views Thread by madunix | last post: by
27 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.