Crash PhysX 3.3.1

I have a crash in the following scenario:

  1. initialize PhysX
create pxRigidDynamic0
create collision shape pxCollisionShape0
pxRigidDynamic0 -> attachShape(pxCollisionShape0)
add pxRigidDynamics0 to scene
create pxRigidDynamic1
create collision shape pxCollisionShape1
pxRigidDynamic1 -> attachShape(pxCollisionShape1)
add pxRigidDynamics1 to scene
pxFixedJoint0 = PxFixedJointCreate(	*m_pxPhysicsEngine,
  1. simulate()/fetchResults(true) several times
  2. simulate()
joint -> setActors(pxRigidDynamic0, NULL)
joint -> setLocalPose(physx::PxJointActorIndex::eACTOR0, physx::PxTransform::createIdentity())
joint -> setLocalPose(physx::PxJointActorIndex::eACTOR1, physx::PxTransform::createIdentity())

pxRigidDynamic1 -> dettachShape(pxCollisionShape1)
pxRigidDynamic1 -> release()
  1. fetchResults(true)

Crash in fetchResults() with: “Access violation reading location 0x00000000.”
Tried to LockWrite/UnlockWrite during section 7 - the same problem.

I’m using PhysX 3.3.1, Windows 7 x64(but my application is x86)

Many thanks for the repro. This is indeed a bug. We’re working on fixing this for 3.3.3.

The problem is caused by the combination of joint->setActors and actor->release while the simulation is running. A workaround would be to defer any one of those calls to after fetchResults.