[LLVMdev] 2.6/trunk Execution Engine question

Kenneth Uildriks kennethuil at gmail.com
Tue Oct 6 15:31:50 PDT 2009


On Tue, Oct 6, 2009 at 5:08 PM, Kenneth Uildriks <kennethuil at gmail.com> wrote:
> On Tue, Oct 6, 2009 at 4:15 PM, Reid Kleckner <rnk at mit.edu> wrote:
>>> 6. When ExecutionEngine::create was called with parameter
>>> "GVsWithCode" set to its default value of true, I got a segfault when
>>> trying to get a pointer to one of my globals.  JIT::getMemoryForGV was
>>> returning NULL in that case.  Explicitly passing false for
>>> "GVsWithCode" cleared it up.
>>
>> That's no good.  Could you send me a stack trace and explain how you
>> got that to happen?  I was the last one to touch that code.
>
> Stack trace attached.  It's not very informative; it just tells us
> that it's got a null pointer that it thinks is a pointer to the
> global, and it's trying to initialize that global.
>
> What I did was load a module from a MemoryBuffer, use an
> ExistingModuleProvider to feed it to the ExecutionEngine, then start
> looping through its globals and get their addresses so I can refer to
> their values while compiling another module.  The segfault happened on
> the first one it encountered, a linkonce constant int32.
>
> I can try and reduce it for you if you need.  The comment above create
> said that passing true was "unsafe", so I figured it was a known issue
> and plowed ahead with the upgrade.
>
Also, the null pointer is coming from a call to JCE->allocateSpace().
This is a virtual function; I'm trying to discover what subclass it
is.




More information about the llvm-dev mailing list