-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 detecting double-free when using JUnit & console reporters simultaneously #2641
Comments
I don't see how this is possible.
Basically you should try to compile the code with lesser optimization level to decrease the chance of miscompile and to get a more detailed stack trace. |
@horenmar I tracked this down to us calling Seems like a way to solve this is:
That way we'll get the data associated with the foreground actions in a thread safely way. |
re MT: Yeah, just don't touch Catch2 from multiple threads. re logging: if you are serializing logs into |
@horenmar Oh, thank you for the pointer! I will absolutely look into the event listeners. |
Describe the bug
We recently upgraded to Catch3 to utilize the support for multiple reporters. We run all our tests with ASan on Linux, and this change has caused ASan to detect a double-free inside of MessageInfo::~MessageInfo. Here's the report:
Reproduction steps
We don't see the issue when running with
-g -s -d yes --wait-for-keypress never -r junit -o test_report_main.xml
, but we do see it when running with--reporter console::out=- -g -s -d yes --wait-for-keypress never --reporter JUnit::out=test_report_main.xml
We build with
-O2 -fsanitize=undefined,address -fno-sanitize=enum -std=c++17 -DCATCH_CONFIG_ENABLE_BENCHMARKING=1
and we link with-fsanitize=undefined,address -fno-sanitize=enum
Platform information:
The text was updated successfully, but these errors were encountered: