From 277112277f74642e670ef772934fc284ab3f0aba Mon Sep 17 00:00:00 2001 From: Qianxi Chen Date: Fri, 17 Apr 2026 07:39:32 +0000 Subject: [PATCH] misc fixes --- src/wasmtime/crates/lind-common/src/lib.rs | 4 +++- src/wasmtime/crates/wasmtime/src/runtime/linker.rs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wasmtime/crates/lind-common/src/lib.rs b/src/wasmtime/crates/lind-common/src/lib.rs index 77320eb91..fc0a0937c 100644 --- a/src/wasmtime/crates/lind-common/src/lib.rs +++ b/src/wasmtime/crates/lind-common/src/lib.rs @@ -191,7 +191,9 @@ fn add_syscall_to_linker< // If the syscall was interrupted by a signal (EINTR), invoke the signal handler. // If fork is called within the signal handler, asyncify will unwind the stack; // we save the syscall return value so it can be restored on rewind. - if -retval == sysdefs::constants::Errno::EINTR as i32 { + // Only negate `retval` if it falls within the valid errno range; + // since negating `I32::MIN` would cause an overflow panic. + if retval < 0 && retval > -256 && -retval == sysdefs::constants::Errno::EINTR as i32 { caller.as_context_mut().append_syscall_asyncify_data(retval); wasmtime_lind_multi_process::signal::signal_handler(&mut caller); diff --git a/src/wasmtime/crates/wasmtime/src/runtime/linker.rs b/src/wasmtime/crates/wasmtime/src/runtime/linker.rs index 7bbd8523d..9b8578e88 100644 --- a/src/wasmtime/crates/wasmtime/src/runtime/linker.rs +++ b/src/wasmtime/crates/wasmtime/src/runtime/linker.rs @@ -960,6 +960,7 @@ impl Linker { | "__wasm_apply_data_relocs" | "__wasm_apply_global_relocs" | "__wasm_apply_tls_relocs" + | "__wasm_init_tls" // asyncify symbols | "asyncify_start_unwind" | "asyncify_stop_unwind"