[LLVMbugs] [Bug 24028] New: LLVMRunStaticConstructors crashes, FIX/DIFF INCLUDED

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jul 4 05:06:21 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24028

            Bug ID: 24028
           Summary: LLVMRunStaticConstructors crashes, FIX/DIFF INCLUDED
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: MCJIT
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm at dav1d.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14549
  --> https://llvm.org/bugs/attachment.cgi?id=14549&action=edit
Diff which fixes the issue

The Problem is LLVMRunStaticConstructors might be run before finalizeObject was
called. Here is the patch:


--- ExecutionEngineBindings.cpp    2015-07-04 13:57:32.051159075 +0200
+++ ExecutionEngineBindings.cpp.new    2015-07-04 13:58:23.905707243 +0200
@@ -244,10 +244,12 @@
 }

 void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE) {
+  unwrap(EE)->finalizeObject();
   unwrap(EE)->runStaticConstructorsDestructors(false);
 }

 void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE) {
+  unwrap(EE)->finalizeObject();
   unwrap(EE)->runStaticConstructorsDestructors(true);
 }


Even though this patch works, I would like to see/discuss a better binding to
the underlaying ExecutionObject and exposing more of its functionallity, e.g.
addObject etc. and also finalizeObject, meaning the user can take care of
calling finalizeObject himself.

For all the people searching for a workaround, create an empty function or
global, and either call the function or try to get the address of the global.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150704/823b899e/attachment.html>


More information about the llvm-bugs mailing list