-
Notifications
You must be signed in to change notification settings - Fork 365
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
Crash inside SAP Broad phase when there is too much collision pairs #262
Comments
Thank you @Elercia - we'll check your suggestion and get back to you. Internal tracking: PX-4920. |
I don't think there is currently a way to prevent this sort of problems. 536 870 912 pairs is too much, and even if we prevent the crash in the broadphase(s) itself, it is likely that some other parts of the pipeline will run out of memory as well immediately afterwards (I am thinking of the "interaction" objects in the "SimulationController" layer for example: they also allocate per-pair object and these ones are much larger than the ones from the broadphase). |
Library and Version & Operating System
PhysX v5.0
Window 10
Steps to Trigger Behavior
I'm sorry but I do not have a clear repro steps to give you. I only have a callstack:
All I know is there is a wrong setup inside one of our scene. The code seems to have moved a lot of objects to the same position resulting to a crash inside
BroadPhaseSap::batchUpdate
.BatchUpdate calls
resizeBroadPhasePairArray
when it needs to add collision pairs. The problem is that in our dump we have 536 870 912 pairs to alloc (newMaxNumPairs value) resulting in an allocation of 4 294 967 296 bytes that is 0 in uint32.Expected Behavior
As said in the documentation here there is a maximum number of contacts that is possible to process.
I understand that broad phase could possibly output more pairs but I believe that there is a limit that can be implemented to discard pairs above a certain point.
You previously suggested in #222 or #226 that we might want to reduce the shape count per actor & do not move this much actors to the same location.
Since there is a clear bug inside of our code, I don't think both of these solutions are applicable. But I believe the code could output an error & drop collisions instead of crashing.
Also, running in debug mode to have warnings & asserts is not suitable since the crash is in an application we are shipping to various people working on the project.
Is it possible to limit the number of output pairs of the broad phase and have an error telling something went wrong?
Thank you for the support!
Actual Behavior
SAP broad phase have no limit of pair output count.
The text was updated successfully, but these errors were encountered: