This is an archive of the discontinued LLVM Phabricator instance.

[Tsan] Do not flush all streams on exit
ClosedPublic

Authored by kutuzov.viktor.84 on Dec 1 2014, 7:19 AM.

Details

Summary

This patch completes the changes in rL200922 and rL200923 so the getline_nohang.cc test does not hang on FreeBSD.

Diff Detail

Repository
rL LLVM

Event Timeline

kutuzov.viktor.84 retitled this revision from to [Tsan] Do not flush all streams on exit.
kutuzov.viktor.84 updated this object.
kutuzov.viktor.84 edited the test plan for this revision. (Show Details)
kutuzov.viktor.84 added reviewers: kcc, samsonov, glider.
kutuzov.viktor.84 added subscribers: Unknown Object (MLST), emaste.
glider edited edge metadata.Dec 1 2014, 9:09 AM

IIUC this test adds more calls to REAL(fflush)() than there were before. How comes it prevents any of the tests from hanging?

dvyukov accepted this revision.Dec 1 2014, 10:55 AM
dvyukov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 1 2014, 10:55 AM

Alexander, this patch does fflush() for stderr and stdout whereas fflush(0) tries to flush all streams and thus causes deadlock under some circumstances mentioned in rL200922.

glider accepted this revision.Dec 2 2014, 5:52 AM
glider edited edge metadata.

Got it. LGTM

Diffusion closed this revision.Dec 2 2014, 7:00 AM
Diffusion updated this revision to Diff 16809.

Closed by commit rL223121 (authored by vkutuzov).