[LLVMdev] Why would -disable-fp-elim cause SEGV in JIT, when without it code works fine?

Yuri yuri at rawbw.com
Wed Jun 23 20:00:56 PDT 2010

On 06/23/2010 10:24, Reid Kleckner wrote:
> You said this is on 32-bit x86?  My understanding is that in that
> case, gdb will use ebp/esp to unwind the stack and doesn't need dwarf.
>   It may have different behavior on FreeBSD if frame pointers are
> normally omitted on that platform.  gdb ignores them on Linux x86_64
> because they are generally omitted.
> This might actually be the best explanation for your symptoms, since
> this is what a gdb backtrace looks like when it is trying to use dwarf
> to unwind the stack but there is none available.
> Have you been able to succeed at linking statically with LLVM to get
> the gdb JIT interface working?  That should fix this, and give you the
> ability to disas JITed functions.
> Another useful technique is to use x/20i<funcaddr>  to look at the
> assembly of the JITed function to see what is wrong with it.  You
> should be able to get the function addresses from your addr2line
> output.  As a last resort, you can unwind the stack yourself, so long
> as all the code you're running has frame pointers enabled.
> Reid

I think there is some bug in indirectbr instruction. It actually doesn't 
work in JIT in the current trunk, but I submitted a patch some time ago 
that implements it. Someone suggested that I should eliminate code 
incapsulation breach, but this is besides the point here.

Once this patch applied, JIT supports address of label for instruction. 
It works, except in one large case. In this case I spotted the entry in 
one table of labels that contains pointer to invalid code. 
-print-machine-code prints assembly that looks correct, but the printout 
is missing memory location information: where each line is laid in memory.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: llvm-patch-address-of-label.txt
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100623/abfef465/attachment.txt>

More information about the llvm-dev mailing list