Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Q. Stack trace gives Hex values not function names when core library crashes
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
click321@gmail.com  
View profile  
 More options Feb 12 2009, 4:59 am
From: "click...@gmail.com" <click...@gmail.com>
Date: Thu, 12 Feb 2009 01:59:46 -0800 (PST)
Local: Thurs, Feb 12 2009 4:59 am
Subject: Q. Stack trace gives Hex values not function names when core library crashes
Hi,

Here my application "com.android.hello" calls a core library
"libvt.so" through JNI call. There is a segmentation fault in
"libvt.so". When executed I get the following log

/////////////////////////
************************************//////////////////////////////////////
01-01 00:01:48.440: INFO/ActivityManager(1645): Starting activity:
Intent { action=android.intent.action.MAIN categories=
{android.intent.category.LAUNCHER} flags=0x10200000 comp=
{com.android.hello/com.android.hello.HelloAndroid} }
01-01 00:01:48.860: INFO/ActivityManager(1645): Start proc
com.android.hello for activity com.android.hello/.HelloAndroid:
pid=1948 uid=10036 gids={}
01-01 00:01:48.900: INFO/jdwp(1948): received file descriptor 10 from
ADB
01-01 00:01:49.285: INFO/System.out(1948): Hello World 1.4
01-01 00:01:49.290: INFO/System.out(1948): For Vt stack Interface
class############true#########false######
01-01 00:01:49.300: INFO/System.out(1948): for VHello
class############0#########10######
01-01 00:01:49.430: INFO/ActivityManager(1645): Displayed activity
com.android.hello/.HelloAndroid: 981 ms
01-01 00:01:49.455: INFO/ARMAssembler(1645): generated
scanline__00000077:03545404_00000A04_00000000 [ 29 ipp] (51 ins) at
[0x1e9538:0x1e9604] in 0 ns
01-01 00:02:53.915: WARN/KeyCharacterMap(1948): Can't open keycharmap
file
01-01 00:02:53.915: WARN/KeyCharacterMap(1948): Error loading
keycharmap file '/system/usr/keychars/sec_keypad.kcm.bin'.
hw.keyboards.65537.devname='sec_keypad'
01-01 00:02:53.915: WARN/KeyCharacterMap(1948): Using default keymap: /
system/usr/keychars/qwerty.kcm.bin
01-01 00:02:57.615: INFO/ActivityManager(1645): Starting activity:
Intent { action=android.intent.action.MAIN categories=
{android.intent.category.LAUNCHER} flags=0x10200000 comp=
{com.android.hello/com.android.hello.HelloAndroid} }
01-01 00:02:57.655: INFO/System.out(1948): Hello World 1.4
01-01 00:02:57.675: INFO/DEBUG(1600): *** *** *** *** *** *** *** ***
*** *** *** *** *** *** *** ***
01-01 00:02:57.675: INFO/DEBUG(1600): Build fingerprint: 'sec/
sec_bigbang/bigbang/:1.0/TC3/eng.user.20090209.201442:eng/test-keys'
01-01 00:02:57.675: INFO/DEBUG(1600): pid: 1948, tid: 1948  >>>
com.android.hello <<<
01-01 00:02:57.675: INFO/DEBUG(1600): signal 11 (SIGSEGV), fault addr
0000079c
01-01 00:02:57.675: INFO/DEBUG(1600):  r0 00000000  r1 0000000b  r2
c2f81c1f  r3 9fd014c5
01-01 00:02:57.675: INFO/DEBUG(1600):  r4 0000000b  r5 00000004  r6
ab800689  r7 00000025
01-01 00:02:57.675: INFO/DEBUG(1600):  r8 bef2e608  r9 4104aca4  10
4104ac90  fp 00000000
01-01 00:02:57.675: INFO/DEBUG(1600):  ip 9fd020d0  sp bef2e5b0  lr
afe1083b  pc afe0d24c  cpsr 00000010
01-01 00:02:57.720: INFO/DEBUG(1600):          #00  pc afe0d24c  /
system/lib/libc.so
01-01 00:02:57.720: INFO/DEBUG(1600):          #01  pc afe10838  /
system/lib/libc.so
01-01 00:02:57.720: INFO/DEBUG(1600):          #02  pc 9fd014c8  /
system/lib/libvt.so
01-01 00:02:57.725: INFO/DEBUG(1600):          #03  pc 9fd014f6  /
system/lib/libvt.so
01-01 00:02:57.725: INFO/DEBUG(1600):          #04  pc 9fd01522  /
system/lib/libvt.so
01-01 00:02:57.725: INFO/DEBUG(1600):          #05  pc 9fd0154e  /
system/lib/libvt.so
01-01 00:02:57.735: INFO/DEBUG(1600):          #06  pc 9fd0157a  /
system/lib/libvt.so
01-01 00:02:57.735: INFO/DEBUG(1600):          #07  pc 9fd015a6  /
system/lib/libvt.so
01-01 00:02:57.735: INFO/DEBUG(1600):          #08  pc ab80069e  /
system/lib/libvideo_tel.so
01-01 00:02:57.740: INFO/DEBUG(1600):          #09  pc ad00d9f4  /
system/lib/libdvm.so
01-01 00:02:57.740: INFO/DEBUG(1600):          #10  pc ad04123e  /
system/lib/libdvm.so
01-01 00:02:57.750: INFO/DEBUG(1600):          #11  pc ad012748  /
system/lib/libdvm.so
01-01 00:02:57.750: INFO/DEBUG(1600):          #12  pc ad02a92c  /
system/lib/libdvm.so
01-01 00:02:57.755: INFO/DEBUG(1600):          #13  pc ad0169d0  /
system/lib/libdvm.so
01-01 00:02:57.755: INFO/DEBUG(1600):          #14  pc ad0520c6  /
system/lib/libdvm.so
01-01 00:02:57.755: INFO/DEBUG(1600):          #15  pc ad03ccbc  /
system/lib/libdvm.so
01-01 00:02:57.765: INFO/DEBUG(1600):          #16  pc ad012748  /
system/lib/libdvm.so
01-01 00:02:57.765: INFO/DEBUG(1600):          #17  pc ad02a92c  /
system/lib/libdvm.so
01-01 00:02:57.765: INFO/DEBUG(1600):          #18  pc ad0169d0  /
system/lib/libdvm.so
01-01 00:02:57.770: INFO/DEBUG(1600):          #19  pc ad051f40  /
system/lib/libdvm.so
01-01 00:02:57.770: INFO/DEBUG(1600):          #20  pc ad03f8aa  /
system/lib/libdvm.so
01-01 00:02:57.780: INFO/DEBUG(1600):          #21  pc ad030b96  /
system/lib/libdvm.so
01-01 00:02:57.785: INFO/DEBUG(1600):          #22  pc ad326500  /
system/lib/libandroid_runtime.so
01-01 00:02:57.785: INFO/DEBUG(1600):          #23  pc ad326f90  /
system/lib/libandroid_runtime.so
01-01 00:02:57.785: INFO/DEBUG(1600):          #24  pc 00008bf2  /
system/bin/app_process
01-01 00:02:57.790: INFO/DEBUG(1600):          #25  pc afe1e1a2  /
system/lib/libc.so
01-01 00:02:57.795: INFO/DEBUG(1600):          #26  pc afe0b060  /
system/lib/libc.so
01-01 00:02:57.800: INFO/DEBUG(1600):          #27  pc b0000d70  /
system/bin/linker
01-01 00:02:57.800: INFO/DEBUG(1600): stack:
01-01 00:02:57.800: INFO/DEBUG(1600):     bef2e570  bef2e604  [stack]
01-01 00:02:57.810: INFO/DEBUG(1600):     bef2e574  afe0a333  /system/
lib/libc.so
01-01 00:02:57.810: INFO/DEBUG(1600):     bef2e578  ad07edf8
01-01 00:02:57.810: INFO/DEBUG(1600):     bef2e57c  4349d9d8
01-01 00:02:57.810: INFO/DEBUG(1600):     bef2e580  434a3c28
01-01 00:02:57.810: INFO/DEBUG(1600):     bef2e584  434a3c28
01-01 00:02:57.815: INFO/DEBUG(1600):     bef2e588  00000060
01-01 00:02:57.815: INFO/DEBUG(1600):     bef2e58c  ad048e9f  /system/
lib/libdvm.so
01-01 00:02:57.815: INFO/DEBUG(1600):     bef2e590  00000320
01-01 00:02:57.815: INFO/DEBUG(1600):     bef2e594  400092c0
01-01 00:02:57.815: INFO/DEBUG(1600):     bef2e598  434a3c28
01-01 00:02:57.830: INFO/DEBUG(1600):     bef2e59c  ad07edf8
01-01 00:02:57.830: INFO/DEBUG(1600):     bef2e5a0  00000320
01-01 00:02:57.830: INFO/DEBUG(1600):     bef2e5a4  ad048f91  /system/
lib/libdvm.so
01-01 00:02:57.830: INFO/DEBUG(1600):     bef2e5a8  ad07edf8
01-01 00:02:57.835: INFO/DEBUG(1600):     bef2e5ac  c2f81c1f
01-01 00:02:57.835: INFO/DEBUG(1600): #00 bef2e5b0  0000000b
01-01 00:02:57.835: INFO/DEBUG(1600):     bef2e5b4  00000004
01-01 00:02:57.835: INFO/DEBUG(1600):     bef2e5b8  ab800689  /system/
lib/libvideo_tel.so
01-01 00:02:57.835: INFO/DEBUG(1600):     bef2e5bc  4104acac
01-01 00:02:57.845: INFO/DEBUG(1600):     bef2e5c0  9fd020d0
01-01 00:02:57.845: INFO/DEBUG(1600):     bef2e5c4  afe1083b  /system/
lib/libc.so
01-01 00:02:57.845: INFO/DEBUG(1600): #01 bef2e5c8  bef2e628  [stack]
01-01 00:02:57.845: INFO/DEBUG(1600):     bef2e5cc  9fd014cb  /system/
lib/libvt.so
01-01 00:02:58.125: INFO/System.out(1948): For Vt stack Interface
class############true#########false######
01-01 00:02:58.125: INFO/System.out(1948): for VHello
class############0#########10######
01-01 00:02:58.185: INFO/ActivityManager(1645): Displayed activity
com.android.hello/.HelloAndroid: 570 ms

/////////////////////////
************************************//////////////////////////////////////

What I see is some Hex value followed by a library name.
 #00  pc afe0d24c  /system/lib/libc.so

Also there is a Stack section
01-01 00:02:57.800: INFO/DEBUG(1600): stack:
01-01 00:02:57.800: INFO/DEBUG(1600):     bef2e570  bef2e604  [stack]
01-01 00:02:57.810: INFO/DEBUG(1600):     bef2e574  afe0a333  /system/
lib/libc.so

This too gives similar information.

I am looking for little more informations rather than Hex values.
Like the backtrace feature where the stack hex values is mapped to the
function names and function names are visible.

Please provide information how to see the function names in stack
rather than Hex values.
Is ther any compiler options needs to be updated?
Any makefile to be updated to enable backtrace?

Thanks in advance...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
fadden  
View profile  
 More options Feb 12 2009, 3:47 pm
From: fadden <fad...@android.com>
Date: Thu, 12 Feb 2009 12:47:21 -0800 (PST)
Local: Thurs, Feb 12 2009 3:47 pm
Subject: Re: Q. Stack trace gives Hex values not function names when core library crashes
On Feb 12, 1:59 am, "click...@gmail.com" <click...@gmail.com> wrote:

> I am looking for little more informations rather than Hex values.
> Like the backtrace feature where the stack hex values is mapped to the
> function names and function names are visible.

