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

asan warning: alloc-dealloc-mismatch (operator new [] vs operator delete) #16

Closed
larsonmpdx opened this issue Jun 6, 2017 · 2 comments

Comments

@larsonmpdx
Copy link
Contributor

see https://github.com/aws/aws-iot-device-sdk-cpp/blob/master/src/util/logging/FormattedLogSystem.cpp#L72

when it goes out of scope at line 85 the wrong de-allocator is used

the fixed line is:
std::unique_ptr<char[]> outputBuff_uptr = std::unique_ptr<char[]>(new char[requiredLength]); (added array brackets to the types)

there are many other asan warnings when running integration and unit tests (see #15 for instructions). the rest seem to be leaks. generally, valgrind should catch most of these same errors, if you'd prefer to use that

@vareddy-zz
Copy link
Contributor

Hi @larsonmpdx,
Thanks for finding this issue! I have fixed this in our local repo and will be adding it to the list of fixes in the next release. I have also updated our internal repo with the sanitizers and will include that as well.
I will keep this issue open till we have released the next version with the fix.
Please let us know if you find any more issues.
Thanks!
Varun

@vareddy-zz
Copy link
Contributor

Hi @larsonmpdx,
This issue has been fixed in v1.2.0.
Thanks!
Varun

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

2 participants