This is an archive of the discontinued LLVM Phabricator instance.

Simplify Symbolizer::SymbolizePC() interface.
ClosedPublic

Authored by samsonov on Nov 24 2014, 2:14 PM.

Details

Reviewers
dvyukov
earthdok
Summary

Return a linked list of AddressInfo objects,
instead of using an array of these objects as an output parameter.
This simplifies the code in callers of this function (especially
TSan).

Fix a few memory leaks from internal allocator, when the returned
AddressInfo objects were not properly cleared.

Diff Detail

Event Timeline

samsonov updated this revision to Diff 16581.Nov 24 2014, 2:14 PM
samsonov retitled this revision from to Simplify Symbolizer::SymbolizePC() interface..
samsonov updated this object.
samsonov edited the test plan for this revision. (Show Details)
samsonov added a reviewer: earthdok.
samsonov added subscribers: dvyukov, kubamracek, Unknown Object (MLST).
earthdok added inline comments.Nov 26 2014, 5:40 AM
lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc
86

We have SymbolizeCode(), SymbolizeData() and struct SymbolizeCodeData. Confusing. Besides, "Data" doesn't really tell you anything. This should be renamed to something like SymbolizeCodeResult.

87

I'm not happy with this name. Maybe "result" or "first"? I'd prefer the latter.

samsonov updated this revision to Diff 16659.Nov 26 2014, 11:22 AM

Address comments.

lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc
86

Renamed to SymbolizeCodeCallbackArg.

87

Done

earthdok edited edge metadata.Nov 26 2014, 11:56 AM

LSan and sanitizer_common lgtm

Dmitry, any comments on the TSan side?

dvyukov added inline comments.Nov 26 2014, 11:09 PM
lib/sanitizer_common/sanitizer_symbolizer.cc
56

who is deallocating next?

lib/tsan/rtl/tsan_rtl_report.cc
75

who is deallocating last_frame?
here and below

lib/tsan/rtl/tsan_symbolize.cc
58

SymbolizedFrame is somewhat confusing here, because it is whole stack rather than a single frame.
I would s/SymbolizedFrame/SymbolizedStack/

samsonov updated this revision to Diff 16780.Dec 1 2014, 12:30 PM
samsonov edited edge metadata.

Address review comments. Fix Go build.

lib/sanitizer_common/sanitizer_symbolizer.cc
56

OMG. Fixed.

lib/tsan/rtl/tsan_rtl_report.cc
75

Fixed (now this is done by ClearAll()) function.

lib/tsan/rtl/tsan_symbolize.cc
58

Done.

samsonov updated this revision to Diff 16790.Dec 1 2014, 4:50 PM

Rebase to trunk.

dvyukov accepted this revision.Dec 1 2014, 11:31 PM
dvyukov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 1 2014, 11:31 PM
samsonov closed this revision.Dec 2 2014, 11:49 AM