libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] crashes trying to get a backtrace from a signal ha


From: Lassi Tuura
Subject: Re: [Libunwind-devel] crashes trying to get a backtrace from a signal handler (ARM)
Date: Fri, 10 Sep 2010 12:55:30 +0200

Hi,

> over the last days I have found time to investigate the unwind problem
> on the ARM platform further. It turned out that uClibc was built without
> any debug information. So I have now changed that in the hope that this
> would get the unwinder over __default_sa_restorer() from /lib/libc.so.0.
> Unfortunately this didn't help and the backtrace is still stuck in this
> function. As I explained earlier, getting a backtrace works fine if it
> is invoked from normal code. Only backtraces generated from a signal
> handler have this problem.
> 
> I have run this with UNW_DEBUG_LEVEL=1000 and generated a large file
> with debug output. Since this file is definitely too large for this
> list, I've uploaded it here:  http://svenfoo.org/misc/arm.unwind
> 
> It would be terrific if you guys could have a look at this output and/or
> tell me what else I could try to make this work eventually.

I extracted the essential interesting parts of your trace below. Observations:

1) What looks like your stack report is actually one level below where unwind 
currently is. Are you reporting IP value after the unw_step() was taken?

2) It ends at looking for IP=0x40859fe7, but __default_sa_restorer is at 
address 0x40859fe8, and previous function is setjmp at 0x40859fdc.

It looks like you are for some reason landing to one byte before the actual 
function. Subtracting one from the caller address is indeed the default logic 
when walking up the call tree: you have to back off into the call instruction 
itself, the function might end with the call, so it's valid to look at the byte 
after the call.

This means there is either no FDE for __default_sa_restorer at all, or it 
wasn't found because it doesn't extend to one byte before the function, which 
is needed for this special case. This is the direct reason for returning -10 
(-UNW_ENOINFO).

Off the top of my head I don't recall how linux on x86/x86_64 sets this up. I 
think the return address is also to the beginning of the sigreturn, so maybe 
the FDE range extends one byte before?

Can you double check with readelf there is unwind info for 
__default_sa_restorer, and the exact bounds for it? At least in the output you 
quoted there is no no FDE for delta 0xbfe8 into libc. Nearest I found was 
bee8-0xbeec which is __aeabi_MB_CUR_MAX, and after that there should be 
__longjmp, __vfork, clone, __sigsetjmp, setjmp and _setjmp, in address order, 
before the __default_sa_restorer.

As far as I could tell from quick internet search __default_sa_restorer is an 
assembler stub, so it needs unwind info to be entered manually.

Regards,
Lassi

_ULarm_dwarf_find_proc_info: looking for IP=0x400402cf
 _ULarm_dwarf_extract_proc_info_from_fde: FDE @ 0x107628
  _ULarm_dwarf_extract_proc_info_from_fde: looking for CIE at address 1075d0
  parse_cie: CIE parsed OK, augmentation = "", handler=0x0
  _ULarm_dwarf_extract_proc_info_from_fde: FDE covers IP 0x32264-0x324d4, 
LSDA=0x0
  _ULarm_dwarf_find_debug_frame: start_ip = 32264, end_ip = 324d4

 _ULarm_dwarf_search_unwind_table: ip=0x400402cf, start_ip=0x32264
 _ULarm_dwarf_search_unwind_table: e->fde_offset = 5be8, segbase = 4000e000, 
debug_frame_base = 101a40, fde_addr = 107628
  _ULarm_dwarf_extract_proc_info_from_fde: FDE covers IP 0x32264-0x324d4, 
LSDA=0x0
  (* _Uelf32_lookup_symbol: 0x0000000040040264 info=0x02 logUnwind)
  run_cfi_program: CFA_def_cfa r13+0x0
  run_cfi_program: CFA_advance_loc to 0x40040268
  run_cfi_program: CFA_def_cfa_offset 0x28
  run_cfi_program: CFA_offset r14 at cfa+0xfffffffc
  run_cfi_program: CFA_offset r12 at cfa+0xfffffff8
  run_cfi_program: CFA_offset r11 at cfa+0xfffffff4
  run_cfi_program: CFA_offset r10 at cfa+0xfffffff0
  run_cfi_program: CFA_offset r9 at cfa+0xffffffec
  run_cfi_program: CFA_offset r8 at cfa+0xffffffe8
  run_cfi_program: CFA_offset r7 at cfa+0xffffffe4
  run_cfi_program: CFA_offset r6 at cfa+0xffffffe0
  run_cfi_program: CFA_offset r5 at cfa+0xffffffdc
  run_cfi_program: CFA_offset r4 at cfa+0xffffffd8
  run_cfi_program: CFA_advance_loc to 0x40040274
  run_cfi_program: CFA_def_cfa_offset 0x4328
  run_cfi_program: CFA_advance_loc to 0x40040280
  run_cfi_program: CFA_def_cfa_offset 0x43b0
  ? 0x4003f734  logAspects() from /usr/lib/libraumfeld-1.0.so.0

