Commit graph

392 commits

Author SHA1 Message Date
Richard Uhler
3ff028c7db Merge "debuggerd: Dump list of open files on process crash."
am: b675f7cd32

Change-Id: Iec231fc7eb57fa2c51aabc0fb75b4a09c47004cd
2016-11-30 09:18:57 +00:00
Treehugger Robot
b675f7cd32 Merge "debuggerd: Dump list of open files on process crash." 2016-11-30 07:53:09 +00:00
Mark Salyzyn
10f4044341 Merge "system/core: replace EVENT_TAG_MAP_FILE with NULL"
am: 9bfd9f558b

Change-Id: Ief7fcc4f7dd8086186b38c091fed626560ca7215
2016-11-29 19:46:50 +00:00
Mark Salyzyn
1179eb8048 system/core: replace EVENT_TAG_MAP_FILE with NULL
NULL represents system default.  In the future, NULL could represent
static and dynamic tags, which can come from multiple files based on
implementation details in the liblog library.

Test: gTest logd-unit-tests & liblog-unit-tests
Bug: 31456426
Change-Id: I0e3d296de81ca299ae63d7b83781639ee67ec298
2016-11-21 11:13:02 -08:00
Richard Uhler
53fb32f05c debuggerd: Dump list of open files on process crash.
Test: Open a bunch of files, wait for the process to crash, verify dubuggerd
includes the list of open files the tombstone it generates.
Test: Added OpenFilesListTest to debuggerd_test.

Bug: 32013594

Change-Id: I6f939ae1d04dc58dc99abff0ed930da9e0ef0d1c
2016-11-21 11:40:42 +00:00
Josh Gao
e1a06eef2a Merge "crasher: add option to wait for input before crashing."
am: 84db3f19bc

Change-Id: I448bf3e527cd7435f650345492a9df1711b91048
2016-11-12 01:17:04 +00:00
Josh Gao
100ce3910d crasher: add option to wait for input before crashing.
This will be useful for tests that want to do things with crasher's pid
before it crashes.

Bug: http://b/30705528
Test: crasher wait-abort; crasher wait-thread-abort
Change-Id: I8ba826094dc304d6cd0e6ab088e5cfdb35d2007b
2016-11-11 14:29:13 -08:00
Mark Salyzyn
6df6448930 Merge "fix regression from android_lookupEventTag_len()"
am: 9fa133cc28

Change-Id: I8aa5cddb87290eaf86536b567b34cb3119839911
2016-10-24 23:12:42 +00:00
Mark Salyzyn
9f53cac1b4 fix regression from android_lookupEventTag_len()
Commit 807e40ecc9 'liblog: logd: Add
android_lookupEventTag_len()' which addressed a Dirty Shared memory
leak resulted in a regression. Most notably logcat <tag> stopped
working for the events log buffer.

AndroidLogEntry::tag also requires callers to check out
AndroidLogEntry::tagLen as tag is no longer guaranteed to be
nul terminated.

Test: logcat-unit-tests --gtest_filter=logcat.event_tag_filter
Bug: 31456426
Change-Id: Ibe5236131b640eb5b7e3df0ab4b5f3e25b85ad45
2016-10-24 13:39:19 -07:00
Mark Salyzyn
8a7297a09f Merge "system/core: preparation to pull back interfaces from android/log.h"
am: 27d2d49f48

Change-Id: I604bb1d4cf62636663fa92e3d14a55887dbcae23
2016-10-20 18:03:57 +00:00
Mark Salyzyn
cfd5b080af system/core: preparation to pull back interfaces from android/log.h
Point to log/log.h where necessary, define LOG_TAG where necessary.
Accept that private/android_logger.h is suitable replacement for
log/logger.h and android/log.h.

Correct liblog/README

Effectively a cleanup and controlled select revert of
'system/core: drop or replace log/logger.h' and
'system/core: Replace log/log.h with android/log.h'.

Test: compile
Bug: 30465923
Change-Id: Ic2ad157bad6f5efe2c6af293a73bb753300b17a2
2016-10-20 08:11:39 -07:00
Mark Salyzyn
400d85ab2a debuggerd: use __android_log_is_debuggable()
am: dafe384207

Change-Id: Idba40e16ccc20f66c14aa294033d534212646fbf
2016-10-18 16:46:11 +00:00
Mark Salyzyn
dafe384207 debuggerd: use __android_log_is_debuggable()
Test: compile and signal 8 to some component
Bug: 27566046
Bug: 31456426
Change-Id: I35e83679fbc40d54217850521bff23d9306d86f8
2016-10-14 11:12:16 -07:00
Elliott Hughes
f1dffe0501 Merge "Rely on the platform -std default." am: 955648a915
am: 4594f50635

Change-Id: I459e76bcada6d849eccca73a470a910e335482bf
2016-10-14 02:47:44 +00:00
Treehugger Robot
955648a915 Merge "Rely on the platform -std default." 2016-10-14 02:28:38 +00:00
Josh Gao
e758b2b3d3 Merge commit 'd3896c106d6a6e4d461be658a9e66efbde31f28d' into nyc-dev-plus-aosp
Change-Id: I77d77be5ba21c55cdf1172d7a7f7b4ba04dcbc81
2016-10-10 16:20:04 -07:00
Elliott Hughes
36e0d390a2 Rely on the platform -std default.
Bug: http://b/32019064
Test: builds
Change-Id: I18a1d816d63b64601485045070851f32d44e85eb
2016-10-10 14:31:12 -07:00
Josh Gao
218f7fb68e debuggerd: report crashes even when out of file descriptors.
Use nasty clone hacks to let us close random file descriptors to be
able to connect to debuggerd when the fd table is full.

Bug: http://b/32013594
Test: crasher exhaustfd-SIGSEGV
Change-Id: I47772e9a5994da4473bd935b105d9c36827c017a
2016-10-07 18:04:05 -07:00
Mark Salyzyn
6e5ffe2680 Merge "system/core: drop or replace log/logger.h" am: 1f90485804
am: cb670780be

Change-Id: I532a0f6143511f53f3303751f95de115ac034cd7
2016-10-04 18:33:44 +00:00
Mark Salyzyn
37c9451349 system/core: drop or replace log/logger.h
debuggerd does not require log/logger.h, can use android/log.h
In some cases, mark why log/logger.h was required.

Test: Compile and boot smoke test
Bug: 26552300
Bug: 31289077
Bug: 31456426
Change-Id: Ia34987e25a01d81971ec8d785415f732b8376c4f
2016-10-04 09:09:10 -07:00
Mark Salyzyn
0308b0eabd system/core Replace log/log.h with android/log.h am: ff2dcd9af9
am: cac331afd9

Change-Id: I95c6a64bc35a041688303fcee4d506865d0a19a4
2016-09-30 22:13:00 +00:00
Mark Salyzyn
16f7786032 system/core Replace cutils/log.h with android/log.h am: 66ce3e08c5
am: eb189f147b

Change-Id: I3f2b13e259d9bbb7bc714f21eab7181fa72c35bf
2016-09-30 22:12:55 +00:00
Mark Salyzyn
ff2dcd9af9 system/core Replace log/log.h with android/log.h
Should use android/log.h instead of log/log.h as a good example
to all others.  Adjust header order to comply with Android Coding
standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I33a8fb4e754d2dc4754d335660c450e0a67190fc
2016-09-30 12:47:05 -07:00
Mark Salyzyn
66ce3e08c5 system/core Replace cutils/log.h with android/log.h
Should use android/log.h instead of cutils/log.h as a good example
to all others.  Adjust header order to comply with Android Coding
standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I2c9cbbbd64d8dccf2d44356361d9742e4a9b9031
2016-09-30 12:47:05 -07:00
Elliott Hughes
c3501a4dff Merge "Fix debuggerd argument parsing." am: 99ed65234c
am: 014d9df418

Change-Id: I2565eb9a4b631e51bfe6bd57d328c8cdd2c3eff6
2016-09-16 21:13:17 +00:00
Elliott Hughes
9048608db1 Fix debuggerd argument parsing.
We weren't detecting incorrect input before. Also clean up the help output
to match the style of all the toybox output. Also flush stdout so that we
don't report failure before even saying that we're going to try to contact
debuggerd...

Change-Id: I9e4bfa878f270fe46c3c210c7a7138959a108d67
2016-09-15 17:08:33 -07:00
Elliott Hughes
6942f98f5d Merge "Teach debuggerd about SIGSYS SYS_SECCOMP signals." am: 44d7a87621
am: 9bec09f3cd

Change-Id: I57a46b611dfecac17d90df3d76da4c149d8f3704
2016-09-07 22:33:20 +00:00
Elliott Hughes
6fff551728 Teach debuggerd about SIGSYS SYS_SECCOMP signals.
These should be easier to interpret.

Bug: http://b/31171101
Change-Id: I362361d218390ab2306f86976172f8365b26b6ef
2016-09-07 13:55:50 -07:00
Christopher Ferris
99bb22da1b Merge "Update for kernel headers v4.7.2." am: 73d2cc570d
am: c4abab8578

Change-Id: I54f9530180e9d42032ed06fa7670125e5de0e4cf
2016-08-29 19:21:49 +00:00
Christopher Ferris
f83c7923f9 Update for kernel headers v4.7.2.
The new uapi kernel headers added a new SEGV reason code, so
add it to the tombstone code.

Update sync.c to include the needed data structures itself. Someone
else will be fixing this to work on old versus new kernels.

Change-Id: Icb27713ea38a20003c7671a9bca262eebd96099b
2016-08-26 16:48:18 -07:00
Mark Salyzyn
098b5887c6 Merge "logger: validate hdr_size field in logger entry" am: fcf7ab8b1b
am: 2d562c9dce

Change-Id: I5721e8614079a04c2dc364304d0ffed10d74be90
2016-08-24 16:07:38 +00:00
Mark Salyzyn
2d562c9dce Merge "logger: validate hdr_size field in logger entry"
am: fcf7ab8b1b

