Commit Graph

3093 Commits

Author SHA1 Message Date
Jeff Brown 13e715b491 Use libcorkscrew in debuggerd.
Change-Id: I5e3645a39d96c808f87075b49111d0262a19a0c8
2011-10-22 16:43:00 -07:00
Jeff Brown 10484a0684 Add x86 stack unwinding support to libcorkscrew.
Change-Id: I1d4f4b11b4c8bf517b1dd07afccbedc41a84fd1b
2011-10-22 16:43:00 -07:00
Jeff Brown 501edd29b8 Add a new library for collecting stack traces.
Supports collecting the stack trace of the current thread,
another thread in the same process, or a thread in a
different process (using ptrace).

Change-Id: Ica2594e4436edde4ceb7bcc3d78e6c31a7902cbf
2011-10-22 16:42:59 -07:00
Andy McFadden acfe378948 am 08dedcfd: Enable verbose register memory dumps
* commit '08dedcfd5cfeab526bb02382e4292f3150ed986f':
  Enable verbose register memory dumps
2011-10-19 14:19:20 -07:00
Andy McFadden 08dedcfd5c Enable verbose register memory dumps
Dump some memory at addresses for all registers that look like they
might have valid addresses.  Previously this was only done for PC
and LR.

(This is expected to be disabled before ship.)

Bug 5484924

Change-Id: I9802eaa396783e1286ae0c53eaf2473892c38a02
2011-10-19 13:28:33 -07:00
Andy McFadden 5e63c8309a am c69b6b70: Merge "Add log summary to tombstones"
* commit 'c69b6b70e3510c0b1fbf2f31d07eef5f0028a45e':
  Add log summary to tombstones
2011-10-19 12:02:43 -07:00
Andy McFadden c69b6b70e3 Merge "Add log summary to tombstones" 2011-10-19 12:01:26 -07:00
Nick Kralevich c74c894d87 am b62ace91: Merge "liblog: do better checks of log messages."
* commit 'b62ace913287fb4c43017cc039e23903926c1c1f':
  liblog: do better checks of log messages.
2011-10-19 09:14:52 -07:00
Nick Kralevich b62ace9132 Merge "liblog: do better checks of log messages." 2011-10-19 09:13:04 -07:00
Andy McFadden e5cc5396e8 Add log summary to tombstones
When the tombstones are uploaded to APR, they're truncated at 64KB.
This causes the log data, which is at the end, to be lost if the
process has more than about 12 threads (which many do).

This change adds the last few lines of the log right below the
report for the crashing thread, where we should be guaranteed to
keep it.

Also, clean up trailing newlines on log messages (which end up in
the tombstone), and don't print a "------- log" banner if there
aren't any messages in that log file (e.g. slog).

Also also, don't try to show_nearby_maps unless this is the crashing
thread.

Bug 5471955

Change-Id: Iaa4fd2fafbaeda2f20bb95f202177d7744a91f9d
2011-10-18 20:20:14 -07:00
Andy McFadden 85e0665705 am 05a28e1c: Merge "Enhance debuggerd memory dumps"
* commit '05a28e1cd4b9540e855f7f0ed37da9066c177e4d':
  Enhance debuggerd memory dumps
2011-10-18 17:14:05 -07:00
Andy McFadden 05a28e1cd4 Merge "Enhance debuggerd memory dumps" 2011-10-18 17:12:21 -07:00
Andy McFadden f2eae5a860 Enhance debuggerd memory dumps
This makes two changes:

(1) Display ASCII values next to the memory dumps.  For example:

I DEBUG: 00008ac4 706f6f4c 20676e69 74206425 73656d69  Looping %d times
I DEBUG: 00008ad4 7453000a 6e69726f 6f742067 0a702520  ..Storing to %p.
I DEBUG: 00008ae4 65642f00 657a2f76 55006f72 6c62616e  ./dev/zero.Unabl

(The hex values are still displayed as little-endian word values, while
the ASCII part is byte oriented.)

(2) Optionally display memory dumps for all registers, not just LR
and PC, for the crashing thread.  This is meant for situations where
we crash dereferencing foo->bar and want to see what the memory near
"foo" looks like -- could be handy if it got stomped by MUTF-16 text
or something recognizable.

Change #2 is currently disabled, via a compile-time setting.

Bug 5471955

Change-Id: Iacfd01c314055bad81db2f43b7d239f10086fcfb
2011-10-18 16:18:02 -07:00
Nick Kralevich e1ede1530f liblog: do better checks of log messages.
Testing:

The following test cases all passed and generated log entries:

 # echo -n '\03foo\0bar\0' > /dev/log/main
 # echo -n '\03\0bar\0' > /dev/log/main
 # echo -n '\03\0a\0' > /dev/log/main

The following entries were successfully processed by
logcat but produced no log entries:

 # echo -n '\03\0\0' > /dev/log/main
 # echo -n '\03a\0\0' > /dev/log/main
 # echo -n '\03b\0\0' > /dev/log/main

Also tested the pathological error condition:

 cat /dev/urandom > /dev/log/main

which produced many "+++ LOG: malformed log entry" errors.

Bug: 5478600
Change-Id: I53bc79507242dcfc14445746c29edf47be0a90b4
2011-10-18 15:37:15 -07:00
Nick Kralevich 942cfefc61 am 4423df76: Merge "logcat: add sanity check"
* commit '4423df76f589e9fbd566f368c453758451c82f78':
  logcat: add sanity check
2011-10-18 12:44:19 -07:00
Nick Kralevich 4423df76f5 Merge "logcat: add sanity check" 2011-10-18 12:42:26 -07:00
sinikang 8476bb93ce am 8cdd4c33: am aa75df74: [maguro] : add setprop net.tcp.buffersize.hspa
* commit '8cdd4c335f0d6e35e6def5ea73dcefb9687071b0':
  [maguro] : add setprop net.tcp.buffersize.hspa
2011-10-17 17:05:26 -07:00
sinikang 8cdd4c335f am aa75df74: [maguro] : add setprop net.tcp.buffersize.hspa
* commit 'aa75df74db5beffd25821ed6c360c36197d7bac1':
  [maguro] : add setprop net.tcp.buffersize.hspa
2011-10-17 17:03:15 -07:00
sinikang aa75df74db [maguro] : add setprop net.tcp.buffersize.hspa
-window size optimized for hspa
-Patchset2 : space removed

Change-Id: Ia4d1043d1a93c929721a4d7cca60ce9ff8bbf67a
Signed-off-by: sinikang <sinikang@samsung.com>
2011-10-17 15:56:02 -07:00
David 'Digit' Turner 15c6ad379b am 50f128a3: (-s ours) am 0f9581ab: (-s ours) am b064ed88: (-s ours) am 6306d419: DO NOT MERGE libsysutils: Fix potential overwrites in FrameworkListener
* commit '50f128a3924f4166ef3886b30659d81dfc8d5bb8':
  DO NOT MERGE libsysutils: Fix potential overwrites in FrameworkListener
2011-10-17 14:11:44 -07:00
David 'Digit' Turner 50f128a392 am 0f9581ab: (-s ours) am b064ed88: (-s ours) am 6306d419: DO NOT MERGE libsysutils: Fix potential overwrites in FrameworkListener
* commit '0f9581abf24738c03f572d12f8ef343b66145c61':
  DO NOT MERGE libsysutils: Fix potential overwrites in FrameworkListener
2011-10-17 14:09:56 -07:00
David 'Digit' Turner 0f9581abf2 am b064ed88: (-s ours) am 6306d419: DO NOT MERGE libsysutils: Fix potential overwrites in FrameworkListener
* commit 'b064ed888aaf6c3abbb839dfc60b9b8bfd17fa88':
  DO NOT MERGE libsysutils: Fix potential overwrites in FrameworkListener
2011-10-17 14:06:45 -07:00
David 'Digit' Turner b064ed888a am 6306d419: DO NOT MERGE libsysutils: Fix potential overwrites in FrameworkListener
* commit '6306d4192558c56ac130fe6d66fbca227fd137d6':
  DO NOT MERGE libsysutils: Fix potential overwrites in FrameworkListener
2011-10-17 14:03:37 -07:00
Nick Kralevich 46070505e7 logcat: add sanity check
Sanity check that the length we get back from the kernel matches
how much data we actually received.

