Skip to content
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

Stackoverflow in SubtreeInsert when adding too many shapes to a space. #231

Open
viblo opened this issue Dec 21, 2022 · 0 comments
Open

Comments

@viblo
Copy link

viblo commented Dec 21, 2022

When I add too many shapes to a space I get a stack overflow happening in SubtreeInsert in cpBBTree.c. Looks like its because SubtreeInsert which inserts items into the tree is recursive and the tree depth becomes to big.

When I test this on my Windows machine I can add between 10000 to 50000 shapes before it overflows. I am not sure if it has any practical usage to have that many shapes, but maybe a simple compromise would be to limit the amount of shapes in the tree structure with an assert instead of crashing with stack overflow?

A user of Pymunk reported this some time back in viblo/pymunk#168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant