Skip to content

Channel deadlock does not show stack trace #926

Open
@flimzy

Description

@flimzy

When a deadlock is detected by Go, it dumps a stack trace. GopherJS does not. This makes pinpointing these errors very difficult.

To reproduce, create this simple test program:

package main

func main() {
	x := make(chan int)
	<-x
}

Then execute with Go:

$ go run main.go
fatal error: all goroutines are asleep - deadlock!

goroutine 1 [chan receive]:
main.main()
        /home/jonhall/go/src/github.com/flimzy/test/main.go:5 +0x4d
exit status 2

And with GopherJS:

$ gopherjs run main.go
fatal error: all goroutines are asleep - deadlock!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions