HomePhabricator

[Support] Don't tie errs() to outs() by default

Authored by MaskRay on Thu, Jun 11, 3:19 PM.

Description

[Support] Don't tie errs() to outs() by default

This reverts part of D81156.

Accessing errs() concurrently was safe before and racy after D81156.
(errs() << 'a' is always racy)

Accessing outs() and errs() concurrently was safe before and racy after D81156.

Don't tie errs() to outs() by default to fix the fallout.
llvm-dwarfdump is single-threaded and opting in the tie behavior is safe.

Details

Committed
MaskRayThu, Jun 11, 3:19 PM
Parents
rG7fac1acc6171: Set the LLVM FP optimization flags conservatively.
Branches
Unknown
Tags
Unknown

Event Timeline

dblaikie added inline comments.
/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
611

Is this likely to trip over https://reviews.llvm.org/D81525#2084434 ?

MaskRay marked 2 inline comments as done.Thu, Jun 11, 10:09 PM
MaskRay added inline comments.
/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
611

It won't. outs() is not flushed if there is nothing in errs() to print. This is an important property.

If C++17 + errs.SetBufferSize(positive_number), this will be an issue which can be caught by MSAN_OPTIONS=poison_in_dtor=1

Thanks for fixing this @MaskRay, and sorry for missing it myself!