[Mesa-dev] powerpc / gallium/drivers/llvmpipe segfaults running lp_test_* tests
Will Schmidt
will_schmidt at vnet.ibm.com
Thu Jul 5 15:11:59 PDT 2012
On Wed, 2012-07-04 at 05:33 -0700, Jose Fonseca wrote:
> ----- Original Message -----
> > On Tue, 2012-07-03 at 16:07 -0500, Will Schmidt wrote:
> > > (gdb) info reg r3
> > > r3 0xfffb7f60010 17590977429520
> > > (gdb) info reg r10
> > > r10 0x7c0802a6f8010010 8937396376665391120
> >
> > BenH points out to me that r10 value looks like code.
> > ppcdis 0x7c0802a6
> > mflr r0
> >
> > ppcdis 0xf8010010
> > std r0,16(r1)
> >
> > So we are getting a pointer to the actual code, rather than a OPD
> > (function descriptor).
> >
> > I'll dig into this more...
> >
> > Thanks,
> > -Will
>
> I'm not familair with PowerPc architecture.
>
> Does llvm/examples/HowToUseJIT/HowToUseJIT.cpp work well there?
>
> If so then you can take a look at lib/ExecutionEngine/JIT/JIT.cpp 's JIT::runFunction method, and compare what's happening differently.
>
Thanks for the pointer. It took me a bit to get the example built, but
in the end, the behavior appears to be the same. Single-stepping in GDB
shows the steps leading up to the SIGSEGV are the same. The value moved
into the CTR that we branch to is code rather than OPD.
> g++ `llvm-config --ldflags` -o HowToUseJIT HowToUseJIT.o `llvm-config --libs`
[willschm at fuzzy Release]$ ./HowToUseJIT
We just constructed this LLVM module:
; ModuleID = 'test'
<snip...>
Running foo: Segmentation fault
[willschm at fuzzy Release]$ gdb ./HowToUseJIT
<snip...>
Breakpoint 2, 0x00000000100313c0 in ._ZN4llvm3JIT11runFunctionEPNS_8FunctionERKSt6vectorINS_12GenericValueESaIS4_EE ()
=> 0x00000000100313c0 <._ZN4llvm3JIT11runFunctionEPNS_8FunctionERKSt6vectorINS_12GenericValueESaIS4_EE+4032>: e9 3e 00 00 ld r9,0(r30)
(gdb) stepi
0x00000000100313c4 in ._ZN4llvm3JIT11runFunctionEPNS_8FunctionERKSt6vectorINS_12GenericValueESaIS4_EE ()
=> 0x00000000100313c4 <._ZN4llvm3JIT11runFunctionEPNS_8FunctionERKSt6vectorINS_12GenericValueESaIS4_EE+4036>: f8 41 00 28 std r2,40(r1)
(gdb)
0x00000000100313c8 in ._ZN4llvm3JIT11runFunctionEPNS_8FunctionERKSt6vectorINS_12GenericValueESaIS4_EE ()
=> 0x00000000100313c8 <._ZN4llvm3JIT11runFunctionEPNS_8FunctionERKSt6vectorINS_12GenericValueESaIS4_EE+4040>: 7d 29 03 a6 mtctr r9
(gdb)
0x00000000100313cc in ._ZN4llvm3JIT11runFunctionEPNS_8FunctionERKSt6vectorINS_12GenericValueESaIS4_EE ()
=> 0x00000000100313cc <._ZN4llvm3JIT11runFunctionEPNS_8FunctionERKSt6vectorINS_12GenericValueESaIS4_EE+4044>: e9 7e 00 10 ld r11,16(r30)
(gdb)
0x00000000100313d0 in ._ZN4llvm3JIT11runFunctionEPNS_8FunctionERKSt6vectorINS_12GenericValueESaIS4_EE ()
=> 0x00000000100313d0 <._ZN4llvm3JIT11runFunctionEPNS_8FunctionERKSt6vectorINS_12GenericValueESaIS4_EE+4048>: e8 5e 00 08 ld r2,8(r30)
(gdb)
0x00000000100313d4 in ._ZN4llvm3JIT11runFunctionEPNS_8FunctionERKSt6vectorINS_12GenericValueESaIS4_EE ()
=> 0x00000000100313d4 <._ZN4llvm3JIT11runFunctionEPNS_8FunctionERKSt6vectorINS_12GenericValueESaIS4_EE+4052>: 4e 80 04 21 bctrl
(gdb)
0x7c0802a6f8010010 in ?? ()
=> 0x7c0802a6f8010010: Cannot access memory at address 0x7c0802a6f8010010
Thanks,
-Will
More information about the mesa-dev
mailing list