The device can't show these, because the symbols are stripped out of
the libraries before they are installed on the device.  They do exist
in the build tree; since you're doing your own builds, you can find
them in the appropriate "symbols" directory under "out/".

Given that, you can use "arm-eabi-addr2line" to convert the symbols,
or use gdb/gdbserver to do debugging directly on the device.  Make
sure you're using the "out" directory that corresponds to the binaries
installed on the device.

In any event, discussions about debugging native libraries might be
more appropriate for android-porting or android-platform at this time.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rajat  
View profile  
 More options Mar 25 2009, 12:25 pm
From: rajat <rajat.n...@gmail.com>
Date: Wed, 25 Mar 2009 09:25:10 -0700 (PDT)
Local: Wed, Mar 25 2009 12:25 pm
Subject: Re: Q. Stack trace gives Hex values not function names when core library crashes
Hi
  While trying to debug native C libraries, upon receiving a SIGSEGV,
the core dump thrown does not map address values to symbols as seen in
DDMS. As mentioned above this is happening due to stripping of
binaries.
How can we prevent such stripping in Android or obtain detailed stack
trace despite stripping ?
Are there any changes we need to make to the Makefiles ?

Thanks in advance
On Feb 13, 1:47 am, fadden <fad...@android.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rajat  
View profile  
 More options Mar 25 2009, 12:25 pm
