Php Crashing [message #5927] |
Fri, 27 September 2002 16:18 |
njolly
Messages: 16 Registered: September 2002
Karma: 0
|
Junior Member |
|
|
I'm running php version 4.1.2, apache 1.3.22, mysql 3.23.41, and fudforum 2.3.2rc2, and continually get page cannot be displayed errors. I've been able to determine that php is segfaulting, but I can't determine why. Could it be a problem with my php version, or php.ini settings? The fault occurs far more often from windows boxes for some reason. Anybody run accross this?
|
|
|
Re: Php Crashing [message #5928 is a reply to message #5927] |
Fri, 27 September 2002 16:21 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
You should definately upgrade your PHP as version 4.1.2 has security faults and other problematic issues. If you upgrade to PHP 4.2.3 it should take care of your problem.
FUDforum Core Developer
|
|
|
|
|
Re: Php Crashing [message #5936 is a reply to message #5933] |
Fri, 27 September 2002 19:00 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
If you are compiling PHP yourself by passing --enable-debug you would be able to not only do a backtrace but may get helpful messages that would explain the cause of the crash.
FUDforum Core Developer
|
|
|
Re: Php Crashing [message #9525 is a reply to message #5936] |
Sat, 05 April 2003 14:37 |
ScooterQ
Messages: 25 Registered: June 2002 Location: Norcross, GA
Karma: 0
|
Junior Member |
|
|
I've been struggling with a similar seg fault issue for the past two weeks. I've been bouncing a bug report around with the PHP team, but we haven't been able to narrow anything down.
This morning I thought I had fixed the problem after a recompile of Apache and PHP. I went about 15 hours without a seg fault. That all changed once I ran a compact messages on FudForum.
Previously my seg faults were semi-random. Now I can seg fault PHP on demand. I've been testing with a hacked up version of the compact page (adm/compact.php) - I'm slowly adding the code back in until I produce errors. The seg fault is occuring after the post and appears to be somewhere around the time of the db_lock (line 110).
Is there anything you can do to help me out? I wasn't able to give the PHP guys enough detail about a specific function/script (the problem seemed to be happening on the index page previously) to get a good bug report for them. This problem is definitely reproducible (every time I press submit), so if I/we can narrow it down to a function perhaps we can either (1) find the problem in PHP, or (2) find the problem in FUDForum.
Config information and backtrace follow:
RedHat 8
Apache 1.3.27
PHP 4.3.2-RC (Friday's CVS, installed per recommendation of PHP team)
FUDForum version is 2.3.9-RC1
MySQL version (from RPM) is mysql-server-3.23.54a-4
Apache and PHP are compiled by me with very few options turned on. PHP is configured as follows:
./configure \
--with-apxs=/usr/local/apache/bin/apxs \
--with-mysql \
--with-pgsql \
--with-pspell \
--enable-debug
BACKTRACE
Starting program: /usr/local/apache/bin/httpd -X
Program received signal SIGSEGV, Segmentation fault.
0x402520b1 in setvbuf () from /lib/libc.so.6
(gdb) bt
#0 0x402520b1 in setvbuf () from /lib/libc.so.6
#1 0x4053f74a in php_stdiop_set_option (stream=0x84b6624, option=3, value=2, ptrparam=0xbfff9130)
at /usr/local/src/php4-STABLE-200304041230/main/streams.c:1636
#2 0x4053eaea in _php_stream_set_option (stream=0x84b6624, option=3, value=2, ptrparam=0xbfff9130)
at /usr/local/src/php4-STABLE-200304041230/main/streams.c:1002
#3 0x404e3e30 in zif_stream_set_write_buffer (ht=2, return_value=0x84b5e6c, this_ptr=0x0, return_value_used=0)
at /usr/local/src/php4-STABLE-200304041230/ext/standard/file.c:1607
#4 0x405675ea in execute (op_array=0x8430a54)
at /usr/local/src/php4-STABLE-200304041230/Zend/zend_execute.c:1606
#5 0x4055ae19 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /usr/local/src/php4-STABLE-200304041230/Zend/zend.c:864
#6 0x40535de7 in php_execute_script (primary_file=0xbfffebb0)
at /usr/local/src/php4-STABLE-200304041230/main/main.c:1653
#7 0x4056b172 in apache_php_module_main (r=0x840f47c, display_source_mode=0)
at /usr/local/src/php4-STABLE-200304041230/sapi/apache/sapi_apache.c:55
#8 0x4056bc05 in send_php (r=0x840f47c, display_source_mode=0, filename=0x0)
at /usr/local/src/php4-STABLE-200304041230/sapi/apache/mod_php4.c:617
#9 0x4056bd9a in send_parsed_php (r=0x840f47c)
at /usr/local/src/php4-STABLE-200304041230/sapi/apache/mod_php4.c:632
#10 0x080c5c04 in ap_invoke_handler ()
#11 0x080da5aa in process_request_internal ()
#12 0x080da60a in ap_process_request ()
#13 0x080d17f2 in child_main ()
#14 0x080d19b8 in make_child ()
#15 0x080d1b1f in startup_children ()
#16 0x080d214c in standalone_main ()
#17 0x080d2984 in main ()
#18 0x40202907 in __libc_start_main () from /lib/libc.so.6
|
|
|
|
|
Re: Php Crashing [message #9577 is a reply to message #9576] |
Fri, 11 April 2003 17:42 |
philip
Messages: 21 Registered: December 2002
Karma: 0
|
Junior Member |
|
|
Once you find more information (and please do so soon before 4.3.2 is released :), just add it to the existing report and someone will reopen it. BTW, what bug number is it?
[Updated on: Fri, 11 April 2003 17:42] Report message to a moderator
|
|
|
Re: Php Crashing [message #9578 is a reply to message #9577] |
Fri, 11 April 2003 18:06 |
ScooterQ
Messages: 25 Registered: June 2002 Location: Norcross, GA
Karma: 0
|
Junior Member |
|
|
philip wrote on Fri, 11 April 2003 13:42 | Once you find more information (and please do so soon before 4.3.2 is released , just add it to the existing report and someone will reopen it. BTW, what bug number is it?
|
Bug ID is 23040
I'm no longer looking into the problem. My energy is instead being devoted to working on a script to convert FUD data for use in another forum system. I was pretty gung-ho to work on fixing the problem, but once I didn't hear anything back after posting the issue here I figured I was the only one who was having the problem, so I moved on. That, combined with another oddball problem I was seeing that also didn't seem to be affecting many other people, convinced me that I needed to look elsewhere for a forum system.
I truly don't mean for that to sound negative. I think prottoss and the others here have done a great job and they have consistently answered support questions faster than I thought was humanly possible, but the last two issues were creating usability issues for some of my users and stability problems for all of them. I had to resolve the problems one way or another. Since the problems were only happening for me in the FUDforum world, I figured that it must be a problem within FUDforum. Since no one else chimed in with similar experiences and I didn't hear anything from the developers (which was REALLY odd considering how quickly they'd responded to anything else I'd ever posted), I decided that the problem had to be a combination of FUDforum and my configuration, but apparently one that only affected me. So I removed one of the variables - my installation of FUDforum.
|
|
|
|
|
|
Re: Php Crashing [message #9582 is a reply to message #9581] |
Fri, 11 April 2003 20:01 |
ScooterQ
Messages: 25 Registered: June 2002 Location: Norcross, GA
Karma: 0
|
Junior Member |
|
|
philip wrote on Fri, 11 April 2003 15:46 | I would help and will attempt to cause the segfault but I'm a weak sysadmin and don't close these types of bugs. That and backtraces look like a bunch of gibberish to me.
|
I might be a bit stronger on the sysadmin side of things, but backtraces and debugger output is gibberish to me, too.
Quote: | It appears you're attempting to create a non-fudforum script to cause this segfault, is this true? Like does that use of putenv() by itself cause it? I wonder if this is a locale problem, I don't know this topic at all.
|
I can reproduce the problem by running compact messages with the script distributed with FUDForum 2.3.9RC1. The putenv() issue was suspect in the original issue, but there's no use of putenv() within compact.php. What I did was I made o copy of the compact.php script and removed all of the code. I then began adding things back until the segfault happened. Somewhere around line 110 the problem reoccurred.
Quote: | No application (in PHP or otherwise) should ever be able to cause a segfault so I don't think fudforum can even take partial blame here but only partial credit for causing it (so it can be fixed)
|
Key word - should. Something is happening within that compact script that is causing seg faults on my server. I agree, if the function is considered legal in PHP, it shouldn't cause a seg fault. If it does, that's not the fault of the guys around here, but rather a PHP issue. The problem is that I'm not overly familiar with some of the functions used in the compact script (flush, db_lock). I keep hoping that one of the developers more familiar with the innards of the script can give me a couple of hints so that we can collectively fix the problem.
echo "<br>Please wait while forum is being compacted.<br>This may take a while depending on the size of your forum.<br>\n";
flush();
define('__file_perms__', (($GLOBALS['FILE_LOCK']=='Y')?0600:0644));
/* Normal Messages */
echo "Compacting normal messages...<br>\n";
flush();
$stm = time();
db_lock($GLOBALS['DBHOST_TBL_PREFIX'].'msg+,
'.$GLOBALS['DBHOST_TBL_PREFIX'].'thread+,
'.$GLOBALS['DBHOST_TBL_PREFIX'].'forum+,
'.$GLOBALS['DBHOST_TBL_PREFIX'].'replace+');
|
|
|
Re: Php Crashing [message #9608 is a reply to message #9525] |
Sun, 13 April 2003 14:34 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Any php crash is no fault of the forum, PHP should NOT crash.
Did you open a bug report on bugs.php.net? If so what is it's ID?
FUDforum Core Developer
|
|
|
|
|
Re: Php Crashing [message #9643 is a reply to message #9640] |
Sun, 13 April 2003 15:28 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
The error is clearly related to php's file handling. So your CPU or db_lock (runs a database locking query) is not at fault here. Thank you for the detailed report, I will try to see if I can replicate the problem myself.
FUDforum Core Developer
|
|
|
|
|
|
Re: Php Crashing [message #9715 is a reply to message #9713] |
Tue, 15 April 2003 19:35 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
It was an internal problem, which had to do with stdio streams. As of 4.3.0 php use streams and for peformance reasons tries to use kernel functions to write to files. These functions do not support buffering in the same manner as libc functions like fwrite/fread do and consequently setting these options on an invalid handle caused the crash.
FUDforum Core Developer
|
|
|
|