Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/net/websocket: test hangs (sometimes) with GOMAXPROCS=1 ; spins eating CPU #360

Closed
gopherbot opened this issue Nov 30, 2009 · 4 comments
Closed
Milestone

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 30, 2009

by cw@f00f.org:

What steps will reproduce the problem?
1. build the code, sometimes the websocket test hangs
2. if it doesn't, cd src/pkg/websocket/

  make test
  <watch>

usually only a few attempts is needed for me; f.e.:

  cw@lysdexia:~/wk/go/go.hg/src/pkg/websocket$ for t in {1..100} ; do ./6.out ; done
  [...]
hangs within a few iterations

this never hangs:
  cw@lysdexia:~/wk/go/go.hg/src/pkg/websocket$ for t in {1..100} ; do GOMAXPROCS=2 ./6.out ; done
  [...]


What is your $GOOS?  $GOARCH?

linux amd64



Which revision are you using?  (hg identify)

6ccdfb494664+ tip



FWIW, the hang is inside "ws.Close();" at the end of websocket_test.go though
it's not clear why 
to be looking at this.  The hang is not in the main thread of execution as you can see:

  write(7, "\0hello, world\n\377"..., 15) = 15
  read(7, "\0hello, world\n\377"..., 4096) = 15
  fcntl(7, F_GETFL)                       = 0x802 (flags O_RDWR|O_NONBLOCK)
  fcntl(7, F_SETFL, O_RDWR)               = 0
  write(5, "\0"..., 1)                    = 1
  close(7)                                = 0
  futex(0x4aae48, FUTEX_WAIT, 3, {1073741824, 0}

and another (OS) thread is burning all the CPU.  That thread is not making any system
calls (I 
thought perhaps the socket close was causing some goroutine to spin on an error, but
that would 
show up tracing the thread that's consuming all the CPU cycles).
@hoisie
Copy link
Contributor

@hoisie hoisie commented Nov 30, 2009

Comment 1:

also happens to me on linux/386
@skelterjohn
Copy link
Contributor

@skelterjohn skelterjohn commented Nov 30, 2009

Comment 2:

This may be the same error I am having - darwin/amd64
When I ctrl-C it, this pops up
--- cd ../test
^C0a1,151
> 
> == ./
> 
> =========== ./cmp2.go
> comparing uncomparable type []int
> throw: interface compare
(more output)
So, perhaps something in cmp1.go?
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Dec 1, 2009

Comment 3 by cw@f00f.org:

Looks like there is some confusion where err is shadowed so the return codes aren't 
working entirely as expected.
http://golang.org/cl/163055 is an initial fix I did after dho pointed out the 
return values didn't appear to be coming out right.
A better fix will come a bit later after some more testing.
@agl
Copy link
Contributor

@agl agl commented Dec 1, 2009

Comment 4:

This issue was closed by revision 4f6dbc6.

Status changed to Fixed.

Merged into issue #-.

@gopherbot gopherbot added the fixed label Dec 1, 2009
@mikioh mikioh changed the title websocket test hangs (sometimes) with GOMAXPROCS=1 ; spins eating CPOU x/net/websocket: test hangs (sometimes) with GOMAXPROCS=1 ; spins eating CPU Jul 30, 2015
@mikioh mikioh modified the milestone: Unreleased Jul 30, 2015
@golang golang locked and limited conversation to collaborators Aug 5, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.