This is an archive of the discontinued LLVM Phabricator instance.

[Interpreter][ClangRepl] Call LLJIT deinitailize on exit.
AbandonedPublic

Authored by sunho on Jun 16 2022, 12:37 AM.

Details

Reviewers
v.g.vassilev
Summary

Calls LLJIT deinitailize on exit. This will correctly run dtors of emitted modules so that cleanup can be done properly.

Diff Detail

Event Timeline

sunho created this revision.Jun 16 2022, 12:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2022, 12:37 AM
sunho requested review of this revision.Jun 16 2022, 12:37 AM
sunho added a comment.EditedJun 16 2022, 12:43 AM

Some notes: this is probably not related to asan errors of clang-repl popping up recently. There is no dtors emitted in related test cases. There's a chance this can fix things, though. Nevertheless, This is the right thing to do.

sunho updated this revision to Diff 437475.Jun 16 2022, 1:53 AM

Clean up inside ~Interpreter

sunho updated this revision to Diff 437482.Jun 16 2022, 2:42 AM

Add testcase.

sunho updated this revision to Diff 437485.Jun 16 2022, 2:45 AM
sunho updated this revision to Diff 437486.Jun 16 2022, 2:47 AM
sunho updated this revision to Diff 437494.Jun 16 2022, 3:37 AM

Hi @sunho Did you test the changes after stage 2 asan build? The execute.cpp fails in my asan build area after adding this patch

sunho added a comment.Jun 16 2022, 6:05 AM

Hi @Purva-Chaudhari I haven't set up asan build setting yet. It's sad to hear it's still mem leaking. We need to look into somewhere else then...

sunho added a comment.Jun 16 2022, 6:15 AM

@Purva-Chaudhari Could you give me the full log of asan failure for reference?

Purva-Chaudhari added a comment.EditedJun 16 2022, 6:17 AM

Hi @Purva-Chaudhari I haven't set up asan build setting yet. It's sad to hear it's still mem leaking. We need to look into somewhere else then...

Adding this patch is causing the original execute.cpp to fail in my area (i.e without my additions which were previously causing memory leak). I would suggest to test patch in stage2 build and confirm the behavior once

Here is the log :

sunho added a comment.Jun 16 2022, 6:21 AM

Gotcha. Let me look into it.

sunho abandoned this revision.Jun 16 2022, 6:08 PM

Fix in windows build requires improving on ORC side. (extending GenericLLVMIRPlatformSupport or write new platform support) I'll reopen this once I have done this groundwork. For asan failiures, I believe https://reviews.llvm.org/D127991 should be enough.