summaryrefslogtreecommitdiffstats
path: root/results/classifier/zero-shot-user-mode/runtime/1895305
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-07-08 13:28:15 +0200
committerChristian Krinitsin <mail@krinitsin.com>2025-07-08 13:28:28 +0200
commit5aa276efcbd67f4300ca1a7f809c6e00aadb03da (patch)
tree9b8f0e074014cda8d42f5a97a95bc25082d8b764 /results/classifier/zero-shot-user-mode/runtime/1895305
parent1a3c4faf4e0a25ed0b86e8739d5319a634cb9112 (diff)
downloademulator-bug-study-5aa276efcbd67f4300ca1a7f809c6e00aadb03da.tar.gz
emulator-bug-study-5aa276efcbd67f4300ca1a7f809c6e00aadb03da.zip
restructure results
Diffstat (limited to 'results/classifier/zero-shot-user-mode/runtime/1895305')
-rw-r--r--results/classifier/zero-shot-user-mode/runtime/189530554
1 files changed, 54 insertions, 0 deletions
diff --git a/results/classifier/zero-shot-user-mode/runtime/1895305 b/results/classifier/zero-shot-user-mode/runtime/1895305
new file mode 100644
index 00000000..f6a6fa98
--- /dev/null
+++ b/results/classifier/zero-shot-user-mode/runtime/1895305
@@ -0,0 +1,54 @@
+runtime: 0.442
+instruction: 0.398
+syscall: 0.160
+
+
+
+pthread_cancel fails with "RT33" with musl libc
+
+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 libc.
+
+Minimal sample:
+
+#include <pthread.h>
+#include <stdio.h>
+#include <unistd.h>
+void* threadfunc(void* ignored) {
+ while (1) {
+ pause();
+ }
+ return NULL;
+}
+int main() {
+ pthread_t thread;
+ pthread_create(&thread, NULL, &threadfunc, NULL);
+ sleep(1);
+ pthread_cancel(thread);
+ 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 (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-pthread_cancel/blob/master/results.txt
+
+Further links:
+- https://gitlab.com/postmarketOS/pmaports/-/issues/190#note_141902075
+- https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1970 \ No newline at end of file