Skip to content

Commit

Permalink
fix: Reduce severity of thread suspend/resume failure log (#421)
Browse files Browse the repository at this point in the history
This message may happen frequently in an environment with many
short-lived threads and may not indicate an actual problem, just that
the thread cannot be resumed since it has completed execution since the
thread list was computed.
  • Loading branch information
kattrali authored Oct 10, 2019
1 parent c5a1ea7 commit 4447b34
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Source/KSCrash/Source/KSCrash/Recording/Tools/BSG_KSMach.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,10 @@ bool bsg_ksmachsuspendAllThreadsExcept(thread_t *exceptThreads,
if (thread != thisThread &&
!isThreadInList(thread, exceptThreads, exceptThreadsCount)) {
if ((kr = thread_suspend(thread)) != KERN_SUCCESS) {
BSG_KSLOG_ERROR("thread_suspend (%08x): %s", thread,
mach_error_string(kr));
// The thread may have completed running already
// Don't treat this as a fatal error.
BSG_KSLOG_DEBUG("thread_suspend (%08x): %s", thread,
mach_error_string(kr));
}
}
}
Expand Down Expand Up @@ -381,9 +382,10 @@ bool bsg_ksmachresumeAllThreadsExcept(thread_t *exceptThreads,
if (thread != thisThread &&
!isThreadInList(thread, exceptThreads, exceptThreadsCount)) {
if ((kr = thread_resume(thread)) != KERN_SUCCESS) {
BSG_KSLOG_ERROR("thread_resume (%08x): %s", thread,
mach_error_string(kr));
// The thread may have completed running already
// Don't treat this as a fatal error.
BSG_KSLOG_DEBUG("thread_resume (%08x): %s", thread,
mach_error_string(kr));
}
}
}
Expand Down

0 comments on commit 4447b34

Please sign in to comment.