Skip to content

Commit 06898a0

Browse files
QuinceROMsjoeyhuab
authored andcommitted
core: Align Watchdog native dumps with crash_dump policy
Watchdog still requests native backtraces for keystore2 and vold via NATIVE_STACKS_OF_INTEREST. On current platform sepolicy crash_dump is never allowed to ptrace the keystore domain, and vold is only allowed on userdebug/eng. On user builds that mismatch turns watchdog native dump requests into noisy "Unwind request: crash_dump helper failed to exec, or was killed" messages. Build the list dynamically so keystore2 is always excluded and vold is only included on debuggable builds, matching the actual crash_dump policy. Signed-off-by: Quince <quinceroms@gmail.com>
1 parent 23d50a3 commit 06898a0

1 file changed

Lines changed: 33 additions & 25 deletions

File tree

services/core/java/com/android/server/Watchdog.java

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -122,31 +122,39 @@ public class Watchdog implements Dumpable {
122122
private static final String PROP_FATAL_LOOP_WINDOWS_SECS =
123123
"framework_watchdog.fatal_window.second";
124124

125-
// Which native processes to dump into dropbox's stack traces
126-
public static final String[] NATIVE_STACKS_OF_INTEREST = new String[] {
127-
"/system/bin/audioserver",
128-
"/system/bin/cameraserver",
129-
"/system/bin/drmserver",
130-
"/system/bin/idmap2d",
131-
"/system/bin/keystore2",
132-
"/system/bin/mediadrmserver",
133-
"/system/bin/mediaserver",
134-
"/system/bin/netd",
135-
"/system/bin/sdcard",
136-
"/system/bin/servicemanager",
137-
"/system/bin/surfaceflinger",
138-
"/system/bin/vold",
139-
"media.extractor", // system/bin/mediaextractor
140-
"media.metrics", // system/bin/mediametrics
141-
"media.codec", // vendor/bin/hw/android.hardware.media.omx@1.0-service
142-
"media.swcodec", // /apex/com.android.media.swcodec/bin/mediaswcodec
143-
"media.transcoding", // Media transcoding service
144-
"com.android.bluetooth", // Bluetooth service
145-
"/apex/com.android.art/bin/artd", // ART daemon
146-
"/apex/com.android.compos/bin/composd", // CompOS daemon (lazy service)
147-
"/apex/com.android.os.statsd/bin/statsd", // Stats daemon
148-
"/apex/com.android.virt/bin/virtualizationservice", // Core process in AVF
149-
};
125+
// Which native processes to dump into dropbox's stack traces.
126+
// Keep this in sync with crash_dump sepolicy: keystore2 is intentionally excluded because
127+
// crash_dump is never allowed to ptrace it, while vold is only dumpable on userdebug/eng.
128+
public static final String[] NATIVE_STACKS_OF_INTEREST = getNativeStacksOfInterest();
129+
130+
private static String[] getNativeStacksOfInterest() {
131+
ArrayList<String> processes = new ArrayList<>(Arrays.asList(
132+
"/system/bin/audioserver",
133+
"/system/bin/cameraserver",
134+
"/system/bin/drmserver",
135+
"/system/bin/idmap2d",
136+
"/system/bin/mediadrmserver",
137+
"/system/bin/mediaserver",
138+
"/system/bin/netd",
139+
"/system/bin/sdcard",
140+
"/system/bin/servicemanager",
141+
"/system/bin/surfaceflinger",
142+
"media.extractor", // system/bin/mediaextractor
143+
"media.metrics", // system/bin/mediametrics
144+
"media.codec", // vendor/bin/hw/android.hardware.media.omx@1.0-service
145+
"media.swcodec", // /apex/com.android.media.swcodec/bin/mediaswcodec
146+
"media.transcoding", // Media transcoding service
147+
"com.android.bluetooth", // Bluetooth service
148+
"/apex/com.android.art/bin/artd", // ART daemon
149+
"/apex/com.android.compos/bin/composd", // CompOS daemon (lazy service)
150+
"/apex/com.android.os.statsd/bin/statsd", // Stats daemon
151+
"/apex/com.android.virt/bin/virtualizationservice" // Core process in AVF
152+
));
153+
if (Build.IS_DEBUGGABLE) {
154+
processes.add("/system/bin/vold");
155+
}
156+
return processes.toArray(new String[0]);
157+
}
150158

151159
public static final List<String> HAL_INTERFACES_OF_INTEREST = Arrays.asList(
152160
"android.hardware.audio@4.0::IDevicesFactory",

0 commit comments

Comments
 (0)