Closed qq906907952 closed 9 months ago
Hi @qq906907952 - thanks for the report. I will try to reproduce using the gzip library, but are you able to provide a code reproduction? Thanks.
Hi @qq906907952 - thanks for the report. I will try to reproduce using the gzip library, but are you able to provide a code reproduction? Thanks.
of course,there is the very simple code to reproduce the error
package main
import (
"bytes"
"compress/gzip"
_ "github.com/wasilibs/nottinygc"
)
func main() {
r := bytes.NewReader([]byte{})
gzip.NewReader(r)
}
compile with
tinygo build -o wasm.wasm -target wasi -gc=custom -tags=custommalloc -target=wasi -scheduler=none ./main.go
Thanks a lot for the repro @qq906907952! I have released 0.7.1 with a fix for the bug.
I was use this library with a wasi module written in Go to enhance the performance, but i encounter an error with panic: runtime error: divide by zero when i use compress/gzip stdlib to decode gzip bytes.
the full compile command:
tinygo build -o wasm.wasm -target wasi -gc=custom -tags=custommalloc -target=wasi -scheduler=none ./main.go
i run it with wasmtime:
env WASMTIME_BACKTRACE_DETAILS=1 wasmtime wasm.wasm
when i remove the gzip lib, everything is working fine
tinygo version:
tinygo version 0.30.0 linux/amd64 (using go version go1.21.3 and LLVM version 16.0.1)