There's a bug in the sysdeps/i386/dl-trampoline.S _dl_runtime_profile function
making process segfaulting. Under some conditions the 'edi' and 'esi' registers
are restored to wrong values. IMHO this could be fixed like this:
RCS file: /cvs/glibc/libc/sysdeps/i386/dl-trampoline.S,v
retrieving revision 1.2
diff -r1.2 dl-trampoline.S
< andl $0xfffffff0, %edi # Align stack
edi and esi registers are pushed on stack before it is alligned. In case it is
really aligned those register wont be restored properly. I tried the fix and it
is working for me. I dont know the reason for alligning the stack here, so
hopefully I'm not missing something... :)
I'm running the 2.4 version, but seems it is an issue in current sources as well.
Provide example code. As I wrote on the list already, I don't see anything
wrong. The alignment is needed and is correctly expressed for the unwinder.
Created attachment 1726 [details]
create an shared library 'libaudit.so' from the source and run:
this segfaults for me most of the time
Fixed in cvs. Your patch is not correct.
The example code is still not working with the fixed libc code.
Regarding the framesizep output agrument of la_i86_gnu_pltenter function:
If there's a framesizep set to any value but zero, the ls binary will segfault.
If there's a framesizep set to zero value, the ls binary will run without errors.
Does the example code work ok for you?
There was another little bug in the code which I fixed. But an equally bad bug
is that you test module is requesting too large stack frames. Unless I reduced
the size to something more reasonable the copy operation will sometimes/often
segfault. Current cvs has all the changes.