FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » FUDforum 3.0+ » Php Crashing
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Php Crashing [message #5927] Fri, 27 September 2002 16:18 Go to next message
njolly is currently offline  njolly   Canada
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 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #5929 is a reply to message #5928] Fri, 27 September 2002 16:23 Go to previous messageGo to next message
njolly is currently offline  njolly   Canada
Messages: 16
Registered: September 2002
Karma: 0
Junior Member
Will do.

Thanks
Re: Php Crashing [message #5933 is a reply to message #5929] Fri, 27 September 2002 18:12 Go to previous messageGo to next message
njolly is currently offline  njolly   Canada
Messages: 16
Registered: September 2002
Karma: 0
Junior Member
Install php 4.2.3, and I'm still getting the same errors. All I'm seeing in the logs is : child pid 13978 exit signal Segmentation fault (11). Is there a way I can turn on more logging info in php? Sorry I'm really not a php guy.

Neil
Re: Php Crashing [message #5936 is a reply to message #5933] Fri, 27 September 2002 19:00 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 Go to previous messageGo to next message
ScooterQ is currently offline  ScooterQ   United States
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 #9575 is a reply to message #9525] Fri, 11 April 2003 17:27 Go to previous messageGo to next message
philip is currently offline  philip   United States
Messages: 21
Registered: December 2002
Karma: 0
Junior Member
Btw has this been reported to http://bugs.php.net/ and/or has it been solved?
Re: Php Crashing [message #9576 is a reply to message #9575] Fri, 11 April 2003 17:39 Go to previous messageGo to next message
ScooterQ is currently offline  ScooterQ   United States
Messages: 25
Registered: June 2002
Location: Norcross, GA
Karma: 0
Junior Member
I had an open bug report on bugs.php.net about a similar problem (random segfaults on FUDforum index.php) last week, but could never narrow it down to a specific function. I rebuilt PHP and Apache and the random problem disappeared. Within an hour of the bug being closed I discovered this problem, which I could tie to a specific couple of function calls, but I wanted to get some more information before opening another bug. I was hoping to get some help from the FUD developers, but I don't think this ever registered on their radar screens.

I never opened up a new bug with the PHP folks and, as of yet, this issue is still unresolved.
Re: Php Crashing [message #9577 is a reply to message #9576] Fri, 11 April 2003 17:42 Go to previous messageGo to next message
philip is currently offline  philip   United States
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 Go to previous messageGo to next message
ScooterQ is currently offline  ScooterQ   United States
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 Smile, 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 #9579 is a reply to message #5927] Fri, 11 April 2003 19:08 Go to previous messageGo to next message
philip is currently offline  philip   United States
Messages: 21
Registered: December 2002
Karma: 0
Junior Member
Since creating a segfault is in no way a fudforum problem I assume that's the reason for no feedback here. That and the fact that you closed bug #23040 and never updated it saying the segfault still exists, and never updating your comment on how it's not a PHP bug at all but rather an Apache one. Protess closes many bugs at bugs.php.net so most likely went off that.

In the end, most likely you or someone else will rediscover this bug somewhere in PHP land and eventually it'll get fixed. I'm sure if this bug is reopened with a reason that someone will fix it and/or locate the exact cause. Of course you have your reasons and need a forum working for your clients but on the positive side of this bug it means FUDforum is pushing the limits and using PHP features that other packages aren't ;) If you could at least leave what you know now to that bug report that'd be cool and who knows maybe it'll be solved. I'd hate to see all your hard-work go to waste as you obviously put time into this already :)
Re: Php Crashing [message #9580 is a reply to message #9579] Fri, 11 April 2003 19:29 Go to previous messageGo to next message
ScooterQ is currently offline  ScooterQ   United States
Messages: 25
Registered: June 2002
Location: Norcross, GA
Karma: 0
Junior Member
philip wrote on Fri, 11 April 2003 15:08


Since creating a segfault is in no way a fudforum problem I assume that's the reason for no feedback here.


I can reproduce the segfault using the administrative functions
within FUDForum. To quote my original post in this thread:

"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)."

In other words, push button in FUDForum, PHP go boom. That's a problem with both FUDForum and PHP in my book.



Quote:

That and the fact that you closed bug #23040 and never updated it saying the segfault still exists, and never updating your comment on how it's not a PHP bug at all but rather an Apache one. Protess closes many bugs at bugs.php.net so most likely went off that.


I didn't update the bug because I was looking for more information to actually write a decent bug report so that the problem could be addressed. If I re-opened the bug with partial information I wouldn't really be helping as much as potentially taking someone away from another problem that might be more critical. I posted my information here after I discovered that the problem had come back in hopes of getting some help in writing a better bug.

I can see where there may have been some confusion, but I posted my questions here **after** the bug had been marked as closed on bugs.php.net. As soon as I saw that it had been marked closed/bogus I figured I'd better gather some more information before trying to re-open it. Perhaps I was wrong in that assumption, but I wanted to gather more information before proceeding so as to not waste people's time.


Quote:

I'm sure if this bug is reopened with a reason that someone will fix it and/or locate the exact cause.
(snip)
If you could at least leave what you know now to that bug report that'd be cool and who knows maybe it'll be solved. I'd hate to see all your hard-work go to waste as you obviously put time into this already Smile


I jsut saw that you re-opened it for me. Smile I'll try to post more info. If you're able to help in any way I'll be happy to help track down the problem. That's all I was really after in the first place.
Re: Php Crashing [message #9581 is a reply to message #9580] Fri, 11 April 2003 19:46 Go to previous messageGo to next message
philip is currently offline  philip   United States
Messages: 21
Registered: December 2002
Karma: 0
Junior Member
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.

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.

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) :)
Re: Php Crashing [message #9582 is a reply to message #9581] Fri, 11 April 2003 20:01 Go to previous messageGo to next message
ScooterQ is currently offline  ScooterQ   United States
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) Smile


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 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #9612 is a reply to message #9608] Sun, 13 April 2003 14:43 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
nm, found the bug report, I'll look into in when I am in my php hacking mood Wink

FUDforum Core Developer
Re: Php Crashing [message #9640 is a reply to message #9608] Sun, 13 April 2003 15:25 Go to previous messageGo to next message
ScooterQ is currently offline  ScooterQ   United States
Messages: 25
Registered: June 2002
Location: Norcross, GA
Karma: 0
Junior Member
prottoss wrote on Sun, 13 April 2003 10:34

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?


I wholeheartedly agree. It looks like PHP (or more appropriately, **my installation of PHP**) suddenly doesn't like either the flush or the db_lock. I just tried the script again after a recompile (I added zlib and gd to my php config) and the behaviour is the same.

The fact that I'm on an AMD chipset wouldn't be part of the problem, would it? I think I'll go add that to the bug report. Smile

If you need anything from me on this, please don't hesitate to ask.
Re: Php Crashing [message #9643 is a reply to message #9640] Sun, 13 April 2003 15:28 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #9710 is a reply to message #9643] Tue, 15 April 2003 18:09 Go to previous messageGo to next message
ScooterQ is currently offline  ScooterQ   United States
Messages: 25
Registered: June 2002
Location: Norcross, GA
Karma: 0
Junior Member
It looks like they may have fixed it. Here's what I just added to the bug report:

Quote:

I've run the suspect script twice without a seg fault. It looks like you may have fixed it as of php4-STABLE-200304151330.


I'll keep trying to break it again, but everything appears to be okay now. Cool
Re: Php Crashing [message #9711 is a reply to message #9710] Tue, 15 April 2003 19:15 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
I know, I commited the that fixed the problem Wink
Thanks for letting me know that the problem was indeed fixed.


FUDforum Core Developer
Re: Php Crashing [message #9713 is a reply to message #9711] Tue, 15 April 2003 19:32 Go to previous messageGo to next message
ScooterQ is currently offline  ScooterQ   United States
Messages: 25
Registered: June 2002
Location: Norcross, GA
Karma: 0
Junior Member
Can I ask what the problem was?
Re: Php Crashing [message #9715 is a reply to message #9713] Tue, 15 April 2003 19:35 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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
Re: Php Crashing [message #9716 is a reply to message #9715] Tue, 15 April 2003 19:38 Go to previous message
ScooterQ is currently offline  ScooterQ   United States
Messages: 25
Registered: June 2002
Location: Norcross, GA
Karma: 0
Junior Member
Excellent! Thanks for the fix!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: German admin panel?
Next Topic: Here is the dutch translation of the forum
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 16:22:22 GMT 2024

Total time taken to generate the page: 0.02343 seconds