Page MenuHomePhabricator

[tsan] Add some NULL pointer checks into the debugging API
ClosedPublic

Authored by kubamracek on Mar 20 2016, 2:46 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek updated this revision to Diff 51136.Mar 20 2016, 2:46 PM
kubamracek retitled this revision from to [tsan] Add some NULL pointer checks into the debugging API.
kubamracek updated this object.
kubamracek added reviewers: dvyukov, kcc, samsonov, glider.
kubamracek added subscribers: zaks.anna, dcoughlin.
glider accepted this revision.Mar 21 2016, 2:38 AM
glider edited edge metadata.
glider added inline comments.
lib/tsan/rtl/tsan_debugging.cc
89 ↗(On Diff #51136)

Do you want to return 0 in the case stack was a nullptr?

This revision is now accepted and ready to land.Mar 21 2016, 2:38 AM
This revision was automatically updated to reflect the committed changes.
glider added inline comments.Mar 21 2016, 5:23 AM
compiler-rt/trunk/lib/tsan/rtl/tsan_debugging.cc
105

Obviously, my question related to every API function that copies traces ;)

kubamracek added inline comments.Mar 21 2016, 5:26 AM
compiler-rt/trunk/lib/tsan/rtl/tsan_debugging.cc
105

Hm, I think there are situations when a stack trace is missing, but the rest of the output data is still valid. I think we should still return a success even when the trace is not available. The above (__tsan_get_report_stack) is different, since it *only* returns a stack trace...

glider added inline comments.Mar 21 2016, 5:28 AM
compiler-rt/trunk/lib/tsan/rtl/tsan_debugging.cc
105

Ok, fair enough.