-
-
Notifications
You must be signed in to change notification settings - Fork 280
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 due to tree travesal depth exceeding 256 #354
Comments
Sorry for slowness! A brief response now:
|
@RossNordby No worries, take your time!
|
A repro would be very nice if you find the time! Another user was encountering something that smelled similar, but struggled to find a reliable repro. And yes, would definitely also like to actually-fix the overrun! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! It's me again after long time.
I bring you yet another issue stemming from user generated content x3
Recently certain world/items started causing hard crashes. I've narrowed it down due to a tree traversal depth being deeper than 256, causing stack to be stomped over here:
bepuphysics2/BepuPhysics/Trees/Tree_VolumeQuery.cs
Line 41 in ec5082f
I've added workaround on our end by increasing the traversal depth to 1024, which fixed the issue with the specific content, but this only "delays" the issue, rather than fully solving it.
The code there alludes to explicitly tracked depths - is that something you'd be willing to prioritize at some point?
I'm not sure what the proper handling on our end would be - with user generated content, people can setup colliders in a way that will exceed the limit of 1024 as well (or whatever value we set it to) - we need to be able to handle it more gracefully than making the stack explode.
Would the system see if the depth is excessive and just allocate the list on heap? Meaning it'll be less efficient, but things being slower is better than everything crashing?
Or set some hard limit, above which the bodies will be ignored? Though that feels worse, because it'll cause odd issues, where some colliders randomly don't work.
The text was updated successfully, but these errors were encountered: