News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

nneonneo's Shoutbox

Started by nneonneo, December 26, 2006, 06:58:11 PM

Previous topic - Next topic

nneonneo

@mwmconsulting: Possibly a problem with the chmod permissions on yshout.php...try chmod 755 or chmod 700 on yshout.php (or use the Repair Permissions (across all files) in Package Manager)
@ekfaysal: many possible causes; easiest way to diagnose is to give me a board URL.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

mwmconsulting

Quote@mwmconsulting: Possibly a problem with the chmod permissions on yshout.php...try chmod 755 or chmod 700 on yshout.php (or use the Repair Permissions (across all files) in Package Manager)

Yep, tried that one nneonneo.  Didn't work.  But the file permissions on a PHP file shouldn't matter.  As long as readable by webserver acct.

I don't suppose you have your own dev / test forum that you could install these two mods on?  That way, you would see first hand the errors and such being generated...

Definitely traced it down to the Db_Query call, but not sure why yshout doesn't like it...

- MWM
========================
MWM Consulting, Inc.
InSiteful Business Solutions
http://www.mwmconsulting.biz
========================

nneonneo

I do in fact have a test forum (http://nneonneo.ath.cx/advforums/guinea_smf) but I don't have FlashChat, so I can't properly test (what's the point if the DB and files don't exist?)
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

mwmconsulting

I don't think you need FlashChat to see the problem nneonneo...

Simply edit your Subs.php file, and on line 3195 add the following code:

$result = db_query("SELECT * FROM smf_attachments", __FILE__, __LINE__);

Or you can select from another table if you'd like.  The point is that yshout will eventually call that query upon loading and will fail as it is doing for me.

You'll then see the errors for yourself.

;)
========================
MWM Consulting, Inc.
InSiteful Business Solutions
http://www.mwmconsulting.biz
========================

nneonneo

#644
There is in fact a bug! (and kudos to you for discovering it).

SMF has a bug. If any DB errors occur in the function setupThemeContext() (or template_header() which calls setupThemeContext()), an infinite recursion will result!
Call stack (as shown by debug_backtrace()):

obExit()
fatal_error()
db_error()
db_query()
setupThemeContext()
template_header()
obExit()
fatal_error()
db_error()
db_query()
setupThemeContext()
template_header()
[...loops several *thousand* times more...]
db_query()
setupThemeContext()
[SSI.php main context]
[yshout.php main context]

Basically, the six functions noted actually loop recursively and cause massive failure.
On my server, this is represented in the error log with the line
[notice] child pid 4180 exit signal Illegal instruction (4)
which, in PHP's case, usually means a stack overflow (usually infinite recursion)
In the case of the code snippet you posted, the reason for db_error to be called in the first place was an innocent "no database selected" error...
... and that would be the same reason for FlashChat.

Why? Why would it fail so miserably? It is because no database is actually selected by SSI.php!
This is because it instead prepends the database name onto the prefix (if the prefix contains no periods)! FlashChat's code *assumes* that the database is already selected (via mysql_select_db).

Fix? Easy -- on line 76 of SSI.php change
if(strpos($db_prefix, '.') === false)
to
if(false && strpos($db_prefix, '.') === false)
and all will be solved.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

mwmconsulting

Hey Hey HEY!

That indeed fixed the problem nneonneo!  Excellent debugging on your part.

Well, hopefully others will receive benefit from your sleuthing work as well.  ;)

Bravo!  Bravo!!!  8)

Onwards and upwards I say...

- MWM
========================
MWM Consulting, Inc.
InSiteful Business Solutions
http://www.mwmconsulting.biz
========================

bobbbb

Wow! I just discovered this problem yesterday and there is already a solution posted by nneonneo! Awesome!

calicojackal

Ok I tried to figure out how to fix this on my own and can not figure it out. My shoutbox loads but has nothing there. I will post a link to the site. I hope someone can help me fix this. I had to manually install the SB because our dedicated server has problems with allowing ftp access for some reason. I will also post the server error log incase that is what is needed to fix the problem.

The website link is http://mydamnfurrysite.com [nofollow]

the error log is as follow:

[Fri Jun 08 07:27:52 2007] [error] [client 75.183.42.144] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required '/var/www/vhosts/mydamnfurrysite.com/httpdocs/yshout/../SSI.php' (include_path='.:') in /var/www/vhosts/mydamnfurrysite.com/httpdocs/yshout/yshout.php on line 36, referer: http://mydamnfurrysite.com/index.php?topic=9.msg2627;boardseen [nofollow]

brianjw

Ok, I am really tired. I think I've seen the same problem like 1500 times. Try using the search here and search IN THIS TOPIC for your answer by using the search on this page :)

nneonneo

Odd, calico, are there any other errors? This error sounds like the SSI.php file isn't loading for some reason.

