[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug 1895305] Re: pthread_cancel fails with "RT33" with musl libc

From: Laurent Vivier
Subject: [Bug 1895305] Re: pthread_cancel fails with "RT33" with musl libc
Date: Fri, 11 Sep 2020 14:54:41 -0000

** Tags added: linux-user

You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

  pthread_cancel fails with "RT33" with musl libc

Status in QEMU:

Bug description:
  From my testing it seems that QEMU built against musl libc crashes on
  pthread_cancel cancel calls - if the binary is also built with musl

  Minimal sample:

  #include <pthread.h>
  #include <stdio.h>
  #include <unistd.h>
  void* threadfunc(void* ignored) {
        while (1) {
        return NULL;
  int main() {
        pthread_t thread;
        pthread_create(&thread, NULL, &threadfunc, NULL);
        printf("OK, alive\n");

  In an Alpine Linux aarch64 chroot (on an x86_64 host) the binary will
  just output RT33 and has exit code 161.

  Using qemu-aarch64 on an x86_64 host results in the output (fish shell)
    fish: “qemu-aarch64-static ./musl-stat…” terminated by signal Unknown 
  or (bash)
    Real-time signal 2

  and exit code 164.

  It doesn't matter whether the binary is linked dynamically or static.
  You can see my test results in the following table:

  |                      | QEMU glibc | QEMU musl |
  | binary glibc dynamic | ✓          | ✓         |
  | binary glibc static  | ✓          | ✓         |
  | binary musl dynamic  | ✓          | ✗         |
  | binary musl static   | ✓          | ✗         |

  Both QEMU builds are v5.1.0 (glibc v2.32 / musl v1.2.1)

  I've uploaded all my compile and test commands (plus a script to
  conveniently run them all) to https://github.com/z3ntu/qemu-
  pthread_cancel . It also includes the built binaries if needed. The
  test script output can be found at https://github.com/z3ntu/qemu-

  Further links:
  - https://gitlab.com/postmarketOS/pmaports/-/issues/190#note_141902075
  - https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1970

To manage notifications about this bug go to:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]