[SVN:r3244] Fatal Unhandled Exception in GameServer

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

[SVN:r3244] Fatal Unhandled Exception in GameServer

Postby Leodagan » Tue Sep 17, 2013 7:50 am

I got trouble with unhandled exception in GameServer that cut off the Log output !
Code: Select all
2013-09-15 22:51:32,971 - [Threadpool worker] - ERROR - DOL.GS.PacketHandler.PacketProcessor - Packet processor: SocketException System.Net.Sockets.SocketException: The socket has been shut down at System.Net.Sockets.Socket.EndSend (IAsyncResult result) [0x00000] in <filename unknown>:0 at DOL.GS.PacketHandler.PacketProcessor.AsyncTcpSendCallback (IAsyncResult ar) [0x00000] in <filename unknown>:0 2013-09-15 22:51:32,971 - [Threadpool worker] - DEBUG - DOL.GS.GameClient - Linkdeath called (bogha69) client state=Playing 2013-09-15 22:51:32,971 - [Threadpool worker] - INFO - DOL.GS.GamePlayer - Player Clerccs(bogha69) went linkdead! 2013-09-15 22:51:32,971 - [Threadpool worker] - FATAL - DOL.GS.GameServer - Unhandled exception! System.Net.Sockets.SocketException: The socket is not connected at System.Net.Sockets.Socket.get_RemoteEndPoint () [0x00000] in <filename unknown>:0 at DOL.Network.BaseClient.get_TcpEndpoint () [0x00000] in <filename unknown>:0 at DOL.Network.BaseClient.OnReceiveHandler (IAsyncResult ar) [0x00000] in <filename unknown>:0
The source of the Unhandled exception is in DOLBase BaseClient.cs around line 227-229
Code: Select all
catch (SocketException e) { if (baseClient != null) { if (Log.IsInfoEnabled) Log.Info(string.Format("{0} {1}", baseClient.TcpEndpoint, e.Message)); baseClient._srvr.Disconnect(baseClient); }
When log tries to display the exception it makes a "get" on TcpEndpoint that throws an other SocketException that is not handled !

the unhandled exception triggers code in GameServer.cs around lines 831-836
Code: Select all
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { log.Fatal("Unhandled exception!\n" + e.ExceptionObject); if (e.IsTerminating) LogManager.Shutdown(); }
Which shut down the LogManager (I don't know why e.IsTerminating is true...)

My Patch is attached, handling possible exception in log displaying.

Can be committed to SVN quickly I think ?
Attachments
BaseClient.cs
(6.81 KiB) Downloaded 21 times
Last edited by Leodagan on Tue Sep 17, 2013 9:23 am, edited 1 time in total.
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Fatal Unhandled Exception in GameServer

Postby Graveen » Tue Sep 17, 2013 9:10 am

yes no problems, you can commit
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Fatal Unhandled Exception in GameServer

Postby Leodagan » Tue Sep 17, 2013 9:23 am

Committed in Revision 3244
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: [SVN:r3244] Fatal Unhandled Exception in GameServer

Postby Dinberg » Tue Sep 17, 2013 12:21 pm

good stuff leo
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: [SVN:r3244] Fatal Unhandled Exception in GameServer

Postby Leodagan » Tue Sep 17, 2013 1:01 pm

Thx Dinberg ;)

I must admit I was tired of loosing my Logs when a player made a bad Link Dead ;)

It makes me almost blind to what could happen on server after the logs are closed !

But maybe it was only triggering on my Mono Runtime ?

By the way I'm gonna post updates to BaseInstance/Instance/{RegionInstance} as this is mostly your work I hope you will give a comment ;)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: [SVN:r3244] Fatal Unhandled Exception in GameServer

Postby Graveen » Tue Sep 17, 2013 4:23 pm

Perhaps, Log4net suffered some troubles with Mono.

Anyway, basically, the code is better.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest