472,983 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,983 software developers and data experts.

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 4881
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Justin Tang | last post by:
Hi I am wondering about the segmentation fault in PHP. Namely, I'm running PHP version 4.6.9 on my server right now and when I try to process a large piece of text via textarea(3k+), the resulting...
6
by: jerrygarciuh | last post by:
Hello, I have a script running in the wee hours via cron job. When I access the script via browser it works like a charm. I noticed it was not succeeding and ran it manually from the command...
3
by: I_have_nothing | last post by:
Hi! I am new in C. I got a lots of "Segmentation Fault"s in my code. I guess One possibility is: if " int array_i; " is declard and the code trys to access "array_i", a Segmentation Fault will...
3
by: Zheng Da | last post by:
Program received signal SIGSEGV, Segmentation fault. 0x40093343 in _int_malloc () from /lib/tls/libc.so.6 (gdb) bt #0 0x40093343 in _int_malloc () from /lib/tls/libc.so.6 #1 0x40094c54 in malloc...
6
by: I_have_nothing | last post by:
Hi! I am new in C. I try to use dynamical allocation fuction malloc( ) and realloc( ). I found something strange. After several calling realloc( ), the malloc( ) will give me a Segmentation...
5
by: Fra-it | last post by:
Hi everybody, I'm trying to make the following code running properly, but I can't get rid of the "SEGMENTATION FAULT" error message when executing. Reading some messages posted earlier, I...
27
by: Paminu | last post by:
I have a wierd problem. In my main function I print "test" as the first thing. But if I run the call to node_alloc AFTER the printf call I get a segmentation fault and test is not printed! ...
7
by: pycraze | last post by:
I would like to ask a question. How do one handle the exception due to Segmentation fault due to Python ? Our bit operations and arithmetic manipulations are written in C and to some of our...
3
by: madunix | last post by:
My Server is suffering bad lag (High Utlization) I am running on that server Oracle10g with apache_1.3.35/ php-4.4.2 Web visitors retrieve data from the web by php calls through oci cobnnection...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.