Re: Fixed strace [ was Re: ls -l is broken ]
On Wed, May 06, 2009 at 12:19:37PM -0400, John David Anglin wrote:
> > On Tue, May 05, 2009 at 03:46:57PM -0400, John David Anglin wrote:
> > > > On Tue, May 05, 2009 at 03:09:50PM -0400, John David Anglin wrote:
> > > > > Probably, the cast should be to int. __canonicalize_funcptr_for_compare
> > > > > isn't used in the 64-bit runtime.
> > > > >
> > > > > Still, I'm not sure why this fixed the problem as
> > > > > __canonicalize_funcptr_for_compare checks for -1.
> > > > >
> > > >
> > > > If we cast both sides to int, then we don't generate a call there...
> > >
> > > That will certainly fix the problem but I'd really like to know
> > > why we get a segv. I suspect we are not handling a deferred function
> > > pointer correctly.
> > >
> >
> > At a guess, you're probably right, the faulting insn is a load:
> >
> > 0x0002b3a8 <__canonicalize_funcptr_for_compare+48>: bb,>= r26,1e,0x2b394 <__canonicalize_funcptr_for_compare+28>
> > 0x0002b3ac <__canonicalize_funcptr_for_compare+52>: copy r26,r3
> > 0x0002b3b0 <__canonicalize_funcptr_for_compare+56>: addil L%800,dp,r1
> > 0x0002b3b4 <__canonicalize_funcptr_for_compare+60>: ldw 294(r1),ret1
> > 0x0002b3b8 <__canonicalize_funcptr_for_compare+64>: depwi 0,31,2,r3
> > 0x0002b3bc <__canonicalize_funcptr_for_compare+68>: ldw 0(r3),r26
> >
> > god knows I can't recall how DEP*I work, but I guess this is clearing
> > the bottom two bits of %r3 if bit 31 is set in %r26?
> >
> > (gdb) p/x $r3
> > $3 = 0x407d2f18
> > (gdb) p/x $r26
> > $4 = 0x407d2f1a
> >
> > This looks like the sigaction handler, (it appears __canon..._compare
> > detects -1 already.)
>
> This all seems correct. r3 should be pointing to a function descriptor
> for the sigaction handler (plabel bit is set). What is the interruption
> generated by the ldw at 0x0002b3bc?
>
The tombstone is:
do_page_fault() pid=10205 command='strace' type=15 address=0x407d2f18
vm_start = 0x4068d000, vm_end = 0x4068f000
YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
PSW: 00000000000001001111111100001011 Not tainted
r00-03 000000ff0004ff0b 0000000000040aec 0000000000025fef
00000000407d2f18
r04-07 0000000000000004 000000000004e060 000000000004b0c0
0000000000040aec
r08-11 00000000bff84254 000000000004b0b8 0000000000040300
0000000000040db8
r12-15 0000000000042aec 0000000000042eec 0000000000040aec
000000000004b0b0
r16-19 000000000004b0a8 0000000000040db0 0000000000042dec
000000004068af74
r20-23 0000000000000000 00000000405bf940 0000000000000000
00000000bff84608
r24-27 0000000000000004 00000000bff84588 00000000407d2f1a
00000000000402ec
r28-31 0000000000000fff 0000000000040d70 00000000bff845c0
000000004061033f
sr00-03 0000000007acc800 00000000003ee000 0000000000000000
0000000007acc800
sr04-07 0000000007acc800 0000000007acc800 0000000007acc800
0000000007acc800
IASQ: 0000000007acc800 0000000007acc800 IAOQ: 000000000002b3bf
000000000002b3c3
IIR: 0c60109a ISR: 0000000007acc800 IOR: 00000000407d2f18
CPU: 3 CR30: 000000007da88000 CR31: fffffff0f0e098e0
ORIG_R28: 00000000bff84608
IAOQ[0]: 000000000002b3bf
IAOQ[1]: 000000000002b3c3
RP(r2): 0000000000025fef
cheers, Kyle
Reply to: