[LLVMbugs] [Bug 6360] New: JIT->DisableLazyCompilation(false) triggers assertion in JITEmitter.cpp:304

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Feb 21 01:55:00 PST 2010


http://www.llvm.org/bugs/show_bug.cgi?id=6360

           Summary: JIT->DisableLazyCompilation(false) triggers assertion
                    in JITEmitter.cpp:304
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Target-Independent JIT
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: Dr.Graef at t-online.de
                CC: llvmbugs at cs.uiuc.edu
   Estimated Hours: 0.0


Created an attachment (id=4258)
 --> (http://www.llvm.org/bugs/attachment.cgi?id=4258)
gdb backtrace for the failed assertion

Reenabling lazy JIT compilation in TOT breaks the Pure interpreter, which works
ok with all LLVM versions from 2.3 to 2.6.

The symptom is a failed assertion at JITEmitter.cpp:304 after the compilation
callback gets invoked on a stub. I can reproduce this reliably on a x86_64
Linux system running LLVM r96466 and Pure r3087.

To reproduce, you'll need the svn version of the Pure interpreter
(http://code.google.com/p/pure-lang/source/checkout). At line 173 in
interpreter.cc you'll find: '#if LAZY_JIT_HACK'. Change that to '#if 1', so
that lazy JITing is enabled. Then compile and install Pure as usual
(./configure && make && make install). Run it (just type 'pure' in the shell).
Enter the following at the interpreter prompt:

> let foo = \x->x+1;
> foo 99;

This yields:

pure: JITEmitter.cpp:304:
<unnamed>::JITResolver*<unnamed>::StubToResolverMapTy::getResolverFromStub(void*)
const: Assertion `I != Map.begin() && "This is not a known stub!"' failed.

Full gdb backtrace is attached.

This seems to be a memory management issue. I can work around it by disabling
some code which erases the temporary IR (eraseFromParent) and JITed code
(freeMachineCodeForFunction) which gets executed at global level in Pure, like
the Pure 'let' statement above. (You can find these in interpreter.cc if you
search for '#if !LAZY_JIT_HACK' further down in the file.)

Note that with lazy compilation, the JITing of the lambda (anonymous function)
on the right-hand side of the above 'let' statement is still pending after the
'let' statement itself has been executed and its code removed; this seems to be
sufficient to trigger the bug.

I don't see any of this with eager JITing, or with lazy JITing in previous LLVM
versions, so I believe that the relevant code in Pure's interpreter.cc is
correct.

Sorry, I don't have a smaller code sample which exposes the bug. Jeffrey
Yasskin asked me to post the bug report anyway as a reminder, so that he can
look into it.

-- 
Configure bugmail: http://www.llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are watching all bug changes.



More information about the llvm-bugs mailing list