[LLVMdev] bug in the JIT global variable emitter
dalej at apple.com
Mon Oct 13 14:57:19 PDT 2008
On Oct 13, 2008, at 2:42 PMPDT, Nuno Lopes wrote:
> Today I found a nice bug in the JIT global variable emitter.
> The problem may lead to an assert() failure when doing the following:
> 1) compile some function
> 2) emit a global variable
> 3) compile another function. an assert() may trigger in the JIT memory
> This happens because the JIT global variable emitter is using the
> MachineCodeEmitter::allocate() function, which uses memory allocated
> by the
> JIT memory manager (which should be used for functions only).
No, this was a deliberate change, 54442. We have a situation where a
wants to emit JIT code on one machine, then send it off to another
execute. Putting statically allocated data in the same buffer as code
easiest approach to make this work, although there may be others.
Is this the known situation that the JIT memory manager doesn't handle
well? You could get into problems with that when it contained only
it obviously gets hit more often now.
> The assert()
> is triggered because the global variable is dumped to the header of
> the free
> blocks list (provided that ThisAllocated becomes 1).
> My proposed patch:
> (similar to
> what other JIT variable emitters do).
> Please comment.
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev