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 <achille.roussel@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
Cherry Mui 2024-08-09 12:50:24 -04:00
parent 2ebe15c67e
commit 2f3fee058f
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ func signame(sig uint32) string {
}
func crash() {
*(*int32)(nil) = 0
abort()
}
func initsig(preinit bool) {