Skip to content

crash on interp timeout #3893

@dkegel-fastly

Description

@dkegel-fastly

I can reproduce this on both mac and linux. I boiled it down on mac to this:

main.go:

package main
func main() {
	println("hello, world")
}

go.mod:

module main

go 1.21.0

To reproduce:

$ go mod tidy
$ tinygo version
tinygo version 0.29.0 darwin/amd64 (using go version go1.21.0 and LLVM version 15.0.0)

$ tinygo build -interp-timeout=0s
  
# main
/Users/dkegel/tobug: interp: running for more than 0s, timing out (executed calls: 1)
  SIGSEGV: segmentation violation
PC=0x10423f89c m=11 sigcode=1
signal arrived during cgo execution

goroutine 1 [syscall]:
runtime.cgocall(0x1003e2960, 0xc0006e9460)
	/Users/runner/hostedtoolcache/go/1.21.0/x64/src/runtime/cgocall.go:157 +0x4b fp=0xc0006e9438 sp=0xc0006e9400 pc=0x10000934b
tinygo.org/x/go-llvm._Cfunc_LLVMDumpValue(0x600001718180)
	_cgo_gotypes.go:4906 +0x3f fp=0xc0006e9460 sp=0xc0006e9438 pc=0x10024c83f
main.printCompilerError.Value.Dump.func1({0xc000120400?})
	/Users/runner/go/pkg/mod/tinygo.org/x/go-llvm@v0.0.0-20221028183034-8341240c0b32/ir.go:722 +0x39 fp=0xc0006e9498 sp=0xc0006e9460 pc=0x1003b6579
tinygo.org/x/go-llvm.Value.Dump(...)
	/Users/runner/go/pkg/mod/tinygo.org/x/go-llvm@v0.0.0-20221028183034-8341240c0b32/ir.go:722
main.printCompilerError(0x104680bc0, {0x1046f2840?, 0xc00018c000?})
	/Users/runner/work/tinygo/tinygo/main.go:1293 +0x1d6 fp=0xc0006e9748 sp=0xc0006e9498 pc=0x1003b5a96
main.handleCompilerError({0x1046f2840?, 0xc00018c000?})
	/Users/runner/work/tinygo/tinygo/main.go:1326 +0x2f fp=0xc0006e9770 sp=0xc0006e9748 pc=0x1003b65cf
main.main()
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions