Status: Accepted
Owner: [email protected]
CC: [email protected]
Labels: Type-Defect Priority-Medium

New issue 387 by [email protected]: Wrong base address calculation for stripped Android libraries
https://code.google.com/p/address-sanitizer/issues/detail?id=387

In the current AOSP master, stripped libraries have this virtual address bias (ex. libart.so):

  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x0000d000 0x0000d000 0x40e304 0x40e304 R E 0x1000
  LOAD           0x40e9d8 0x0041c9d8 0x0041c9d8 0x0a230 0x0bf8d RW  0x1000

Compare with unstripped:

  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x41b304 0x41b304 R E 0x1000
  LOAD           0x41b9d8 0x0041c9d8 0x0041c9d8 0x0a230 0x0bf8d RW  0x1000

This results in module offsets (in unsymbolized stack traces) being off by 0xd000.

This could be fixed in llvm-symbolizer, but that would cause discrepancy between add2line and llvm-symbolizer input formats.

On Android we use MemoryMappingLayout::DumpListOfModules to calculate module offsets. Extracting this 0xd000 offset from /proc/*/maps seems impossible (it's just not there).

Compare with dl_iterate_phdr_cb (phdr->p_vaddr calculation).

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to