Hello!

The issue here is a misaligned stack with some old(er) 32bit x86
glibcs, where dl_iterate_phdr callback gets called with misaligned
stack.

Attached patch makes phdr_callback in libbacktrace resistant to this
ABI violation.

2016-05-18  Uros Bizjak  <ubiz...@gmail.com>

    * elf.c (phdr_callback) [__i386__]: Add
    __attribute__((__force_align_arg_pointer__)).

Patch was bootstrapped on x86_64-linux-gnu and regression tested with -m32.

OK for mainline and release branches?

Uros.

diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c
index f85ac65..81ba344 100644
--- a/libbacktrace/elf.c
+++ b/libbacktrace/elf.c
@@ -866,6 +866,9 @@ struct phdr_data
    libraries.  */

 static int
+#ifdef __i386__
+__attribute__ ((__force_align_arg_pointer__))
+#endif
 phdr_callback (struct dl_phdr_info *info, size_t size ATTRIBUTE_UNUSED,
               void *pdata)
 {

Reply via email to