Skip to content

runtime: internal error: misuse of lockOSThread/unlockOSThread #6100

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

Closed
dvyukov opened this issue Aug 10, 2013 · 4 comments
Closed

runtime: internal error: misuse of lockOSThread/unlockOSThread #6100

dvyukov opened this issue Aug 10, 2013 · 4 comments
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Aug 10, 2013

parent: 17669:4f468b088d66 tip, windows/amd64

net benchmarks episodically crash with:

fatal error: runtime: internal error: misuse of lockOSThread/unlockOSThread

goroutine 12708 [running]:
runtime.throw(0x968710)
        src/pkg/runtime/panic.c:501 +0x67 fp=0x33224cc8
runtime.unlockOSThread()
        src/pkg/runtime/proc.c:1891 +0x3d fp=0x33224cd0
endcgo()
        src/pkg/runtime/cgocall.c:165 +0x20 fp=0x33224cd8
runtime.cgocall(0x424060, 0x33224d0c)
        src/pkg/runtime/cgocall.c:159 +0x159 fp=0x33224d04
syscall.Syscall(0x778b3918, 0x1, 0x200, 0x0, 0x0, ...)
        src/pkg/runtime/syscall_windows.goc:55 +0x4b fp=0x33224d28
syscall.Closesocket(0x200, 0x0, 0x0)
        src/pkg/syscall/zsyscall_windows_386.go:1399 +0x78 fp=0x33224d50
net.closesocket(0x200, 0x0, 0x0)
        src/pkg/net/fd_windows.go:71 +0x3a fp=0x33224d60
net.(*netFD).destroy(0x127ba180)
        src/pkg/net/fd_windows.go:360 +0x4c fp=0x33224d74
net.(*netFD).decref(0x127ba180)
        src/pkg/net/fd_windows.go:379 +0x40 fp=0x33224d80
net.(*netFD).Close(0x127ba180, 0x0, 0x0)
        src/pkg/net/fd_windows.go:421 +0x7b fp=0x33224d8c
net.(*conn).Close(0x12674908, 0x0, 0x0)
        src/pkg/net/net.go:139 +0x92 fp=0x33224da0
net/http.(*persistConn).closeLocked(0x125e6c30)
        src/pkg/net/http/transport.go:944 +0x3f fp=0x33224db0
net/http.(*persistConn).close(0x125e6c30)
        src/pkg/net/http/transport.go:938 +0x57 fp=0x33224db8
net/http.(*Transport).putIdleConn(0x125e81e0, 0x125e6c30, 0x1fc000)
        src/pkg/net/http/transport.go:323 +0x1ac fp=0x33224e20
net/http.func┬╖020(0x0, 0x0)
        src/pkg/net/http/transport.go:757 +0x60 fp=0x33224e3c
net/http.(*bodyEOFSignal).condfn(0x126b6930, 0x1fc000, 0x125e0020)
        src/pkg/net/http/transport.go:1024 +0x87 fp=0x33224e54
net/http.(*bodyEOFSignal).Read(0x126b6930, 0x12f1520d, 0x5f3, 0x5f3, 0x0, ...)
        src/pkg/net/http/transport.go:996 +0x1ff fp=0x33224e8c
bytes.(*Buffer).ReadFrom(0x12c95540, 0x1fde68, 0x126b6930, 0xd, 0x0, ...)
        src/pkg/bytes/buffer.go:169 +0x1da fp=0x33224ef4
io/ioutil.readAll(0x1fde68, 0x126b6930, 0x200, 0x0, 0x0, ...)
        src/pkg/io/ioutil/ioutil.go:32 +0x13f fp=0x33224f40
io/ioutil.ReadAll(0x1fde68, 0x126b6930, 0x0, 0x0, 0x0, ...)
        src/pkg/io/ioutil/ioutil.go:41 +0x6a fp=0x33224f68
net/http_test.func┬╖112()
        src/pkg/net/http/serve_test.go:1919 +0x12d fp=0x33224fd0
runtime.goexit()
        src/pkg/runtime/proc.c:1364 fp=0x33224fd4
created by net/http_test.benchmarkClientServerParallel
        src/pkg/net/http/serve_test.go:1930 +0x16c
@dvyukov
Copy link
Member Author

dvyukov commented Aug 10, 2013

Comment 1:

There is something wrong with our testing process if we don't catch such bugs. There
were several similar recently.

@alexbrainman
Copy link
Member

Comment 3:

I haven't seen this one before. I have no idea what this is. If you give me some
suggestions, I could try and investigate it. Unless you already have a solution.
Alex

@dvyukov
Copy link
Member Author

dvyukov commented Aug 12, 2013

Comment 4:

I have a fix:
https://golang.org/cl/12703045/
It's not windows-specific.

@dvyukov
Copy link
Member Author

dvyukov commented Aug 13, 2013

Comment 5:

This issue was closed by revision 4961483.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 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
Development

No branches or pull requests

4 participants