From dfbfc9826aa67e0c8d04faa5608fb33cc86dd374 Mon Sep 17 00:00:00 2001 From: Snoopy Pfeffer Date: Sun, 6 Nov 2011 15:05:19 +0100 Subject: [PATCH] Damaged assets, especially appearance textures, could crash the region server with a fatal exception. Now, such excpetions are caught by an exception handler and just an error message is shown. This was the kind of exception causing these fatal server crashes: APPLICATION EXCEPTION DETECTED: System.UnhandledExceptionEventArgs^M ^M Exception: System.ArgumentOutOfRangeException: Argument is out of range. Parameter name: offset exceeds the size of buffer at System.Net.Sockets.NetworkStream.BeginRead (System.Byte[] buffer, Int32 offset, Int32 size, System.AsyncCallback callback, System.Object state) [0x00000] in :0 at HttpServer.HttpClientContext.OnReceive (IAsyncResult ar) [0x00000] in :0 ^M ^M Application is terminating: True^M --- OpenSim/Services/AssetService/AssetService.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index 2ea513bd18..b3af8e3015 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs @@ -117,7 +117,15 @@ namespace OpenSim.Services.AssetService return null; } - return m_Database.GetAsset(assetID); + try + { + return m_Database.GetAsset(assetID); + } + catch (Exception e) + { + m_log.ErrorFormat("[ASSET SERVICE]: Exception getting asset {0} {1}", assetID, e); + return null; + } } public virtual AssetBase GetCached(string id)