_ULarm_dwarf_find_proc_info: looking for IP=0x4003f8d3
 _ULarm_dwarf_search_unwind_table: ip=0x4003f8d3, start_ip=0x31734
 _ULarm_dwarf_search_unwind_table: e->fde_offset = 5a20, segbase = 4000e000, 
debug_frame_base = 101a40, fde_addr = 107460
  _ULarm_dwarf_extract_proc_info_from_fde: FDE @ 0x107460
  _ULarm_dwarf_extract_proc_info_from_fde: looking for CIE at address 107318
  parse_cie: CIE parsed OK, augmentation = "", handler=0x0
  _ULarm_dwarf_extract_proc_info_from_fde: FDE covers IP 0x31734-0x319cc, 
LSDA=0x0
  (* _Uelf32_lookup_symbol: 0x000000004003f734 info=0x02 logAspects)
  run_cfi_program: CFA_def_cfa r13+0x0
  run_cfi_program: CFA_advance_loc to 0x4003f738
  run_cfi_program: CFA_def_cfa_offset 0x20
  run_cfi_program: CFA_offset r14 at cfa+0xfffffffc
  run_cfi_program: CFA_offset r10 at cfa+0xfffffff8
  run_cfi_program: CFA_offset r9 at cfa+0xfffffff4
  run_cfi_program: CFA_offset r8 at cfa+0xfffffff0
  run_cfi_program: CFA_offset r7 at cfa+0xffffffec
  run_cfi_program: CFA_offset r6 at cfa+0xffffffe8
  run_cfi_program: CFA_offset r5 at cfa+0xffffffe4
  run_cfi_program: CFA_offset r4 at cfa+0xffffffe0
  run_cfi_program: CFA_advance_loc to 0x4003f74c
  run_cfi_program: CFA_def_cfa_offset 0x30
  ? 0x40040180  logCrash() from /usr/lib/libraumfeld-1.0.so.0

_ULarm_dwarf_find_proc_info: looking for IP=0x400401db
 _ULarm_dwarf_search_unwind_table: ip=0x400401db, start_ip=0x32180
 _ULarm_dwarf_search_unwind_table: e->fde_offset = 5bcc, segbase = 4000e000, 
debug_frame_base = 101a40, fde_addr = 10760c
  _ULarm_dwarf_extract_proc_info_from_fde: FDE @ 0x10760c
  _ULarm_dwarf_extract_proc_info_from_fde: looking for CIE at address 1075d0
  parse_cie: CIE parsed OK, augmentation = "", handler=0x0
  _ULarm_dwarf_extract_proc_info_from_fde: FDE covers IP 0x32180-0x32264, 
LSDA=0x0
  (* _Uelf32_lookup_symbol: 0x0000000040040180 info=0x02 logCrash)
  run_cfi_program: CFA_def_cfa r13+0x0
  run_cfi_program: CFA_advance_loc to 0x40040184
  run_cfi_program: CFA_def_cfa_offset 0x10
  run_cfi_program: CFA_offset r14 at cfa+0xfffffffc
  run_cfi_program: CFA_offset r6 at cfa+0xfffffff8
  run_cfi_program: CFA_offset r5 at cfa+0xfffffff4
  run_cfi_program: CFA_offset r4 at cfa+0xfffffff0
  ? 0x40859fe8  __default_sa_restorer() from /lib/libc.so.0

_ULarm_dwarf_find_proc_info: looking for IP=0x40859fe7
 locate_debug_info: calculated bounds of 4084e000-408ace20 for '/lib/libc.so.0'
 _ULarm_dwarf_search_unwind_table: ip=0x40859fe7, start_ip=0xbee8
 _ULarm_dwarf_search_unwind_table: e->fde_offset = 348, segbase = 4084e000, 
debug_frame_base = 130d10, fde_addr = 131058
  _ULarm_dwarf_extract_proc_info_from_fde: FDE @ 0x131058
  _ULarm_dwarf_extract_proc_info_from_fde: looking for CIE at address 131048
  parse_cie: CIE parsed OK, augmentation = "", handler=0x0
  _ULarm_dwarf_extract_proc_info_from_fde: FDE covers IP 0xbee8-0xbeec, LSDA=0x0
  put_rs_cache: unmasking signals/interrupts and releasing lock
  _ULarm_dwarf_step: returning -10

 (* _Uelf32_lookup_symbol: 0x0000000040859fdc info=0x12 _setjmp)
 (* _Uelf32_lookup_symbol: 0x0000000040859fe8 info=0x12 __default_sa_restorer)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]