Page MenuHomePhabricator

Fix hang in global static initialization
ClosedPublic

Authored by amccarth on Nov 30 2015, 1:57 PM.

Details

Summary

A previous patch introduced a global static ConstString instance. On Windows, this results in a hang because constructing the string pool appears to depend on other globals which haven't yet been initialized.

All other instances of static ConstStrings I could find were function static, so I modified the code to use a static function.

Diff Detail

Repository
rL LLVM

Event Timeline

amccarth updated this revision to Diff 41433.Nov 30 2015, 1:57 PM
amccarth retitled this revision from to Fix hang in global static initialization.
amccarth updated this object.
amccarth added reviewers: EwanCrawford, zturner.
amccarth added a subscriber: lldb-commits.
zturner added inline comments.Nov 30 2015, 2:00 PM
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
185 ↗(On Diff #41433)

I wonder about returning this by reference. It seems like by convention we usually pass ConstStrings around by value.

amccarth added inline comments.Nov 30 2015, 2:14 PM
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
185 ↗(On Diff #41433)

I was following the pattern used elsewhere, like Breakpoint::BreakpointEventData::GetFlavorString.

zturner accepted this revision.Nov 30 2015, 2:16 PM
zturner edited edge metadata.

Ahh ok if there's already precedent for returning by reference then it's fine.

This revision is now accepted and ready to land.Nov 30 2015, 2:16 PM
This revision was automatically updated to reflect the committed changes.
EwanCrawford edited edge metadata.Dec 1 2015, 1:04 AM

Thanks for fixing this Adrian