-
Notifications
You must be signed in to change notification settings - Fork 86
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
builder page allocation leak and segfault #94
Comments
Fixed, sorry about this. It's an unfortunate off-by-one bug which is triggered on the rare occasion that a build ends up exactly at the end of a 4096 page boundary. I'm a little surprised I never encountered this bug in my own projects; I guess I tend to keep my builds fairly small so my nested builds never roll over a page. I'm having trouble crafting a unit test that will reproduce this. The tests currently set a very small page size to test various wrapping behaviors but this size makes it impossible for a build to be aligned at the end. I'll have to make the page size vary by unit test. I will keep this open until it's properly unit tested. |
Thanks for the very quick fix! |
Your example doesn't trigger the bug in the unit test suite because the unit tests use small page sizes to test various wrapping behaviors. I need to change the unit test runner to make the page size configurable to properly test this. It also needs to be optimized and simplified. The unit test suite is run under Valgrind so unit tests need to be as fast as possible. |
Yes, that was quick. And now, everything works perfectly. Thanks a lot for your great work! |
I think I stumbled over this, using v1.1. I haven't confirmed it, but the problem seems very similar and it was fixed by switching to the develop branch. It would be great, if this could be fixed with a new stable release. |
Release v1.1.1 is out. Sorry for the delay. I'll leave this open because I still want to improve the unit tests for this. |
hi, I ran into a segfault with the following code:
At the end of the 5th outer loop, the call to
mpack_complete_map()
will corrupt the internal memory of the builder, resulting in a segfault. Some mild debugging traced the issue back to the page allocation mechanism. According to the logs, we might be freeing one page and using the next without initializing it.The problem vanishes when writing different integer values. It seems to be triggered only by very specific alignment conditions.
I would appreciate it ,if you could confirm the findings or give me a clue of any mismatching calls in my code. Thanks!
The text was updated successfully, but these errors were encountered: