mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
Serialize calls to ODE Collide() function across OdeScene instances to prevent ODE crashes on simulators running more than one region.
It turns out that calls to Collide() are not thread-safe even for objects in different ODE physics worlds due to ODE static caches. For simulators running multiple regions, not serializing calls from different scene loops will sooner or later cause OpenSim to crash with a native stack trace referencing OBBCollider. This affects the default OPCODE collider but not GIMPACT. However, GIMPACT fails for other reasons under some current simulator loads. ODE provides a thread local storage option, but as of ODE r1755 (and r1840) DLLs compiled with this crash OpenSim immediately.
This commit is contained in:
@@ -1048,6 +1048,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
CAPSULE_RADIUS = 0.01f;
|
||||
}
|
||||
|
||||
// lock (OdeScene.UniversalColliderSyncObject)
|
||||
Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH);
|
||||
|
||||
d.GeomSetCategoryBits(Shell, (int)m_collisionCategories);
|
||||
@@ -1179,7 +1180,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
if (Shell != IntPtr.Zero)
|
||||
{
|
||||
// lock (OdeScene.UniversalColliderSyncObject)
|
||||
d.GeomDestroy(Shell);
|
||||
|
||||
_parent_scene.geom_name_map.Remove(Shell);
|
||||
_parent_scene.actor_name_map.Remove(Shell);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user