thread suspension when dumping core

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Fri, 3 Jun 2016 19:23:47 -0700
Hi,

I've recently observed a hang in a multi-threaded process that had hit
an assertion failure and was attempting to dump core. One thread was
sleeping interruptibly on an advisory lock with TDF_SBDRY set (our
filesystem sets VFCF_SBDRY). SIGABRT caused the receipient thread to
suspend other threads with thread_single(SINGLE_NO_EXIT), which fails
to interrupt the sleeping thread, resulting in the hang.

My question is, why does the SA_CORE handler not force all threads to
the user boundary before attempting to dump core? It must do so later
anyway in order to exit. As I understand it, TDF_SBDRY is intended to
avoid deadlocks that can occur when stopping a process, but in this
case we don't stop the process with the intention of resuming it, so it
seems erroneous to apply this flag.

Thanks,
-Mark
Received on Sat Jun 04 2016 - 00:19:55 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:05 UTC