mbox series

[0/3] tests: Fix some deadlocks

Message ID 20230117035701.168514-1-richard.henderson@linaro.org
Headers show
Series tests: Fix some deadlocks | expand

Message

Richard Henderson Jan. 17, 2023, 3:56 a.m. UTC
The first patch addresses the fact that linux-user blocks all signals
while attempting to handle guest signals (e.g. ABRT), which means that
the default TERM sent by timeout has no effect -- KILL instead.

When a guest aborts (possible nios2 guest bug), sending SIGABRT to
itself, I have caught one thread waiting in start_exclusive, and all
of the others blocked in exclusive_idle.  I look at that and think
there's a bug in our start_exclusive locking, but I can't prove it.

I also wonder whether qemu_plugin_user_exit really needs it, and since
that's the only place that seems to have issues at present, whether
it is in fact using it incorrectly.

Finally, I think we're missing at least a few early tests for
"no plugins registered", like this one, which ought to be fast path,
where the function need do no work whatsoever -- possibly including
taking the plugin lock, but I can't prove that either.

Anyway, this has improved make check-tcg -jX, for large X, which
appears to aggravate things.


r~


Richard Henderson (3):
  tests/tcg: Use SIGKILL for timeout
  plugins: Avoid deadlock in qemu_plugin_user_exit
  plugins: Iterate on cb_lists in qemu_plugin_user_exit

 plugins/core.c            | 13 +++++++------
 tests/tcg/Makefile.target |  4 ++--
 2 files changed, 9 insertions(+), 8 deletions(-)