Page MenuHomePhabricator

[Sanitizer] Fix debug builds of sanitizer_stacktrace_test.cpp
ClosedPublic

Authored by luismarques on Feb 18 2021, 7:21 AM.

Details

Summary

An implementation of __sanitizer::BufferedStackTrace::UnwindImpl is provided per sanitizer, but there isn't one for sanitizer-common. In non-optimized builds of the sanitizer-common tests that becomes a problem: the test sanitizer_stacktrace_test.cpp won't have a reference to that method optimized away, causing linking errors. This patch provides a dummy implementation, which fixes those builds.

Diff Detail

Event Timeline

luismarques requested review of this revision.Feb 18 2021, 7:21 AM
luismarques created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2021, 7:22 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript

That's bad, but I don't see a better easy way to fix that.
Maybe you create some separate sanitizer_common_test_runtime lib.

LGTM as is

compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp
182

to crash even with NDEBUG
UNIMPLEMENTED();

vitalybuka accepted this revision.Feb 18 2021, 5:07 PM
This revision is now accepted and ready to land.Feb 18 2021, 5:07 PM

Address review feedback.

That's bad, but I don't see a better easy way to fix that.
Maybe you create some separate sanitizer_common_test_runtime lib.

I also thought about that, and considered that option, but in the end I concluded it wasn't worth it.
I will land this now. Thanks.

This revision was landed with ongoing or failed builds.Mar 17 2021, 8:58 AM
This revision was automatically updated to reflect the committed changes.