From: rajat <rajat.n...@gmail.com>
Date: Wed, 25 Mar 2009 09:25:24 -0700 (PDT)
Local: Wed, Mar 25 2009 12:25 pm
Subject: Re: Q. Stack trace gives Hex values not function names when core library crashes
Hi
  While trying to debug native C libraries, upon receiving a SIGSEGV,
the core dump thrown does not map address values to symbols as seen in
DDMS. As mentioned above this is happening due to stripping of
binaries.
How can we prevent such stripping in Android or obtain detailed stack
trace despite stripping ?
Are there any changes we need to make to the Makefiles ?

Thanks in advance
On Feb 13, 1:47 am, fadden <fad...@android.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jorge  
View profile  
 More options Apr 2 2009, 12:47 pm
From: Jorge <sirsol...@gmail.com>
Date: Thu, 2 Apr 2009 09:47:20 -0700 (PDT)
Local: Thurs, Apr 2 2009 12:47 pm
Subject: Re: Q. Stack trace gives Hex values not function names when core library crashes
To figure out this crash, you will need to use the addr2line tool
manually.

1) Find the path to the addr2line enter this command in the build env:

~/mydroid$ find . -name *addr2line

2) Find the location of the symbol directory enter this command in the
build env:

~/mydroid$ find . -name libopencorehw.so

3) Combine the two to manually parse this crash:

<path_to_addr2line_tool>\<addr2line_tool_name> -f -e
<path_to_symbol_directory>\<shared_lib_you_are_interested_in>

0x<AddressFromTheStackTrace>

From the stack trace:

I/DEBUG   (  705):          #00  pc 00004390

/system/lib/libopencorehw.so

I/DEBUG   (  705):          #01  pc 000dc942

/system/lib/libopencore_player.so

I/DEBUG   (  705):          #02  pc 000dc95a

/system/lib/libopencore_player.so

I/DEBUG   (  705):          #03  pc 000dc9f8

/system/lib/libopencore_player.so

I/DEBUG   (  705):          #04  pc 000b9b66

/system/lib/libopencore_common.so

You form the addr2line commands manually.

This line:

I/DEBUG   (  705):          #00  pc 00004390

/system/lib/libopencorehw.so

Would be turned into this line:

<path_to_addr2line_tool>\arm-eabi-addr2line -f -e
<path_to_symbol_directory>\libopencorehw.so 0x00004390

And so on ...

I/DEBUG   (  705):          #01  pc 000dc942

/system/lib/libopencore_player.so

<path_to_addr2line_tool>\arm-eabi-addr2line -f -e
<path_to_symbol_directory>\libopencore_player.so 0x000dc942

I/DEBUG   (  705):          #02  pc 000dc95a

/system/lib/libopencore_player.so

<path_to_addr2line_tool>\arm-eabi-addr2line -f -e
<path_to_symbol_directory>\libopencore_player.so 0x000dc95a

I/DEBUG   (  705):          #03  pc 000dc9f8

/system/lib/libopencore_player.so

<path_to_addr2line_tool>\arm-eabi-addr2line -f -e
<path_to_symbol_directory>\libopencore_player.so 0x000dc9f8

I/DEBUG   (  705):          #04  pc 000b9b66

/system/lib/libopencore_common.so

<path_to_addr2line_tool>\arm-eabi-addr2line -f -e
<path_to_symbol_directory>\libopencore_player.so 0x000dc9f8