Change-Id: I5cfd80321ab41459bb514dfde2da57413a7bd9e6
2011-10-17 11:40:06 -07:00
Nick Kralevich 2a736093f7 am 63f4a841: liblog: ensure that the message length is consistent
* commit '63f4a84104c228c74cdf132f5cef4f5184ae04bb':
  liblog: ensure that the message length is consistent
2011-10-17 11:04:08 -07:00
Nick Kralevich 63f4a84104 liblog: ensure that the message length is consistent
When parsing log entries which may have embedded \0s, it's
possible for entry->messageLen to not be the actual
length of the string in entry->message.  Detect this condition.

Bug: 5417417
Change-Id: I712cac7696af7831e24765b5a1b345d6ff5fb407
2011-10-17 10:47:04 -07:00
Andy McFadden f26c6567d6 am 76feaf37: Merge "Append log data to tombstones"
* commit '76feaf37218b7fec02ade30c143884df8299697c':
  Append log data to tombstones
2011-10-14 10:46:34 -07:00
Andy McFadden 76feaf3721 Merge "Append log data to tombstones" 2011-10-14 10:44:59 -07:00
Andy McFadden 41e0cef301 Append log data to tombstones
The Android Problem Report site shows tombstones uploaded from
devices.  We can see the native stack traces for every thread,
but sometimes there's a very important bit of information sitting
in the log, and without it we can't analyze the failure.

