This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: LD_AUDIT implementation causing process segfaulting


I thought unwinder does not generate any instruction only provides
the debug info... but I could be wrong, I'm not that strong in this area, but :)

sysdeps/i386/dl-trampoline.S:
	...
    pushl %esi
    cfi_adjust_cfa_offset (4)
    cfi_rel_offset (esi, 0)
    leal 44(%esp), %esi
    movl %ebx, %ecx
    movl %esp, %edi
    subl %ebx, %edi
    andl $0xfffffff0, %edi  # Align stack
    movl %esp, %ebx
    cfi_def_cfa_register (ebx)
    movl %edi, %esp
    shrl $2, %ecx
    rep
    movsl
    movl (%edi), %esi
	...

My thinking is: 
if you store esi on the stack (first instr. in list), 
then align the %edi register value (current stack)
and then restores %esi  (by the last instr. in the list) using %edi register,
you will not get the stored value for %esi register back.

Thats what I see happening while using this interface on 'ls' program.
It really depends on the binary itself, if it is using edi/esi registers.

In the 'elf/tst-auditmod1.c' test there's interface for pltenter and pltexit,
but pltexit does not get called, since the pltentry does not set the framesize.

Dont wanna waste your time, I'll investigate more to be completely sure :)

thanks
Jiri Olsa




Jiri Olsa wrote:
> There's a bug in libc in the "sysdeps/i386/dl-trampoline.S".

No, that should work just fine.  The unwinder is told that register 3
(=ebx) now serves as the CFA register.  If you have problems it is
likely in the unwinder which comes from gcc.

-- 
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]