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
iteration_allocator issues #31
Comments
Also remove leak checking completely as it isn't really applicable there. Fixes #31.
Also remove leak checking completely as it isn't really applicable there. Fixes #31.
Stupid oversight on my part, now fixed.
I can't reproduce that, could you provide more information? |
Thanks for the fix 👍 I cannot reproduce the test hanging in release build, because it now SEGFAULTS when copying a custom container which uses an I will try to isolate the problem. |
I've isolated the problem to the following case (with -O2):
Note that the passed
In the second code fragment, the passed |
Thank you I will investigate. |
|
Should be fixed now. |
Sweet, the test now runs fine. Apart from the failure to properly destruct the What techniques did you employ to debug this issue, if I may ask? |
Because that constructor isn't forwarded to the
I first did trial and error (which lead to the insertion of destructor calls, because without them the code is technically UB). This actually fixed an even more simplified example, but not yours. Because it worked fine in debug mode, I used clang's sanitizers there. The undefined behavior sanitizer discovered the alignment issues in small free list which were completely unrelated but had to be fixed. Then the address sanitizer reported a stack-use-after-scope. With that I could simplify everything to something like this: any_std_allocator<int> alloc = make_any_std_allocator<char>(heap_allocator{});
alloc.allocate(1); Because it worked fine with |
Ah, that was the piece of the puzzle I was missing. Thanks for the write-up! |
This might be me, but when exiting a unit test in my project I get the line:
[foonathan::memory] Allocator foonathan::memory::heap_allocator (at 0000000000000000) leaked 16777248 bytes.
Indeed, I use an
iteration_allocator
which allocates 16M for the "initial block" using thedefault_allocator
, which is theheap_allocator
on my system. I cannot discover where this initial block is supposed to be released, since neitheriteration_allocator
norfixed_block_allocator
has a user-defined destructor?Moreover, in release build the unit tests hangs at the very end unless I forcefully terminate with
exit(.)
; might be unrelated though.The text was updated successfully, but these errors were encountered: