The fix is to use the C++ empty struct initialization {} instead of the
C-style {0}.
Bug: 27378717
Change-Id: I36896d1202bf30b5db5689ac13acaff3b3f1b30b
The two types of fixes are:
* Assign expected non-negative values to unsigned int variables.
* Annotate constant expected integer values as unsigned.
Bug: 27378717
Change-Id: Ifc13beedd61a28ed685e1a06a7cefe99072e3345
The user collector test creates several symlinks to the temporary
directory that it doesn't unlink. Fix it.
BUG=27365098
TEST=run `crash_reporter_tests`, tests pass, no symlinks are left behind
Change-Id: I7ad24c528dc842e17fa3569ea010f43d34e0bd75
Move the bdk_version, product_id, and product_version metadata
population into the base crash_collector class so that all
colletors correctly report those fields in crash reports.
BUG=27344416
TEST=crash_reporter_tests passes.
Change-Id: I050053055f197d01661a1442e3cdcccc53c1c8fe
Some of the unit tests manually create their own temp
directories from a relative path. This creates a temp folder
in the folder that the test is run from. This is a problem
when using test_droid or a non-interactive ADB shell command,
since the root directory is not writable. Instead use a
ScopedTempDir to handle temporary folders.
Bug: 26671657
Change-Id: Iaf71d345565dcb4393e80426784a864f7f8b5929
Test: Unit tests pass when running brillo_WhitelistedGtests
The new libchrome has been ported from Chromium and some APIs have
changed. Make necessary changes at call sites.
Change-Id: I9e45975cdef43913270b82e3fca2c027e614a464
Add crash_reporter_tests to debug builds, so that they can be
run by test_droid.
Bug: 26663796
Change-Id: Iddaa14ab55474875a45b0e8482bac310fbe8cff2
Test: /data/nativetest/crash_reporter_tests exists on eng build
Add a README describing the basic functionality and configuration
of crash_reporter. Also include some development tips based on
feedback from users.
Bug: 26387853
Change-Id: I42655841171fcfb0a8efdf587e596e6930357e4e
Currently one of the udev collector tests is failing due to the lack
of gzip on the device. Since we don't have gzip nor udev in Android builds,
remove the udev collector (and tests) from Android builds.
See http://r.android.com/184708 for discussion on removing the udev
collector completely from the source.
Bug: 25779348
Test: `/data/nativetest/crash_reporter_tests/crash_reporter_tests` passes
Change-Id: I883359ac8219f2e1fa6a78927433dbc0be295fe7
There is no longer a reliance on RTTI in libbrillo, so disable RTTI
in the rest of Brillo codebase.
Bug: 26292405
Change-Id: I2751a2ac973a74741a82f5cd949fc0adaf2449a6
Use /system/etc/security/cacerts_google as the default certificates
directory. If the crash_reporter.full_certs property is set to 1,
use the full /system/etc/security/cacerts directory. This
property can be set in a target's product.mk, if they decide to
configure crash_reporter with a crash_server not covered by the
cacerts_google subset of certificates.
Bug: 25798318
Change-Id: I617c3d13b74af8d9577823a8f1a61f8375bcb504
Access to /proc files are limited to processes with group
permissions for AID_READPROC, so add that group to the list
of supplemental groups that the user_collector joins.
Bug: 25598241
Change-Id: I26c77b052229346a3ac7150f38e03294f3641f96
Using cfgtree.mk, this change adds support to load the
crash server URL directly from a file in the product tree
during the build.
BUG=25343470
TEST=build image, check in etc for the populated osrelease.d file
Change-Id: I6342a829936809b9553a32be7bc58285c86dd732
Convert the crash reporter upload log to be json objects.
Report the product_id in the crash report upload log. Also add
the exec name to the log to make it easier finding specific
crash reports if multiple binaries are crashing.
Bug: 25121166
Change-Id: I48ad88fcb0bb00b4a21dc6f2aa54f94cead971ea
When doing a clean build, creating this file fails because the dir does
not yet exist:
echo "" > out/target/product/brilloemulator_arm/obj/ETC/crash_server_intermediates/crash_server
/bin/bash: out/target/product/brilloemulator_arm/obj/ETC/crash_server_intermediates/crash_server: No such file or directory
Bug: 24989289
Change-Id: If204dc0eb32e95ee66f97b568b4b9ae4050d3591
Since all of the other configs use os-release.d rather than
system properties, switch the crash server url as well. This also
makes the product configuration more straightforward.
Bug: 24989289
Change-Id: Ia4b423e59937a917c882e74b110b5ea520ca6016
The /data directory isn't guaranteed to be mounted during the
"on boot" trigger, so switch them to using "on post-fs-data".
Bug: 24941965
Change-Id: Iee84ca0e934967cff7bc4d968d9939d398c73980
The product_id and product_version has been moved into the
/etc/os-release.d key-value store, update crash_reporter to
use these values.
Bug: 22874192
Change-Id: I71886574d1aa4e0a3ac18e1c361ec65684af9b49
libchromeos is transitioning to libbrillo and chromeos namespaces
and include directory is changing to brillo.
Bug: 24872993
Change-Id: I797613a38c7444a113f12e38366a424388477276
Rather than assuming the UID and GID of crashing processes is
the same, report and use the actual GID that the process was
running as.
Bug: 24678424
Change-Id: I3cfc415be2feb2863a4f4b850bfd4a3267217a44
In order to read the /proc/<pid> files from non-root users without
using CAP_SYS_PTRACE and CAP_DAC_OVERRIDE, use setresuid(..) and
setresgid(..) to switch to the process's user to copy off necessary
files for generating the breakpad minidump.
Bug: 24678424
Change-Id: I4a43583033587441394483ce678c40c4161808b9
Read in the ro.build.id property for version, and
ro.product.product_id for the Product ID.
Bug: 22874192
Change-Id: I9a3fbf375d49d04fc7bf6700c5987cb9e435c318
Instead of grepping the build description for "Official", use
the property ro.secure.
Bug: 24404853
Change-Id: Ia0423b3524ac9472db6a782509b56c9834c8d26e
We can use the LOCAL_INIT_RC variable for init.rc files.
Also, switch to use <service>.rc for the filename, since this is what
Android does now.
Bug: 24465893
Change-Id: I924acbe758ba9994020093005e27c8c06d0686ff
Rather than share the guid with metrics, crash_reporter should
use its own guid that is persistent across reboots but not
across factory resets.
Bug: 24102242
Change-Id: I1bcc1a10aa8e1c09372386fe8e1661a8894b8d70
When calculating the crash_sender spread time, make sure that the
random number is not negative when converted to a shell int variable.
Bug: 24004011
Change-Id: I3b95dc244a26270ef2b93d5af4b0593a93eedcad
Read the crash server URL from the crash_reporter.server
property. If it is not set, return a configuration error.
Bug: 22874192
Change-Id: Iac341b6352fe9c1b54cd2e8561ed4a5bbe8ddddc
- Added grep to the list of required modules.
- Run crash_sender with the 'system' group to allow calls to
metrics_client to read both metrics files owned by system and
crash_reporter files owned by root.
- Fix periodic_scheduler's check delay to actually be 5 minutes.
Bug: 23122375
Change-Id: Iff214c4e591a676a516162a92ea5aedcf0824f46
- Remove all the ChromeOS specific logic.
- Fix paths to correct Android paths.
- Add periodic_scheduler, and add crash_sender to init.
Bug: 23231196
Bug: 23233267
Change-Id: I12de28bfbe5d5b08831eda9b28c6d7a669c22290