This change modifies debuggerd so that the log contents for the
crashing process are appended to the tombstone.  The format matches
the output of "logcat -v threadtime".  Both "system" and "main" logs
are included (but not interleaved -- we're not that fancy).

This feature is only enabled when the "ro.debuggable" system property
is set to 1 (indicating a development device).

Bug 5456676

Change-Id: I3be1df59813ccf1058cec496a906f6d31fbc7b04
2011-10-13 16:05:08 -07:00
Andy McFadden 08df672aac am 90e6f931: Merge "Show maps near native fault address"
* commit '90e6f931f25de36bf7d6e1b9c41ba8ba499631a8':
  Show maps near native fault address
2011-10-13 15:38:25 -07:00
Andy McFadden 90e6f931f2 Merge "Show maps near native fault address" 2011-10-13 15:36:36 -07:00
Dima Zavin 4238242982 am 6606dc95: am 471157a3: charger: key state being the same is not an error
* commit '6606dc9532b20f55d18e0d9cc925358aa1ceb119':
  charger: key state being the same is not an error
2011-10-13 14:09:07 -07:00
Dima Zavin 489ddab36e am d6da4d4f: am 47cca063: Merge changes Idcb48155,Iecb8c3db,I4924134b into ics-mr0
* commit 'd6da4d4fa58b40f66a4bb5b7b0d15bfe7ab7d8c9':
  charger: ignore key event if value didn't change
  charger: sync with the current key state on boot
  charger: print last_kmsg directly using klog_write
2011-10-13 14:08:49 -07:00
Dima Zavin 6606dc9532 am 471157a3: charger: key state being the same is not an error
* commit '471157a393d052aece013d1f8b7701aaadca3b6c':
  charger: key state being the same is not an error
2011-10-13 13:30:00 -07:00
Dima Zavin 471157a393 charger: key state being the same is not an error
Change-Id: I58d53899dbcca8329b65b189c1a6c5eea413c289
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-13 13:04:38 -07:00
Dima Zavin d6da4d4fa5 am 47cca063: Merge changes Idcb48155,Iecb8c3db,I4924134b into ics-mr0
* commit '47cca063939a9d5a3ea0b287d64aac0f53f4c45c':
  charger: ignore key event if value didn't change
  charger: sync with the current key state on boot
  charger: print last_kmsg directly using klog_write
2011-10-13 13:03:08 -07:00
Dima Zavin 47cca06393 Merge changes Idcb48155,Iecb8c3db,I4924134b into ics-mr0
* changes:
  charger: ignore key event if value didn't change
  charger: sync with the current key state on boot
  charger: print last_kmsg directly using klog_write
2011-10-13 13:01:56 -07:00
Andy McFadden 136dcc5ce6 Show maps near native fault address
This adds some additional output to native crashes.  For example, if
something tried to access a bit of mmap(/dev/zero) memory that had
been mprotect()ed, you might see output like this:

I DEBUG   : memory map around addr 4015a00c:
I DEBUG   : 40159000-4015a000 /system/lib/libstdc++.so
I DEBUG   : 4015a000-40162000 /dev/zero
I DEBUG   : b0001000-b0009000 /system/bin/linker

The idea is to see what's in and around the fault address to make it
easier to identify bus errors due to file truncation and segmentation
faults caused by buffer over/underruns.

No output is generated for accesses below 0x1000 (which are likely
NULL pointer dereferences) or for signals that don't set si_addr.

Also, suppress the fault address for signals that don't set si_addr:
I DEBUG   : signal 6 (SIGABRT), code 0 (?), fault addr --------

We still print "fault addr" followed by 8 characters for anything
that is parsing the contents.  The "address" shown for signals like
SIGABRT was meaningless and possibly confusing.

Bug 5358516

Change-Id: Icae8ef309ea2d89b129f68d30f96b2ca8a69cc6c
2011-10-13 12:35:55 -07:00
Wu-cheng Li 077b42cd4b am 5babfad4: am baad2843: Update camera documentation about face detection.
* commit '5babfad44584641316b4a2ff62c1a7c9392740e6':
  Update camera documentation about face detection.
2011-10-12 21:15:22 -07:00
Wu-cheng Li 5babfad445 am baad2843: Update camera documentation about face detection.
* commit 'baad2843a1af443aa251be510c4476159d064d20':
  Update camera documentation about face detection.
2011-10-12 21:14:15 -07:00
Wu-cheng Li baad2843a1 Update camera documentation about face detection.
bug:5169599
Change-Id: I5280137cee5401fadec36cae732ecb78a2d44dc3
2011-10-13 12:07:05 +08:00
Romain Guy b6472bd1a9 am 6bcd4d3e: Add ANDROID_API macro to export symbols
* commit '6bcd4d3e7310240d9424f13444542572e9ae3632':
  Add ANDROID_API macro to export symbols
2011-10-12 20:42:53 -07:00
Dima Zavin 2d978c01ee charger: ignore key event if value didn't change
Change-Id: Idcb481550eca53209be217361cac38e48368a04f
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-12 16:18:23 -07:00
Dima Zavin 2471a6a395 charger: sync with the current key state on boot
If the power key was down when we booted, we would not have
gotten the down event and thus the device would not have rebooted until
the user released and pressed it again.

Change-Id: Iecb8c3dba773bce4647748715d056e8e1d77f7e0
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-12 16:16:07 -07:00
Dima Zavin d11e1a0278 charger: print last_kmsg directly using klog_write
using the macros introduced extra characters that made things align
poorly.

Change-Id: I4924134be159723b4e4ed905c4293a42358d0ff5
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-12 16:14:00 -07:00
Romain Guy 6bcd4d3e73 Add ANDROID_API macro to export symbols
Change-Id: I55294713c8dd1ac32d6013d084f1bb502fc3572f
2011-10-12 13:45:59 -07:00
Nick Kralevich f620912651 am d707fb3f: enable heap randomization.
* commit 'd707fb3fb6448be04d6e14f7e478df7e298ebf35':
  enable heap randomization.
2011-10-12 12:38:24 -07:00
Nick Kralevich d707fb3fb6 enable heap randomization.
Bug: 5250555

Change-Id: I7acb0645402611875c481aec33ece85fced7a336
2011-10-11 15:35:39 -07:00
David 'Digit' Turner 6306d41925 DO NOT MERGE libsysutils: Fix potential overwrites in FrameworkListener
+ Handle EINTR in read()
Bug: 5438357
Backport from master.

Change-Id: If7d486dd4fb5666ce16ef36dca5f417da23e0b73
2011-10-10 14:26:13 -07:00
Wink Saville 6fcfb8e260 am 4e803c3c: Merge "Add log group to rild to improve log collection on modem issue"
* commit '4e803c3c18ad6a0cebbb16e2cf623a174f5201e1':
  Add log group to rild to improve log collection on modem issue
2011-10-10 12:26:00 -07:00