SimplePortal

Support => English Support => Topic started by: azunai on December 19, 2009, 03:24:19 PM

Title: shoutbox lets crash webserver/php
Post by: azunai on December 19, 2009, 03:24:19 PM
hey, ok the last 3 days were like hell -.-
problem occured: forums index page was just blank
apache went to 100%cpu + 900mb ram usage
load ~ 30

after google was my best friend for 1 day i resigned on apache and installed nginx
and since today i tried everything to get my forum back online
my forums database was spammed with errors 2.000.000 entrys  but all sensless (login failed and so on)
produced in 2 or 3 hours

and now, i found the problems source, i installed a fresh smf v1.1.11 and installed the simple portal 2.3.1 package, guess what happend -.- blank index, 100%cpu everything f***ed up

i dont get why, cause im using simple portal for month now

do you have any ideas? or hints to get it back to work?

greetings

www.gamerevision.com

edit: haha got deeper, seems to be the shoutbox
edit2: hm a new shoutbox works, strange
edit3!!!!!!!!
found the bug!!!!!!!

just paste "bla-email@web.de" into a sp 2.3.1 sb and everything crashes

edit4: paste any email adress into the sb and it crashs :(
checkin why atm

Edit-> Removed obscene language
Title: Re: shoutbox lets crash webserver/php
Post by: azunai on December 20, 2009, 01:02:48 PM
fixed!

simpyl added

Code: [Select]
$shout = str_replace("@","(at)",$shout);in line 1354 in Subs-Portal.php Source dir

Title: Re: shoutbox lets crash webserver/php
Post by: Nathaniel on January 01, 2010, 10:03:04 PM
There are currently unresolved issues with the parse_bcc function being used within the shoutbox, stopping email addresses from being parsed removes many of the performance issues.

Here is the fix being used at SimplePortal.net (from Sinan):
Sources/Subs.php

Code: (Find) [Select]
$disabled, $parse_tag_cache;
Code: (Replace) [Select]
$disabled, $default_disabled, $parse_tag_cache;
Code: (Find) [Select]
if ($parse_tags !== array() && is_array($parse_tags))
{
$temp_bbc = $bbc_codes;
$tags_cache_id = implode(',', $parse_tags);

if (isset($parse_tag_cache[$tags_cache_id]))
$bbc_codes = $parse_tag_cache[$tags_cache_id];
else
{
foreach ($bbc_codes as $key_bbc => $bbc)
foreach ($bbc as $key_code => $code)
if (!in_array($code['tag'], $parse_tags))
unset($bbc_codes[$key_bbc][$key_code]);

$parse_tag_cache = array($tags_cache_id => $bbc_codes);
}
}

Code: (Replace) [Select]
if ($parse_tags !== array() && is_array($parse_tags))
{
$temp_bbc = $bbc_codes;
$tags_cache_id = implode(',', $parse_tags);

if (!isset($default_disabled))
$default_disabled = isset($disabled) ? $disabled : array();

if (isset($parse_tag_cache[$tags_cache_id]))
list ($bbc_codes, $disabled) = $parse_tag_cache[$tags_cache_id];
else
{
foreach ($bbc_codes as $key_bbc => $bbc)
foreach ($bbc as $key_code => $code)
if (!in_array($code['tag'], $parse_tags))
{
$disabled[$code['tag']] = true;
unset($bbc_codes[$key_bbc][$key_code]);
}

$parse_tag_cache = array($tags_cache_id => array($bbc_codes, $disabled));
}
}
elseif (isset($default_disabled))
$disabled = $default_disabled;
Title: Re: shoutbox lets crash webserver/php
Post by: steve51184 on February 10, 2010, 06:16:01 AM
There are currently unresolved issues with the parse_bcc function being used within the shoutbox, stopping email addresses from being parsed removes many of the performance issues.

Here is the fix being used at SimplePortal.net (from Sinan):
Sources/Subs.php

Code: (Find) [Select]
$disabled, $parse_tag_cache;
Code: (Replace) [Select]
$disabled, $default_disabled, $parse_tag_cache;
Code: (Find) [Select]
if ($parse_tags !== array() && is_array($parse_tags))
{
$temp_bbc = $bbc_codes;
$tags_cache_id = implode(',', $parse_tags);

if (isset($parse_tag_cache[$tags_cache_id]))
$bbc_codes = $parse_tag_cache[$tags_cache_id];
else
{
foreach ($bbc_codes as $key_bbc => $bbc)
foreach ($bbc as $key_code => $code)
if (!in_array($code['tag'], $parse_tags))
unset($bbc_codes[$key_bbc][$key_code]);

$parse_tag_cache = array($tags_cache_id => $bbc_codes);
}
}

Code: (Replace) [Select]
if ($parse_tags !== array() && is_array($parse_tags))
{
$temp_bbc = $bbc_codes;
$tags_cache_id = implode(',', $parse_tags);

if (!isset($default_disabled))
$default_disabled = $disabled;

if (isset($parse_tag_cache[$tags_cache_id]))
list ($bbc_codes, $disabled) = $parse_tag_cache[$tags_cache_id];
else
{
foreach ($bbc_codes as $key_bbc => $bbc)
foreach ($bbc as $key_code => $code)
if (!in_array($code['tag'], $parse_tags))
{
$disabled[$code['tag']] = true;
unset($bbc_codes[$key_bbc][$key_code]);
}

$parse_tag_cache = array($tags_cache_id => array($bbc_codes, $disabled));
}
}
elseif (isset($default_disabled))
$disabled = $default_disabled;

so what does this do? does it fix the problem? and is it now safe to use the shoutbox with this edit?
Title: Re: shoutbox lets crash webserver/php
Post by: Nathaniel on February 10, 2010, 06:22:42 AM
Please do not double post.

That edit stops the error from occuring, by stopping SMF from parsing email addresses within the shoutbox. Normally it would turn them into an email link.
Title: Re: shoutbox lets crash webserver/php
Post by: steve51184 on February 10, 2010, 06:25:23 AM
Please do not double post.

That edit stops the error from occuring, by stopping SMF from parsing email addresses within the shoutbox. Normally it would turn them into an email link.

i didn't double post... anyways this is a 100% fix 'will never happen again' thing?
Title: Re: shoutbox lets crash webserver/php
Post by: Nathaniel on February 10, 2010, 06:33:20 AM
Please do not double post.

That edit stops the error from occuring, by stopping SMF from parsing email addresses within the shoutbox. Normally it would turn them into an email link.

i didn't double post... anyways this is a 100% fix 'will never happen again' thing?

You posted the same question in two separate topics. Anyway, yes, this edit should fix the problem. There is never a !00% chance that it will never happen again, but this same solution has worked for other people, so there is no reason why it should not work for you.
Title: Re: shoutbox lets crash webserver/php
Post by: steve51184 on February 10, 2010, 06:38:03 AM
thank you

also why is this not included with SP?
Title: Re: shoutbox lets crash webserver/php
Post by: Nathaniel on February 10, 2010, 06:52:40 AM
Because there hasn't been a SP bugfix release since this bug was first discovered.
Title: Re: shoutbox lets crash webserver/php
Post by: steve51184 on February 10, 2010, 07:03:32 AM
Because there hasn't been a SP bugfix release since this bug was first discovered.

seems like it needs to be fixed to me :\
Title: Re: shoutbox lets crash webserver/php
Post by: steve51184 on February 10, 2010, 02:20:07 PM
tht code/fix has some problems: all images are showing all weird (out of line) and quotes aren't working... how do i fix this?
Title: Re: shoutbox lets crash webserver/php
Post by: steve51184 on February 10, 2010, 05:40:37 PM
any ideas about my last post?
Title: Re: shoutbox lets crash webserver/php
Post by: steve51184 on February 10, 2010, 06:57:51 PM
fixed!

simpyl added

Code: [Select]
$shout = str_replace("@","(at)",$shout);in line 1354 in Subs-Portal.php Source dir

where exactly do i add this? (ie. before/after what?)
Title: Re: shoutbox lets crash webserver/php
Post by: steve51184 on February 15, 2010, 09:10:26 PM
tht code/fix has some problems: all images are showing all weird (out of line) and quotes aren't working... how do i fix this?

hate to quad post but i did wait almost a week..

anyway that fix messes up all my images and stops quotes from showing so i had to take it off so can you fix that please as if anyone posts an email address my server will crash lol
Title: Re: shoutbox lets crash webserver/php
Post by: steve51184 on February 21, 2010, 08:58:32 AM
6th bump please reply :(
Title: Re: shoutbox lets crash webserver/php
Post by: Nathaniel on February 23, 2010, 03:32:35 PM
The fix in the post below should work:
http://simpleportal.net/index.php?topic=4126.msg26219#msg26219

Check that you have applied it correctly.
Title: Re: shoutbox lets crash webserver/php
Post by: steve51184 on February 23, 2010, 04:22:08 PM
The fix in the post below should work:
http://simpleportal.net/index.php?topic=4126.msg26219#msg26219

Check that you have applied it correctly.

i did but it didn't work :(
Title: Re: shoutbox lets crash webserver/php
Post by: steve51184 on February 23, 2010, 05:02:30 PM
replied here:

http://simpleportal.net/index.php?topic=4168.msg28682#msg28682
Title: Re: shoutbox lets crash webserver/php
Post by: ibrrorg on February 28, 2010, 07:50:57 AM
Didn't know whether to post here or start afresh, so opted to post here as the issue was identical.

So, this is the (http://simpleportal.net/index.php?topic=4711.0) post that started it all for me.  Portal is stable again, but I cannot implement the shoutbox even following the fix SiNaN suggests here (http://simpleportal.net/index.php?topic=4126.0) doesn't seem to fix it.

I want to get a little deeper, though.  SMF 2.0 RC2, SP 2.3.1, Curve/Default theme, my site is here (http://ibrr.org/forum).  So, simply loading the shoutbox crashes/locks down my system.  Goes back to the original reasons why I had to pull it.  Is this a SMF or SP issue and is there hope for a fix any time soon?
Title: Re: shoutbox lets crash webserver/php
Post by: [SiNaN] on February 28, 2010, 10:50:27 AM
ibrrorg, that fix would have fixed the issue. Can you provide me an admin account and FTP access via pm? I could check it for you.
Title: Re: shoutbox lets crash webserver/php
Post by: ibrrorg on March 01, 2010, 08:24:28 AM
ibrrorg, that fix would have fixed the issue. Can you provide me an admin account and FTP access via pm? I could check it for you.

Sure, I'll PM all the info to you.  Be advised I rolled back the changes that this thread advised to make as I wasn't sure if they would impact stuff in the future.

I woul've PM'd the info, but I have no way to as the option does not appear for me.  So, ibrrorg@gmail.com is my email.  Ping me and I'll get it to ya!

Thanks for taking the time to look around and I would appreciate any guidance!
Title: Re: shoutbox lets crash webserver/php
Post by: ibrrorg on March 03, 2010, 04:16:19 PM
So, I am still patiently waiting on you to respond.  Do I simply need to hire this out?  I mean several days ago you offered to help me and now you don't seem interested.  Please advise as I would like to get it done and I have been unable to use the chat feature in your software for awhile now.
Title: Re: shoutbox lets crash webserver/php
Post by: [SiNaN] on March 03, 2010, 04:21:24 PM
It is not that I'm not interested. Just I didn't have the time. I'll probably go over the support topics tomorrow. You can send me an e-mail at mehmed@samanyolufanlari.com if you can't pm me over here.
Title: Re: shoutbox lets crash webserver/php
Post by: ibrrorg on March 03, 2010, 05:00:50 PM
Will do.  Simply appreciate you taking the time to look at it.  I wasn't sure what was going on.

I will send you all the contact info and take your time as I am thankful!
Title: Re: shoutbox lets crash webserver/php
Post by: Renegd98 on March 03, 2010, 05:57:23 PM
I had the exact same issue. I applied the fix and it works fine so ensure you have applied the fix correctly.
Title: Re: shoutbox lets crash webserver/php
Post by: ibrrorg on March 05, 2010, 09:36:45 AM
I had the exact same issue. I applied the fix and it works fine so ensure you have applied the fix correctly.

Hmnn, let's see:  cut, copy, paste using cPanel View.  It isn't rocket science.  Did it yet again and my system crashed YET AGAIN!  Reverted the code back and deleted chat and no problems.  This isn't on my end.  I just find it really odd that this error hit so many folks at the same time w/o any particular rationale.

Sent the admin details to SiNaN two days ago (can't PM so it was sent to your attached email) so I will write back if it gets fixed or hire it out.  Either way it is frustrating.
Title: Re: shoutbox lets crash webserver/php
Post by: ibrrorg on March 06, 2010, 07:33:00 AM
I have changed my cPanel as I can no longer risk the info in your custody SiNaN.  I feel five (05) days were long enough to look at something.  I'll hire out a temp fix and change portals when Dream comes out.

Perhaps it's an age difference; I was willing to pay and you said no you'll do it for free and then expected me to leave a Cpanel password out in the open for days on end.

Thanx for the help.
Title: Re: shoutbox lets crash webserver/php
Post by: [SiNaN] on March 06, 2010, 07:56:31 AM
Real life gets in the way unfortunately. I only have access to internet at school and the time is very limited. A great majority of the code of SimplePortal was coded in those school computers BTW. And it has been more than a week since the last time I could make it to my home before the midnight.

I can understand how you feel and I'm sorry I couldn't help. I hope you can find someone to fix it for you. You could also check the Donator Program (http://simpleportal.net/index.php?topic=1258.0). Although it is not an offical promise, they all got responses within 24 hours and all of them had their issues fixed. And good luck with your new system, if you are changing portals. ;)
Title: Re: shoutbox lets crash webserver/php
Post by: Chen Zhen on March 06, 2010, 10:05:29 AM

ibrrorg - when receiving free assistance, I would caution on the side of patience. Competent people that freely offer their time are rewarded solely with the satisfaction of helping others. 
Since I see that the issue was resolved for some people with the given fix, I am hazarding a guess that you in fact did not apply the code properly.
Why not try another option... Disable the Simple Portal shoutbox and install the yshout that it is based on. A simple edit to your all your themes index templates and adding a php block is all that is necessary. This is how mine is set up and I have no issues with it at all (plus my error log is clean).

Here is a link:  CLICK HERE (http://askusaquestion.net/index.php/board,35.0.html)

This version has most of the same features less the displayed bbc's and sound. (bbc works just no button to display them)

The link I gave you includes the package and instructions on how to edit it for portal block installs.

If you need guidance to work this with Simple Portal just leave me a PM here or on my site.
This version has a multiple style edit for the purpose of side blocks (via part or all of url).
If you are going to use side blocks for this mod I suggest setting it to reverse.

UD

Title: Re: shoutbox lets crash webserver/php
Post by: azunai on March 24, 2010, 11:09:05 AM
well if the fix doesnt work for you, try my temp solution
its just 1 line to add

http://simpleportal.net/index.php?topic=4126.msg25882#msg25882
Title: Re: shoutbox lets crash webserver/php
Post by: leftezi on July 14, 2010, 06:34:06 AM
Question:
Is this issue solved in the new SP 2.3.2 in combination with SMF2 RC3 ??
Title: Re: shoutbox lets crash webserver/php
Post by: Melegna on August 07, 2010, 09:49:22 AM
Question:
Is this issue solved in the new SP 2.3.2 in combination with SMF2 RC3 ??

Just happened a crash in that combination, so it isn't solved, even if the code in Subs.php is now right as in the below post.
SimplePortal 2.3.8 © 2008-2024, SimplePortal