forked from Manuel/meeting-assistant
retain bounded disk stack and resource pressure evidence
This commit is contained in:
@@ -126,8 +126,8 @@ observe_disk_query() {
|
||||
observation_child=$!
|
||||
(
|
||||
trap 'exit 0' TERM INT
|
||||
IFS= read -r -t 8 -u 9 unused || :
|
||||
printf '[disk-observation-timeout] %s child=%s limit=8s\n' "$name" "$observation_child" >> "$output"
|
||||
IFS= read -r -t 60 -u 9 unused || :
|
||||
printf '[disk-observation-timeout] %s child=%s limit=60s\n' "$name" "$observation_child" >> "$output"
|
||||
kill -TERM "$observation_child" 2>/dev/null || :
|
||||
IFS= read -r -t 2 -u 9 unused || :
|
||||
kill -KILL "$observation_child" 2>/dev/null || :
|
||||
@@ -141,18 +141,15 @@ observe_disk_query() {
|
||||
}
|
||||
trap cancel_observation TERM INT
|
||||
printf '[disk-observation] owned-diskutil-child=%s parent-shell=%s\n' "$disk_process" "$$" >> "$output"
|
||||
observe_command processes /bin/ps -axo pid,ppid,state,comm
|
||||
if [ -x /usr/bin/sample ]; then
|
||||
if kill -0 "$disk_process" 2>/dev/null; then
|
||||
observe_command diskutil-sample /usr/bin/sample "$disk_process" 3 10 -file "$sample_output"
|
||||
observe_command diskutil-sample /usr/bin/sample "$disk_process" 3 100 -file "$sample_output"
|
||||
else
|
||||
printf '[disk-observation-unavailable] diskutil already exited before sample\n' >> "$output"
|
||||
fi
|
||||
else
|
||||
printf '[disk-observation-unavailable] /usr/bin/sample is unavailable\n' >> "$output"
|
||||
fi
|
||||
observe_command arbitration /bin/launchctl print system/com.apple.diskarbitrationd
|
||||
observe_command management /bin/launchctl print system/com.apple.diskmanagementd
|
||||
}
|
||||
|
||||
stop_disk_observation() {
|
||||
@@ -186,6 +183,9 @@ run_command() {
|
||||
# Run 4161: even native uname/ps startup took 34-42s under TCG.
|
||||
# Isolate only the failed UID gate; every other watchdog remains unchanged.
|
||||
[[ "$name" != uid ]] || command_limit=180
|
||||
# BEGIN disk IPC diagnostic
|
||||
if [[ "$name" == disks && "${attempt:-0}" == 1 ]]; then command_limit=120; fi
|
||||
# END disk IPC diagnostic
|
||||
LAST_OUTPUT="/tmp/native-diagnostic-$name.out"
|
||||
printf '\n[proof-command] %s:' "$name" >&3
|
||||
printf ' %s' "$@" >&3
|
||||
@@ -298,7 +298,7 @@ flush_outputs || finish false diagnostic_log_budget_exceeded
|
||||
# Bound readiness independently of the host's 40-minute overall deadline.
|
||||
readiness_start=$SECONDS
|
||||
attempt=0
|
||||
while (( attempt < 2 && SECONDS - readiness_start < 600 )); do
|
||||
while (( attempt < 1 && SECONDS - readiness_start < 600 )); do
|
||||
attempt=$((attempt + 1))
|
||||
printf '\n[readiness-attempt] %s\n' "$attempt" >&3
|
||||
run_command disks /usr/sbin/diskutil list physical
|
||||
|
||||
Reference in New Issue
Block a user