This is an archive of the discontinued LLVM Phabricator instance.

Memory leak fix for Managed Static Mutex
Needs RevisionPublic

Authored by paigeale on Oct 31 2019, 5:07 PM.

Details

Reviewers
hliao
Summary

When llvm exists inside of a dll and one links to the LLVM libraries there exists a memory leak on the unload of the dll because the mutex inside of the ManagedStatic class does not get released.

Diff Detail

Event Timeline

paigeale created this revision.Oct 31 2019, 5:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 31 2019, 5:07 PM
hliao added a comment.Nov 1 2019, 11:12 AM

could you keep the original scoped lock by adding a level of block?

paigeale updated this revision to Diff 228550.Nov 8 2019, 5:51 PM

Updated diff to keep original lock mechanism

@hliao ,

Could you please review latest change and merge if satisfactory?

hliao added a comment.Jan 2 2020, 1:14 PM

Could you double-check that on other platforms? Like Linux with shared library builds. At least, there are crash in my local build.

hliao requested changes to this revision.Jan 20 2020, 9:23 AM

that change results in regression test crashing on Linux builds.

This revision now requires changes to proceed.Jan 20 2020, 9:23 AM