This is an archive of the discontinued LLVM Phabricator instance.

[tsan] Unify the stack trace render format between TSan and ASan
Needs ReviewPublic

Authored by kubamracek on Dec 4 2016, 7:46 PM.

Details

Reviewers
dvyukov
Summary

I always found it weird that TSan print backtraces in a different line format than ASan. Would it make sense to unify them?

In particular, I care about having the actual PC addresses in the stack frames. This is useful for pointing to the exact instruction that caused a race.

Diff Detail

Event Timeline

kubamracek updated this revision to Diff 80224.Dec 4 2016, 7:46 PM
kubamracek retitled this revision from to [tsan] Unify the stack trace render format between TSan and ASan.
kubamracek updated this object.
kubamracek added a reviewer: dvyukov.
kubamracek set the repository for this revision to rL LLVM.
kubamracek added a project: Restricted Project.
kubamracek added subscribers: llvm-commits, zaks.anna.
dvyukov edited edge metadata.Dec 5 2016, 4:03 AM

%M gives you exact location. Raw PC value is frequently not useful due to ASLR and modules.
I afraid this can break things.

kubamracek updated this revision to Diff 80287.Dec 5 2016, 10:06 AM
kubamracek edited edge metadata.
kubamracek removed rL LLVM as the repository for this revision.

Okay, how about just adding the raw PC to the beginning of the line, just like ASan does?

Raw PC is useful when you're in the debugger. The address is valid in the live process and you can easily ask the debugger to tell you where the PC belongs, what instruction is it, get disassembly around. That doesn't work that well with module name + offset.

You can also export TSAN_OPTIONS=stack_trace_format=... in your bashrc as necessary. That's we have it as config option.