From 9ca9770cf69bb148c9509c9dbe2f6c981aec36a5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 25 Jun 2012 00:44:09 +0100 Subject: [PATCH 1/7] fix a seg fault in sp.cs --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a068aab52e..4940063ead 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3570,7 +3570,8 @@ namespace OpenSim.Region.Framework.Scenes // m_reprioritizationTimer.Dispose(); RemoveFromPhysicalScene(); - Animator.Close(); + if(Animator != null) + Animator.Close(); Animator = null; } From fcb34efa95ebdd3200cfb9100329a544c6db658e Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 26 Jun 2012 10:47:35 +0200 Subject: [PATCH 2/7] Prevent bad prim in the database from crashing the sim, list affected ids and skip them. --- OpenSim/Data/MySQL/MySQLSimulationData.cs | 50 +++++++++++++---------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 1999d899c2..5e4df3a37d 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -1269,32 +1269,40 @@ namespace OpenSim.Data.MySQL /// private static TaskInventoryItem BuildItem(IDataReader row) { - TaskInventoryItem taskItem = new TaskInventoryItem(); + try + { + TaskInventoryItem taskItem = new TaskInventoryItem(); - taskItem.ItemID = DBGuid.FromDB(row["itemID"]); - taskItem.ParentPartID = DBGuid.FromDB(row["primID"]); - taskItem.AssetID = DBGuid.FromDB(row["assetID"]); - taskItem.ParentID = DBGuid.FromDB(row["parentFolderID"]); + taskItem.ItemID = DBGuid.FromDB(row["itemID"]); + taskItem.ParentPartID = DBGuid.FromDB(row["primID"]); + taskItem.AssetID = DBGuid.FromDB(row["assetID"]); + taskItem.ParentID = DBGuid.FromDB(row["parentFolderID"]); - taskItem.InvType = Convert.ToInt32(row["invType"]); - taskItem.Type = Convert.ToInt32(row["assetType"]); + taskItem.InvType = Convert.ToInt32(row["invType"]); + taskItem.Type = Convert.ToInt32(row["assetType"]); - taskItem.Name = (String)row["name"]; - taskItem.Description = (String)row["description"]; - taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]); - taskItem.CreatorIdentification = (String)row["creatorID"]; - taskItem.OwnerID = DBGuid.FromDB(row["ownerID"]); - taskItem.LastOwnerID = DBGuid.FromDB(row["lastOwnerID"]); - taskItem.GroupID = DBGuid.FromDB(row["groupID"]); + taskItem.Name = (String)row["name"]; + taskItem.Description = (String)row["description"]; + taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]); + taskItem.CreatorIdentification = (String)row["creatorID"]; + taskItem.OwnerID = DBGuid.FromDB(row["ownerID"]); + taskItem.LastOwnerID = DBGuid.FromDB(row["lastOwnerID"]); + taskItem.GroupID = DBGuid.FromDB(row["groupID"]); - taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]); - taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]); - taskItem.BasePermissions = Convert.ToUInt32(row["basePermissions"]); - taskItem.EveryonePermissions = Convert.ToUInt32(row["everyonePermissions"]); - taskItem.GroupPermissions = Convert.ToUInt32(row["groupPermissions"]); - taskItem.Flags = Convert.ToUInt32(row["flags"]); + taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]); + taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]); + taskItem.BasePermissions = Convert.ToUInt32(row["basePermissions"]); + taskItem.EveryonePermissions = Convert.ToUInt32(row["everyonePermissions"]); + taskItem.GroupPermissions = Convert.ToUInt32(row["groupPermissions"]); + taskItem.Flags = Convert.ToUInt32(row["flags"]); - return taskItem; + return taskItem; + } + catch + { + m_log.ErrorFormat("[MYSQL DB]: Error reading task inventory: itemID was {0}, primID was {1}", row["itemID"].ToString(), row["primID"].ToString()); + throw; + } } private static RegionSettings BuildRegionSettings(IDataReader row) From 2ea8d820b025b6945bde3d84caec9345585c3592 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 26 Jun 2012 10:48:27 +0200 Subject: [PATCH 3/7] Correct a wrong error constant --- OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 278f74e525..ad4f70c21b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -667,7 +667,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public static readonly LSLInteger RCERR_UNKNOWN = -1; public static readonly LSLInteger RCERR_SIM_PERF_LOW = -2; - public static readonly LSLInteger RCERR_CAST_TIME_EXCEEDED = 3; + public static readonly LSLInteger RCERR_CAST_TIME_EXCEEDED = -3; public const int KFM_MODE = 1; public const int KFM_LOOP = 1; From 2548d158783cd15b44cb485c10894740cbdb3efe Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 26 Jun 2012 10:48:52 +0200 Subject: [PATCH 4/7] Disable physics raycast until it can be seen to. Fix distance calculation for some results. --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index fe8511843d..a0dc6cd1b8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -12379,9 +12379,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ContactResult result = new ContactResult (); result.ConsumerID = group.LocalId; - result.Depth = intersection.distance; +// result.Depth = intersection.distance; result.Normal = intersection.normal; result.Pos = intersection.ipoint; + result.Depth = Vector3.Mag(rayStart - result.Pos); contacts.Add(result); }); @@ -12576,7 +12577,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api bool checkPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_PHYSICAL) == ScriptBaseClass.RC_REJECT_PHYSICAL); - if (World.SuportsRayCastFiltered()) + if (false)// World.SuportsRayCastFiltered()) { if (dist == 0) return list; From 9a8de52940ea6d9ce430d8d51094a353eca7d3c5 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 26 Jun 2012 10:49:37 +0200 Subject: [PATCH 5/7] Add an event to the poll service manager thread to allow starting it when needed rather than once per second. That is just too slow! --- .../Servers/HttpServer/PollServiceRequestManager.cs | 7 +++++-- .../Servers/HttpServer/PollServiceWorkerThread.cs | 11 +++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 0062d4ef15..c3e1a79f94 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -41,6 +41,7 @@ namespace OpenSim.Framework.Servers.HttpServer private readonly BaseHttpServer m_server; private static Queue m_requests = Queue.Synchronized(new Queue()); + private static ManualResetEvent m_ev = new ManualResetEvent(false); private uint m_WorkerThreadCount = 0; private Thread[] m_workerThreads; private PollServiceWorkerThread[] m_PollServiceWorkerThreads; @@ -88,15 +89,17 @@ namespace OpenSim.Framework.Servers.HttpServer { lock (m_requests) m_requests.Enqueue(req); + m_ev.Set(); } public void ThreadStart() { while (m_running) { + m_ev.WaitOne(1000); + m_ev.Reset(); Watchdog.UpdateThread(); ProcessQueuedRequests(); - Thread.Sleep(1000); } } @@ -152,4 +155,4 @@ namespace OpenSim.Framework.Servers.HttpServer m_running = false; } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs index 5e171f00f8..b39185fba9 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs @@ -89,9 +89,16 @@ namespace OpenSim.Framework.Servers.HttpServer continue; } - Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); - m_server.DoHTTPGruntWork(responsedata, + try + { + Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); + m_server.DoHTTPGruntWork(responsedata, new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext)); + } + catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream + { + // Ignore it, no need to reply + } } else { From 625041f1db90c5a7f917f52720199ee0088a3141 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 27 Jun 2012 00:10:51 +0200 Subject: [PATCH 6/7] Comment out a spammy message that will spew 4 lines for each request to a nonexistent URL for http-in --- OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index f4cf6b4d98..a701b46db8 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -508,7 +508,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp } else { - m_log.Warn("[HttpRequestHandler]: http-in request failed; no such url: "+urlkey.ToString()); + //m_log.Warn("[HttpRequestHandler]: http-in request failed; no such url: "+urlkey.ToString()); + return; } //for llGetHttpHeader support we need to store original URI here From 29abb7d62af2d45598b077fc9abb3ed11149f414 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 28 Jun 2012 12:20:55 +0100 Subject: [PATCH 7/7] reactivate physics raycasts on llCastRay() until it's clear what is its problem if any... --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 75add29ed2..f475b997c2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -12614,7 +12614,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api bool checkPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_PHYSICAL) == ScriptBaseClass.RC_REJECT_PHYSICAL); - if (false)// World.SuportsRayCastFiltered()) + if (World.SuportsRayCastFiltered()) { if (dist == 0) return list;