You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. git clone git://gist.github.com/1195562.git gist-1195562 or retrieve and unzip the
attached file
2. cd gist-1195562
3. gotest
What is the expected output?
2011/09/05 19:11:19 Got an square message
2011/09/05 19:11:19 Got a cube message
2011/09/05 19:11:19 Got a close message
PASS
What do you see instead?
2011/09/05 19:10:39 Got an square message
2011/09/05 19:10:39 Got a cube message
2011/09/05 19:10:39 Got a close message
throw: all goroutines are asleep - deadlock!
goroutine 1 [chan receive]:
testing.RunTests(0x2000, 0xf0de8, 0x100000001, 0x219c)
/Users/jnwhiteh/scm/golang.hg/src/pkg/testing/testing.go:201 +0x440
testing.Main(0x2000, 0xf0de8, 0x100000001, 0xfc528, 0x0, ...)
/Users/jnwhiteh/scm/golang.hg/src/pkg/testing/testing.go:168 +0x54
main.main()
/Users/jnwhiteh/Desktop/gist-1195562/_testmain.go:29 +0x6d
goroutine 2 [chan receive]:
foo.TestShutdown(0x421363a0, 0x0)
/Users/jnwhiteh/Desktop/gist-1195562/foo_test.go:21 +0x193
testing.tRunner(0x421363a0, 0xf0de8, 0x0, 0x0)
/Users/jnwhiteh/scm/golang.hg/src/pkg/testing/testing.go:156 +0x2b
created by testing.RunTests
/Users/jnwhiteh/scm/golang.hg/src/pkg/testing/testing.go:200 +0x420
goroutine 3 [chan send]:
foo.(*Server).loop(0x42136360, 0x0)
/Users/jnwhiteh/Desktop/gist-1195562/foo.go:41 +0x2e1
created by foo.NewServer
/Users/jnwhiteh/Desktop/gist-1195562/foo.go:20 +0xb4
gotest: "./6.out" failed: exit status 2
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
Mac OS X 10.7.1
Which revision are you using? (hg identify)
02cfad1793be tip
Please provide any additional information below.
I tried to create a (more) minimal test case, but I was having trouble reproducing the
issue with smaller cases, so this is a very simple program that directly mirrors the
structure of a part of my code and demonstrates the issue.
The main problem is that the following code blocks indefinitely:
res := (<-s.out).(m_res_close)
whereas this version works correctly
<-s.out
as does this version (showing the types do in fact match):
msg := <-s.out
res := msg.(m_res_close)
Additionally it appears that if the struct (m_res_close) contains an item such as an
int, the problem goes away and the code that fails above will succeed.
I should say that I did recompile the source tree with escape analysis disabled (just in
case that was part of the issue) but it did not alter the results. Additionally, I
cannot reproduce this issue when using release.r59.
by jnwhiteh:
Attachments:
The text was updated successfully, but these errors were encountered: