Skip to content

Fix deadlock when dying because of a signal

Ilya Leoshkevich qemu-devel 4 versions – Applied

Status from this message: Queued to tcg-next, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 1 replyApplied
  2. v34 patches 0 repliesSuperseded
  3. v24 patches 5 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches5 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/4linux-user: Always exit from exclusive state in fork_end()linux-user/main.c linux-user/syscall.c+7 -40 replies
2/4cpus: Make {start,end}_exclusive() recursivecpus-common.c include/hw/core/cpu.h+12 -40 replies
3/4linux-user/microblaze: Handle privileged exceptionlinux-user/microblaze/cpu_loop.c+8 -20 replies
4/4tests/tcg/linux-test: Add linux-fork-trap testtests/tcg/multiarch/linux/linux-fork-trap.c+51 -00 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonAlex Bennée
1/4R-b R-b
2/4R-b R-b
3/4R-b
4/4R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/4] Fix deadlock when dying because of a signal

Based-on: <[email protected]> ("[PATCH 00/14] linux-user/sparc: Handle missing traps")

v3: https://lists.gnu.org/archive/html/qemu-devel/2023-02/msg03534.html
v3 -> v4: Add printfs to the test in order to make the uncaught signals
less scary:

$ build/x86_64-linux-user/qemu-x86_64 build/tests/tcg/x86_64-linux-user/linux-fork-trap about to trigger fault...
qemu: uncaught target signal 4 (Illegal instruction) - core dumped faulting thread exited cleanly

v2: https://lists.gnu.org/archive/html/qemu-devel/2023-02/msg03299.html
v2 -> v3: Use exclusive_context_count = 1 instead of
exclusive_context_count++ in the non-recursive case.

v1: https://lists.gnu.org/archive/html/qemu-devel/2023-01/msg07251.html
v1 -> v2: Drop the sparc patch (superseded by Richard's series).
Add the end_exclusive() fix.

Hi,

wasmtime testsuite found a deadlock in qemu_plugin_user_exit(). I tracked it down to one of my earlier patches, which introduced cleanup in dump_core_and_abort().

Patches 1 and 2 fix the issue, patch 3 fixes __builtin_trap() handling in microblaze, which is needed for patch 4, that adds a test.

Best regards,
Ilya

Ilya Leoshkevich (4):
linux-user: Always exit from exclusive state in fork_end()
cpus: Make {start,end}_exclusive() recursive linux-user/microblaze: Handle privileged exception tests/tcg/linux-test: Add linux-fork-trap test

 cpus-common.c                               | 12 ++++-
 include/hw/core/cpu.h                       |  4 +-
 linux-user/main.c                           | 10 ++--
 linux-user/microblaze/cpu_loop.c            | 10 +++-
 linux-user/syscall.c                        |  1 +
 tests/tcg/multiarch/linux/linux-fork-trap.c | 51 +++++++++++++++++++++
 6 files changed, 78 insertions(+), 10 deletions(-)
 create mode 100644 tests/tcg/multiarch/linux/linux-fork-trap.c
Signature · 1 line
2.39.1