... ETC ETC until you have the entire list.

Example for a crash I've seen:

#00  pc 0000e234  /system/lib/libc.so

Corresponds to this:

./prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin/arm-eabi-addr2line -
f -e ./out/target/product/generic/symbols/system/lib/libc.so
0x0000e234

Returns:

strlen

bionic/libc/arch-arm/bionic/strlen.c:62

Then you look in the files/line numbers indicated and debug it
further.

I hope this could help...

Jorge

On Mar 25, 10:25 am, rajat <rajat.n...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kemofish  
View profile  
 More options Apr 24 2009, 6:10 pm
From: kemofish <jtkreid...@gmail.com>
Date: Fri, 24 Apr 2009 15:10:55 -0700 (PDT)
Local: Fri, Apr 24 2009 6:10 pm
Subject: Re: Q. Stack trace gives Hex values not function names when core library crashes
I've heard of an Android tool called "stack" which helps analyze
crashes seen in logs.
Supposedly, this tool is located in <root>/android/tools/stack but I
don't see it.
I believe its used as follows:

cd <root>/android
adb logcat -d > log.txt
tools/stack log.txt > results.txt

I'm guessing the "stack" tool uses addr2line as described by Jorge
below but it goes through the logcat output, finds the crash log
entries, and does the addr2line conversion.

Does "stack" exist or is it an Android myth???

Joe

On Apr 2, 11:47 am, Jorge <sirsol...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
fadden  
View profile  
 More options Apr 27 2009, 6:09 pm
From: fadden <fad...@android.com>
Date: Mon, 27 Apr 2009 15:09:42 -0700 (PDT)
Local: Mon, Apr 27 2009 6:09 pm
Subject: Re: Q. Stack trace gives Hex values not function names when core library crashes
On Apr 24, 3:10 pm, kemofish <jtkreid...@gmail.com> wrote:

> I'm guessing the "stack" tool uses addr2line as described by Jorge
> below but it goes through the logcat output, finds the crash log
> entries, and does the addr2line conversion.

> Does "stack" exist or is it an Android myth???

vendor/google/tools/stack exists, but isn't part of the published
sources.  It has some google-internal build server stuff to make it
easier for us to grab the symbol files from specific releases.

We can't release it unless somebody runs through and deletes all the
google-specific goodies, which must be done without breaking anything;
so far that hasn't happened.

The key bit is this (python):

# Copyright (C) 2008 The Android Open Source Project
# License at http://www.apache.org/licenses/LICENSE-2.0

# returns a list containing the function name and the file/lineno
def CallAddr2Line(lib, addr):
  uname = os.uname()[0]
  if uname == "Darwin":
    proc = os.uname()[-1]
    if proc == "i386":
      uname = "darwin-x86"
    else:
      uname = "darwin-ppc"
  elif uname == "Linux":
    uname = "linux-x86"
  if lib != "":
    cmd = "./prebuilt/" + uname + \
        "/toolchain/arm-eabi-4.2.1/bin/arm-eabi-addr2line" \
        + " -f -e " + SYMBOLS_DIR + lib \
        + " 0x" + addr
    stream = os.popen(cmd)
    lines = stream.readlines()
    list = map(string.strip, lines)
  else:
    list = []
  if list != []:
    # Name like "move_forward_type<JavaVMOption>" causes troubles
    mangled_name = re.sub('<', '\<', list[0]);
    mangled_name = re.sub('>', '\>', mangled_name);
    cmd = "./prebuilt/" + uname + "/toolchain/arm-eabi-4.2.1/bin/arm-
eabi-c++filt "\
          + mangled_name
    stream = os.popen(cmd)
    list[0] = stream.readline()
    stream.close()
    list = map(string.strip, list)
  else:
    list = [ "(unknown)", "(unknown)" ]
  return list

where uname is usually "linux-x86".  Wrap the above in a loop and just
paste in the necessary bits, or make a smarter script that
automatically finds the start of the stack trace.

There was a change-up somewhere along the way between relative and
absolute addresses that can be worked around by zeroing out the high
12 bits.  The stuff posted earlier in this thread appeared to be
relative, so you may not have to worry about it.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »