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

allocator_test fails - alloc-dealloc-mismatch #111

Open
npmadhu opened this issue Jan 23, 2016 · 0 comments
Open

allocator_test fails - alloc-dealloc-mismatch #111

npmadhu opened this issue Jan 23, 2016 · 0 comments

Comments

@npmadhu
Copy link

npmadhu commented Jan 23, 2016

allocator_test fails - the problem is that new uses posix_memalign to allocate - the unique_ptr uses std::delete - solution is to use a custom deleter for unique_ptr.

AddressSanitizer output
==2551==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete []) on 0x60900000d780
#0 0x7fa1424d502a in operator delete (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9a02a)

#1 0x41375c in std::default_delete<char []>::operator()(char*) const (/home/seamaster/seastar/build/debug/tests/allocator_test_g+0x41375c)
#2 0x40f7d4 in std::unique_ptr<char [], std::default_delete<char []> >::~unique_ptr() (/home/seamaster/seastar/build/debug/tests/allocator_test_g+0x40f7d4)

fix - diff attached.
allocator_test.txt

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