What other mods are installed?
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

calicojackal

the only other mod that is installed is a cash shop mod.

nneonneo

OK, which one? There are many cash shop mods.
Also, does anything relating to SSI.php show up in either a) the webserver error log or b) the forum error log?
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

calicojackal

Ok well I get these three error lines over and over again since I manually installed the SB.
[Fri Jun 08 21:11:56 2007] [error] [client 123.100.34.103] PHP Warning: require() [<a href='function.require'>function.require</a>]: SAFE MODE Restriction in effect. The script whose uid is 1008 is not allowed to access /var/www/vhosts/mydamnfurrysite.com/httpdocs/yshout/../SSI.php owned by uid 10001 in /var/www/vhosts/mydamnfurrysite.com/httpdocs/yshout/yshout.php on line 36, referer: http://mydamnfurrysite.com/index.php [nofollow]
[Fri Jun 08 21:11:56 2007] [error] [client 123.100.34.103] PHP Warning: require(/var/www/vhosts/mydamnfurrysite.com/httpdocs/yshout/../SSI.php) [<a href='function.require'>function.require</a>]: failed to open stream: Success in /var/www/vhosts/mydamnfurrysite.com/httpdocs/yshout/yshout.php on line 36, referer: http://mydamnfurrysite.com/index.php [nofollow]
[Fri Jun 08 21:11:56 2007] [error] [client 123.100.34.103] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required '/var/www/vhosts/mydamnfurrysite.com/httpdocs/yshout/../SSI.php' (include_path='.:') in /var/www/vhosts/mydamnfurrysite.com/httpdocs/yshout/yshout.php on line 36, referer: http://mydamnfurrysite.com/index.php [nofollow]


Also the cash shop mod I manually installed is SMFShop_3-0_Fresh_Install.

calicojackal

Oh I also use the X7 forum chat system.

nneonneo

How did you install the SB without FTP access?

You must uninstall it and install the script using Package Manager, or however you installed the rest of the forum.

The indicated error arises from a "file ownership" conflict -- the shoutbox and the SMF files are owned by different users (one's the webserver, the other probably the FTP/remote user). PHP has safe mode enabled, which prevents the scripts from communicating, which in turn means yshout cannot function.

Please install the script with Package Manager if at all possible, or however you managed to install the shop mod and the forum.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

calicojackal

Thanks for the advice. I manually installed the shop mod because package manager can not access the ftp for some reason and our dedicated server support will not help because they say its a problem on the smf side. I disabled php safe mode and it seems to work now. Thanks for all the help.

nneonneo

No problem; glad it works.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

carlito

#657
--solved. Cleared cache, closed, opened and voile.

I have installed in www.skifun.gr/forum [nofollow] and with ie works like a charm, with firefox worked for few messages, now nothing appears. Anybody has a good idea ?

brianjw

@nneonneo: Eventually you're gonna want to move all support to your website as you need an entire board for this big of a mod ;)

bobbbb

Quote from: nneonneo on June 02, 2007, 11:03:33 PM
There is in fact a bug! (and kudos to you for discovering it).

SMF has a bug. If any DB errors occur in the function setupThemeContext() (or template_header() which calls setupThemeContext()), an infinite recursion will result!
Call stack (as shown by debug_backtrace()):

obExit()
fatal_error()
db_error()
db_query()
setupThemeContext()
template_header()
obExit()
fatal_error()
db_error()
db_query()
setupThemeContext()
template_header()
[...loops several *thousand* times more...]
db_query()
setupThemeContext()
[SSI.php main context]
[yshout.php main context]

Basically, the six functions noted actually loop recursively and cause massive failure.
On my server, this is represented in the error log with the line
[notice] child pid 4180 exit signal Illegal instruction (4)
which, in PHP's case, usually means a stack overflow (usually infinite recursion)
In the case of the code snippet you posted, the reason for db_error to be called in the first place was an innocent "no database selected" error...
... and that would be the same reason for FlashChat.

Why? Why would it fail so miserably? It is because no database is actually selected by SSI.php!
This is because it instead prepends the database name onto the prefix (if the prefix contains no periods)! FlashChat's code *assumes* that the database is already selected (via mysql_select_db).

Fix? Easy -- on line 76 of SSI.php change
if(strpos($db_prefix, '.') === false)
to
if(false && strpos($db_prefix, '.') === false)
and all will be solved.

Hello nneonneo, I tried this fix but it didn't work. I still get these errors in my error logs:

SUEXEC error_log:
[2007-06-11 13:31:57]: info: (target/actual) uid: (X/X) gid: (X/X) cmd: yshout.php

X = server user name

My website runs fast though... I don't think this error really affects anything. Does it? Any suggestions as to why your fix didn't work in my case?

Thank you again so much for your help!

Advertisement: