This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Use the no_destroy attribute to avoid destroying debug DB statics
ClosedPublic

Authored by ldionne on Apr 17 2019, 9:56 AM.

Details

Summary

Otherwise, we can run into problems when the program has static variables
that need to use the debug database during their deinitialization, if
the debug DB has already been deinitialized.

Diff Detail

Repository
rCXX libc++

Event Timeline

ldionne created this revision.Apr 17 2019, 9:56 AM
EricWF accepted this revision.Apr 17 2019, 10:01 AM
This revision is now accepted and ready to land.Apr 17 2019, 10:01 AM

I am concerned that we're going to start flagging leaks because we don't destroy those -- do you share the concern? I mean I can also just push and see what our various sanitizers say.

It may start being reported as a leak by tooling, in the same way static T* t = new T would, which is the other idiomatic way to do this.

If an LLVM tool reports this as a leak, I think we should fix the tool.

This revision was automatically updated to reflect the committed changes.