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

LSan error "Unmatched call to __lsan_enable()" is incredibly vague #1758

Open
mchristoff opened this issue May 22, 2024 · 0 comments
Open

LSan error "Unmatched call to __lsan_enable()" is incredibly vague #1758

mchristoff opened this issue May 22, 2024 · 0 comments

Comments

@mchristoff
Copy link

Using LSan's provided interface in lsan_interface.h, we attempted to use the __lsan_enable() call at the beginning of the program to assure that it was turned on if it was turned off by some infrastructure previously. This, however, resulted in this error message:
==2100623==Unmatched call to __lsan_enable().
This error message, however, is very vague. There isn't any official documentation for this API, so this combined with the non-descriptive error message led to a lot of headache.

For one, it isn't obvious this error messages comes out of LSan from a glance. Second, there isn't any description of how the issue could be fixed. If, for instance, it instead said:
==2100623==Unmatched call to __lsan_enable() without corresponding call to __lsan_disable().
or something along those lines, that would be much more descriptive and actually point to a solution. This would also make it clear the error message is coming out of LSan rather than something else.

As a note, the only other indication that there needs to be a matching pair of calls is this comment in lsan_interface.h:

// Allocations made between calls to __lsan_disable() and __lsan_enable() will
// be treated as non-leaks. Disable/enable pairs may be nested.
void SANITIZER_CDECL __lsan_disable(void);
void SANITIZER_CDECL __lsan_enable(void);

Even this, though, isn't concrete and is easy to miss. It would be helpful to add a comment in the lsan_interface.h file that describes this requirement in lieu of documentation.

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