Skip to content

Conversation

enrico-samknows
Copy link

Fix out-of-bound memory access by using start+size instead of a pointer to the first byte after buffer end.

By using clang AddressSanitizer, I got memory access errors when calling serialize() because the end_ pointer refers to a memory byte that is not owned by anyone (it's actually the first byte after the buffer).
This PR fixes the error for me by using start_ and size_ to track the buffer boundaries.

…ad of a pointer to the first byte after buffer end
@vinniefalco
Copy link
Member

Why doesn't our asan target in CI report this?

@enrico-samknows
Copy link
Author

I used ASAN_OPTIONS=detect_invalid_pointer_pairs=2. Is yours set to 0?

@cppalliance-bot
Copy link

@cppalliance-bot
Copy link

@vinniefalco
Copy link
Member

I used ASAN_OPTIONS=detect_invalid_pointer_pairs=2. Is yours set to 0?

Good question :) If it isn't set to 2 then we should set it to 2. @sdarwin ?

@enrico-samknows
Copy link
Author

Hello, any update on this? Is it worthwhile to you or should I close it?

@vinniefalco
Copy link
Member

Nope don't close this

@grisumbras
Copy link
Member

I fixed all asan failures I've managed to reproduce locally with the options you mentioned. Can you test current develop branch if your failures are reproducible still?

@enrico-samknows
Copy link
Author

I fixed all asan failures I've managed to reproduce locally with the options you mentioned. Can you test current develop branch if your failures are reproducible still?

hello, will I get your changes if I try Boost "Version 1.83.0 beta 1"?

@grisumbras
Copy link
Member

grisumbras commented Jul 31, 2023

hello, will I get your changes if I try Boost "Version 1.83.0 beta 1"?

Yes.

@grisumbras
Copy link
Member

I'm closing this for now. If the problem still occurs, please reopen.

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

Successfully merging this pull request may close these issues.

4 participants