This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Avoid double frees of file descriptors in the fallback ifstream/ofstream codepath
ClosedPublic

Authored by mstorsjo on Nov 2 2020, 5:50 AM.

Details

Diff Detail

Event Timeline

mstorsjo created this revision.Nov 2 2020, 5:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2020, 5:50 AM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald Transcript
mstorsjo requested review of this revision.Nov 2 2020, 5:50 AM
ldionne accepted this revision.Nov 2 2020, 3:57 PM
ldionne added a subscriber: ldionne.

Do I understand this is triggered by the test suite when we build the dylib with _LIBCPP_FILESYSTEM_USE_FSTREAM, and so this doesn't need a test added?

If so, LGTM, otherwise please add a test.

This revision is now accepted and ready to land.Nov 2 2020, 3:57 PM

Do I understand this is triggered by the test suite when we build the dylib with _LIBCPP_FILESYSTEM_USE_FSTREAM, and so this doesn't need a test added?

Indeed, it's triggered by some of the fs.op.copy* tests, but whether the C runtime errors out on it (and how loudly) varies I guess. Afaik most of the actual deployments of libc++ std::fs so far has been using the copyfile/sendfile implementations.

This revision was landed with ongoing or failed builds.Nov 2 2020, 11:33 PM
This revision was automatically updated to reflect the committed changes.