Change-Id: Ic88fe616256ab4949040771d3bed1dfb823ab981
2016-08-24 16:05:04 +00:00
Treehugger Robot
fcf7ab8b1b Merge "logger: validate hdr_size field in logger entry" 2016-08-24 15:56:23 +00:00
Elliott Hughes
66e5e2432a Merge "Most accept/accept4 calls in system/core don't actually want the remote address." am: 299d64144b
am: 8615d79d85

Change-Id: I89aeabf6efa8217c9acd3f8a766bbd18f7e994fa
2016-08-23 23:05:59 +00:00
Elliott Hughes
8615d79d85 Merge "Most accept/accept4 calls in system/core don't actually want the remote address."
am: 299d64144b

Change-Id: I3fb9678dfed08f0b1d6e90e547ecae6cdcabc9a1
2016-08-23 23:03:20 +00:00
Treehugger Robot
299d64144b Merge "Most accept/accept4 calls in system/core don't actually want the remote address." 2016-08-23 22:48:24 +00:00
Mark Salyzyn
305374cf0f logger: validate hdr_size field in logger entry
- check hdr_size to make sure it is in the expected range
  from sizeof entry_v1 to entry (entry_v4).
- alter msg() method to report NULL on invalid hdr_size
- alter all users of msg() method.

Bug: 30947841
Change-Id: I9bc1740d7aa9f37df5be966c18de1fb9de63d5dd
2016-08-23 14:51:50 -07:00
Josh Gao
c8146aa39f Merge "debuggerd: don't display fault addr for manually sent signals." am: ad52cbb9ec
am: 504d4ccd7c

Change-Id: Iac8f64e01b5dd3fa9ab6e34c2c151800142ccc69
2016-08-23 21:24:53 +00:00
Josh Gao
504d4ccd7c Merge "debuggerd: don't display fault addr for manually sent signals."
am: ad52cbb9ec

Change-Id: I34284b398c32dbdfe2074d44d316f81fc45deee8
2016-08-23 21:23:15 +00:00
Treehugger Robot
ad52cbb9ec Merge "debuggerd: don't display fault addr for manually sent signals." 2016-08-23 21:03:18 +00:00
Elliott Hughes
50a99aa6cb Merge "debuggerd: set SOCK_NONBLOCK in accept rather than later." am: 82b67fff06
am: 0d2ef3dc86

Change-Id: Ie8ae5707455f4d1741ca87ef515ea9a142e05aa5
2016-08-23 20:10:01 +00:00
Elliott Hughes
0d2ef3dc86 Merge "debuggerd: set SOCK_NONBLOCK in accept rather than later."
am: 82b67fff06

Change-Id: I6f2e72a4847fbfac8e1ba78321be7e026f7629bd
2016-08-23 20:05:48 +00:00
Elliott Hughes
3dcfa3fb1c Most accept/accept4 calls in system/core don't actually want the remote address.
So don't write the extra code for it or waste the kernel's time
copying it around.

Change-Id: I93de64064c2d4fe58ba5b5322cfa69bf31a76dad
2016-08-23 12:50:00 -07:00
Josh Gao
344ca5a681 debuggerd: don't display fault addr for manually sent signals.
Bug: http://b/30819045
Change-Id: Ic8ab21298dcba6acdfa876e7c729b14b0bf2afbb
Test: `killall -TRAP surfaceflinger` no longer shows fault addr,
      crasher still does
2016-08-23 12:31:14 -07:00
Elliott Hughes
874c674c60 debuggerd: set SOCK_NONBLOCK in accept rather than later.
Change-Id: I95586984dd7aec798d75b150be238d5f6f7c91da
2016-08-22 14:17:25 -07:00
Josh Gao
27259667ec Merge "debuggerd: remove unnecessary arguments." am: 7a746f3a68
am: 60083bed75

Change-Id: I6f575a9662319db0dffeb121e0400eaa8f8cee55
2016-08-13 00:41:56 +00:00
Josh Gao
60083bed75 Merge "debuggerd: remove unnecessary arguments."
am: 7a746f3a68

Change-Id: I0a01639dd3096372eb5bbbe28362cdbf1c1da4af
2016-08-13 00:38:54 +00:00
Josh Gao
4a984ced34 Merge "debuggerd: remove useless timeout from wait_for_signal." am: 5f2bc28ebf
am: 4c4a172ee9

Change-Id: Ibbf4ff52d9349e8ceee5a6550c997328b204f332
2016-08-12 20:17:41 +00:00
Josh Gao
4c4a172ee9 Merge "debuggerd: remove useless timeout from wait_for_signal."
am: 5f2bc28ebf

Change-Id: Iee4f22c04ad330c91f86ca03583f8e36b2816039
2016-08-12 20:02:10 +00:00
Josh Gao
a04c80255c debuggerd: remove unnecessary arguments.
These were previously required when bionic used tgkill to reraise
signals, but now that we use rt_tgsigqueueinfo to reraise signals, they
are no longer necessary.

Change-Id: I46ba9f14039a727d0a2c4c3a9d93a3532ba8f263
2016-08-12 11:00:18 -07:00