Hi,
we have a difficult to reproduce crash in our custom vehicle simulation implementation. This crash occurs randomly on the physicsthread when accessing the vehicle simulation component.
We register a custom TSimCallbackObject in begin play and unregister it in endplay. During the callback we reference back to the component which works most of the time, however in seemingly random places the access crashes due to access violations.
We’ve tried various fixes:
- adding a Critical Section
- adding a GC Guard
- adding various weak pointer checks
Is there some way to determine what may cause the pointer to go invalid?
Are there some specialties to consider when accessing UObjects from the physicsthread?
Any help would be appreciated.
Regards,
Max
[Attachment Removed]
Hi Max,
This area can at times be a bit fragile. The physics uses proxies which are essentially copies of the relevant sim data which some pointers to the original data. These can become stale when calling back into the game code if there have been any changes.
What I’d check is
1) If you have CL is 49810206 - if not this may solve the issue, but this isn’t always the cause.
2) Check for any code which is recreating or destroying the physics state (ie changing any physics states) - this will invalidate the handles - stub it out and see if the problem goes away - especially in the constraint handle side.
If that doesn’t help then if you can reproduce it in a vanilla version we can take a dig into it
Best
Geoff Stacey
Developer Relations
EPIC Games
[Attachment Removed]