Re: [PHP] Segfault problem [long]

2006-09-08 Thread Daniel A. Ramaley
On Thursday 07 September 2006 16:46, you wrote:
You seem to be at least somewhat familiar with gdb, so this may not be
news to you, but the segfault looks to be in PHP's pcre extension. PHP
version 4.4.3 has an updated version of PCRE. That might be worth a
 shot.

My thanks to those of you who responded. I'll try compiling the latest 
4.4.x and see if that fixes anything. If not, then i'll follow Chris' 
suggestion to ask about it on the internals list.


Dan RamaleyDial Center 118, Drake University
Network Programmer/Analyst 2407 Carpenter Ave
+1 515 271-4540Des Moines IA 50311 USA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Segfault problem [long]

2006-09-08 Thread Curt Zirzow

On 9/7/06, Daniel A. Ramaley [EMAIL PROTECTED] wrote:

Hello. I have been struggling for a few months to solve a problem with
an Apache web server. First i'll try to describe the symptoms, then
give details about the configuration and what i have tried so far. I
would greatly appreciate any suggestions on how to diagnose and correct
the problem.


Symptom 1:

After starting Apache during periods of high load the server appears to
run fine for awhile (awhile is highly variable but on the order of 90
minutes) then starts returning empty pages. When the empty pages start,
Apache's error_log gets filled with lines like this:


First:
Hmm.. as noted in your post you are using apache2, what process method
are you using?
 prefork
 worker
 perchild

if you have anything other than prefork, change your apache config to
use prefork. ( this is a very common issue with random highload random
crashes).

Second:
if that doesn't work and you dont need anything special with what
apache2 brings you, try apache 1.x




[Thu Sep 07 09:09:11 2006] [notice] child pid 3579 exit signal
Segmentation fault (11), possible coredump in /etc/httpd/core

These errors are very intermittent during periods of light load. I have
had CoreDumpDirectory defined for awhile and have amassed quite a
collection of core files. This is the first few lines of what gdb
reports for one of them:

(gdb) bt
#0  0x002a99ff2492 in preg_replace_impl (ht=Variable ht is not
available.)
at /usr/src/redhat/BUILD/php-4.3.9/ext/pcre/php_pcre.c:1154
#1  0x002a9a0ac255 in execute (op_array=0x552afe2798)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1640
#2  0x002a9a0a9386 in execute (op_array=0x552aff7fb8)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1684
#3  0x002a9a0a9386 in execute (op_array=0x552b0e26c8)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1684
#4  0x002a9a0a9386 in execute (op_array=0x552af80db8)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1684

Symptom 2:

A further symptom of problems is found in PostgreSQL's logs. The web
applications the server runs rely on PostgreSQL, which logs several
times per minute messages like this:

Sep  7 10:16:09 sun12 postgres[7411]: [1-1] LOG:  unexpected EOF on
client connection

PostgreSQL is configured to accept 256 connections, twice as many
children as Apache should spawn.


Configuration:

The server is a Sun v40z, which is a dual Opteron box with 2 GB RAM. It
is running Red Hat Linux Enterprise AS 4.4 64-bit, with Apache 2.0.52,
PHP 4.3.9, and eAccelerator 0.9.4. The server's purpose is to run Horde
and Imp, with the latest versions of those packages and a few other
Horde components (Ingo, Passwd, and Turba).



I suppose the best thing to look for is to find a small sniplet of
code that you can reproduce the segfault and see if php 4.x and apache
2.x segfault on other systems with that setup.


otherwise there are just to many variables that could cause the
segfault it is a hard thing to trace.



Curt

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Segfault problem [long]

2006-09-07 Thread Chris

Daniel A. Ramaley wrote:
Hello. I have been struggling for a few months to solve a problem with 
an Apache web server. First i'll try to describe the symptoms, then 
give details about the configuration and what i have tried so far. I 
would greatly appreciate any suggestions on how to diagnose and correct 
the problem.



Symptom 1:

After starting Apache during periods of high load the server appears to 
run fine for awhile (awhile is highly variable but on the order of 90 
minutes) then starts returning empty pages. When the empty pages start, 
Apache's error_log gets filled with lines like this:


[Thu Sep 07 09:09:11 2006] [notice] child pid 3579 exit signal 
Segmentation fault (11), possible coredump in /etc/httpd/core


These errors are very intermittent during periods of light load. I have 
had CoreDumpDirectory defined for awhile and have amassed quite a 
collection of core files. This is the first few lines of what gdb 
reports for one of them:


(gdb) bt
#0  0x002a99ff2492 in preg_replace_impl (ht=Variable ht is not 
available.)

at /usr/src/redhat/BUILD/php-4.3.9/ext/pcre/php_pcre.c:1154
#1  0x002a9a0ac255 in execute (op_array=0x552afe2798)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1640
#2  0x002a9a0a9386 in execute (op_array=0x552aff7fb8)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1684
#3  0x002a9a0a9386 in execute (op_array=0x552b0e26c8)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1684
#4  0x002a9a0a9386 in execute (op_array=0x552af80db8)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1684

Symptom 2:

A further symptom of problems is found in PostgreSQL's logs. The web 
applications the server runs rely on PostgreSQL, which logs several 
times per minute messages like this:


The php crash would probably explain the postgres problems.

You're probably better off asking the internals list, 
http://www.php.net/mailing-lists.php, because they write the C code 
behind PHP.


Have you run any hardware tests to make sure it's not memory/cpu related?

--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php