-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unstable AABBPruner that crashes all the time. #339
Comments
Do you really need the sceneQueriesUpdate() / fetchQueries() / flushSimulation() calls ? Usually people just do simulate() / fetchResults(). And no such crash has been reported before, so I suspect this is caused by this somewhat unusual setup. |
FWIW I tried adding these 3 extra calls in my test framework and didn't see any crash so far. Can you try without eREQUIRE_RW_LOCK ? I usually don't use manual locks. The callstack seems to indicate a crash inside the user-allocator. Could you perhaps post that code here? Is there any possibility that you could be allocating and deallocating memory from different DLLs, and therefore possibly from different CRTs? |
Today I made a breakthrough xD It was crashing due to the very same shape being attached to the actor. Maybe there should be some assert or something on the checked build.... IMHO stuff like this should be gracefully handled or at least reported as wrong API behaviour instead of randomly crashing and stomping memory internally. |
I am not following. Can you explain what you mean, "the very same shape being attached to the actor" ? I agree that regular usage of the API should not crash, and instead produce an error. But I am not sure what it is you did exactly that triggered a crash. For example it is legal to attach the same shape to multiple actors if they are not created with the exclusive flag. |
I had a pool of shapes that can be shares between actors. If all parameters are equal - size, type, material etc, then o actors can get the same shape. |
Library and Version
PhysX v5.4.2 (checked with 5.3.x as well - same issue)
Operating System
Windows 11
Hey!
Im experiencing a 100% crash in library internals. Usually happens in AABBPruner, from different callstacks, like addActors, removeActors, sometimes from raycasts or anything that touched pruner.
My use case:
Im developing open world game, and I'm streaming sectors of "collision cache". Each collision cache have a list of shapes and actors. Shapes can be shared between actors and between sectors as well. That essentially reduces shapes count to <300 that are used for around 2K actors. So those numbers aren't crazy at all.
Side note: I used to have binary serialization of collection containing exactly the same set of data, but found that manual creation of shapes and actors have no perf penalty and sector blob is no 500kB but 20kB. But issue happened with binary serialized collections as well so that not the case.
Checked refcounts of all shapes and actors - looks correct, no leaking or double release.
Each sector schedule add or remove for physics scene. And each frame I'm limiting amount of actors added to 100 and removed/released to 50.
Im working with Checked build, no asserts or any warnings detected. Release build crashes as well.
PxSceneFlag::eREQUIRE_RW_LOCK is enabled, so everytime I'm modifying anything in scene Im using proper Scope(Write/Read)Locks.
Sectors contain mostly simple primitive shapes. Tested without TriangleMeshes for complex shapes, but no change.
Overall noting super custom or fancy.
Simulation loop
What I tried
Any suggestions ? :) Its starts to be a blocker for our company, as whole team experiences those crashes.
All help would be appreciated as m chasing this for a week now ;)
The text was updated successfully, but these errors were encountered: