Page 1 of 1

[FIXED] Link from IRC crashing server

Posted: June 10th, 2012, 4:50 am
by Mc_MrCat
So a little bit ago someone posted a long picture link in irc, and apparently crashed the server. The link was
It was reproduced on a test server after a couple tries posting the link. I'm not sure if it was the length, or some symbols in the link or what. I'm not sure exactly how it crashed it, but I can look into more if needed or requested. (sorry for the short post but I tried to post it before I had to leave)

Re: Link from IRC crashing server

Posted: June 10th, 2012, 11:43 am
by Jonty800
I can confirm that this happens when pasting and pressing enter in the console window.
My memory went from 20mb to 1gb, server crashed and almost crashed my pc.

When pasting into IRC, it seems that the IRC thread becomes unstable; it uses 25% cpu (one core) and the relay is non-responsive (No messages being sent either way).
No bug messages are given.

I'm able to find out whats going on. The minimum amount of that string to be able to recreate the bug was

Code: Select all

http://www.google.com.au/imgres?q=derp&hl=en&client=safari&sa=X&rls=en&biw=961&bih=686&tbm=isch&prmd=imvns&tbnid=ZEoJ8CYFZhUsqM:&imgrefurl=
However, using process of elimination doesn't work. Perhaps its the vast amount of '&'?

Re: Link from IRC crashing server

Posted: June 10th, 2012, 12:55 pm
by Jonty800
The server crashes when there are 21 color changes, whether its irc or not.
However, the above link only has 10 color changes. So that confuses me.

Bug found at:

Code: Select all

13:52:47 > ERROR: IRC: System.Threading.ThreadAbortException: Thread was being aborted.
   at fCraft.LineWrapper.ProcessChar(Byte ch) in C:\Users\Administrator\fCraft\fCraft\Network\LineWrapper.cs:line 148
   at fCraft.LineWrapper.MoveNext() in C:\Users\Administrator\fCraft \fCraft\Network\LineWrapper.cs:line 129
   at fCraft.PlayerEnumerable.Message(IEnumerable`1 source, String message, Object[] formatArgs) in C:\Users\Administrator\fCraft\fCraft\Player\PlayerEnumerable.cs:line 541
   at fCraft.Server.Message(String message, Object[] formatArgs) in C:\Users\Administrator\fCraft\fCraft\System\Server.cs:line 643
   at fCraft.IRC.IRCThread.HandleMessage(String message) in C:\Users\Administrator\fCraft \fCraft\Network\IRC.cs:line 266
   at fCraft.IRC.IRCThread.IoThread() in C:\Users\Administrator\fCraft \fCraft\Network\IRC.cs:line 171
Special thanks to Salzkorn and Kev :P

Re: Link from IRC crashing server

Posted: June 11th, 2012, 6:20 pm
by fragmer
It's a linewrapper bug. I am investigating.

Re: Link from IRC crashing server

Posted: June 12th, 2012, 1:27 am
by fragmer
Line-wrapper safety is restored. I might add an option to strip colorcodes from IRC chat too, while I'm at it. Patch coming soon.
Image

Re: Link from IRC crashing server

Posted: June 14th, 2012, 11:30 am
by fragmer
Fixed in /branch-0.60x/ r1579. Option to strip colors from IRC messages added in /branch-0.60x/ r1580. These fixes are coming in fCraft 0.620 release, very soon.

/branch-0.70x/ has not been updated.

FemtoCraft was also affected, and fixed in r103 (release 1.03).