From: Cherry Mui Date: Fri, 9 Aug 2024 16:50:24 +0000 (-0400) Subject: runtime: make the wasm crash function abort X-Git-Tag: go1.24rc1~1221 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2f3fee058f3bb1c98b8ecc5aeb2329aaadf4dc0b;p=gostls13.git runtime: make the wasm crash function abort Currently the crash function on Wasm is implemented as a nil pointer dereference, which turns into a sigpanic, which turns into "panic during runtime execution" as we're already in runtime when crash is called. Instead, just abort, which crashes hard and terminates the Wasm module execution, and the execution engine often dumps a stack trace. Change-Id: I3c57f8ff7a0c0015e4abcd7bf262bf9001624b85 Reviewed-on: https://go-review.googlesource.com/c/go/+/604515 Reviewed-by: Achille Roussel LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek --- diff --git a/src/runtime/os_wasm.go b/src/runtime/os_wasm.go index fbafc319b9..fbf58439b9 100644 --- a/src/runtime/os_wasm.go +++ b/src/runtime/os_wasm.go @@ -96,7 +96,7 @@ func signame(sig uint32) string { } func crash() { - *(*int32)(nil) = 0 + abort() } func initsig(preinit bool) {