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

panic: sync: unlock of unlocked mutex #47

Closed
clandmeter opened this issue Dec 22, 2015 · 0 comments
Closed

panic: sync: unlock of unlocked mutex #47

clandmeter opened this issue Dec 22, 2015 · 0 comments

Comments

@clandmeter
Copy link

I'm cross posting Sioro-Neoku/go-peerflix#16 as it seems this issue also happens on torrent.

I am building/running torrent on alpine linux which is based on musl libc.

 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
�[0A�[2K
 [--------------------------------------------------------------------]   0% getting info
panic: sync: unlock of unlocked mutex

goroutine 73 [running]:
sync.(*Mutex).Unlock(0xc8200856b8)
    /usr/lib/go/src/sync/mutex.go:108 +0x9f
github.com/anacrolix/torrent/dht.(*Announce).maybeAnnouncePeer(0xc8201fc000, 0x7f50d7a0e000, 0xc8201de0c0, 0x0, 0x0, 0xc82021ab20, 0x14)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/announce.go:162 +0x2f1
github.com/anacrolix/torrent/dht.(*Announce).getPeers.func1(0x0, 0x0, 0x0, 0xc820219f40, 0x1, 0xc820219fe0, 0x1, 0xc8201d85a0, 0x0, 0xc820219650, ...)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/announce.go:199 +0x47b
github.com/anacrolix/torrent/dht.(*Transaction).tryHandleResponse(0xc8201e8240)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/transaction.go:40 +0xc9
github.com/anacrolix/torrent/dht.(*Transaction).handleResponse(0xc8201e8240, 0x0, 0x0, 0x0, 0xc820219f40, 0x1, 0xc820219fe0, 0x1, 0xc8201d85a0, 0x0, ...)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/transaction.go:147 +0x199
created by github.com/anacrolix/torrent/dht.(*Server).processPacket
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/server.go:197 +0x3e2

goroutine 1 [semacquire]:
sync.runtime_Syncsemacquire(0xc8200b47e0)
    /usr/lib/go/src/runtime/sema.go:237 +0x201
sync.(*Cond).Wait(0xc8200b47d0)
    /usr/lib/go/src/sync/cond.go:62 +0x9b
github.com/anacrolix/torrent.(*Client).WaitAll(0xc8200b4580, 0x0)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:2479 +0xd6
main.main()
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/cmd/torrent/main.go:143 +0x2d6

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/lib/go/src/runtime/asm_amd64.s:1721 +0x1

goroutine 6 [semacquire]:
sync.runtime_Syncsemacquire(0xc8200b47e0)
    /usr/lib/go/src/runtime/sema.go:237 +0x201
sync.(*Cond).Wait(0xc8200b47d0)
    /usr/lib/go/src/sync/cond.go:62 +0x9b
github.com/anacrolix/torrent.(*Client).waitAccept(0xc8200b4580)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:616 +0x18b
github.com/anacrolix/torrent.(*Client).acceptConnections(0xc8200b4580, 0x7f50d7b54a70, 0xc820038070, 0xc820011600)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:622 +0x33
created by github.com/anacrolix/torrent.NewClient
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:511 +0x863

goroutine 7 [IO wait]:
net.runtime_pollWait(0x7f50d7b55930, 0x72, 0xc8200101a0)
    /usr/lib/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc820067870, 0x72, 0x0, 0x0)
    /usr/lib/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc820067870, 0x0, 0x0)
    /usr/lib/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).readFrom(0xc820067810, 0xc820122000, 0x2000, 0x2000, 0x0, 0x0, 0x0, 0x7f50d7b50050, 0xc8200101a0)
    /usr/lib/go/src/net/fd_unix.go:259 +0x2a5
net.(*UDPConn).ReadFromUDP(0xc820038078, 0xc820122000, 0x2000, 0x2000, 0x0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/net/udpsock_posix.go:61 +0x117
net.(*UDPConn).ReadFrom(0xc820038078, 0xc820122000, 0x2000, 0x2000, 0x1e5, 0x0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/net/udpsock_posix.go:79 +0x116
github.com/anacrolix/utp.(*Socket).reader(0xc820114000)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/utp/utp.go:458 +0xf1
created by github.com/anacrolix/utp.NewSocketFromPacketConn
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/utp/utp.go:432 +0x24b

goroutine 8 [chan receive]:
github.com/anacrolix/utp.(*Socket).dispatcher(0xc820114000)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/utp/utp.go:509 +0x6e
created by github.com/anacrolix/utp.NewSocketFromPacketConn
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/utp/utp.go:433 +0x270

goroutine 9 [semacquire]:
sync.runtime_Syncsemacquire(0xc8200b47e0)
    /usr/lib/go/src/runtime/sema.go:237 +0x201
sync.(*Cond).Wait(0xc8200b47d0)
    /usr/lib/go/src/sync/cond.go:62 +0x9b
github.com/anacrolix/torrent.(*Client).waitAccept(0xc8200b4580)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:616 +0x18b
github.com/anacrolix/torrent.(*Client).acceptConnections(0xc8200b4580, 0x7f50d7b55bb0, 0xc820114000, 0xc82000b401)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:622 +0x33
created by github.com/anacrolix/torrent.NewClient
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:525 +0xa37

goroutine 10 [running]:
    goroutine running on other thread; stack unavailable
created by github.com/anacrolix/torrent/dht.NewServer
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/server.go:111 +0x3aa

goroutine 11 [select]:
github.com/anacrolix/torrent/dht.(*Server).bootstrap(0xc820085680, 0x0, 0x0)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/server.go:586 +0x5a5
github.com/anacrolix/torrent/dht.NewServer.func2(0xc820038088)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/server.go:113 +0x28
created by github.com/anacrolix/torrent/dht.NewServer
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/server.go:121 +0x3cc

goroutine 12 [sleep]:
time.Sleep(0x989680)
    /usr/lib/go/src/runtime/time.go:59 +0xf9
github.com/gosuri/uiprogress.(*Progress).Listen(0xc820012640)
    /home/clandmeter/go-torrent-orig/src/github.com/gosuri/uiprogress/progress.go:98 +0xbc
created by github.com/gosuri/uiprogress.(*Progress).Start
    /home/clandmeter/go-torrent-orig/src/github.com/gosuri/uiprogress/progress.go:112 +0x35

goroutine 13 [chan receive]:
github.com/anacrolix/torrent.(*Client).announceTorrentTrackersFastStart(0xc8200b4580, 0xc820016840, 0xc82000b6a0, 0x1, 0x1, 0xc820088dc0, 0x0)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:2396 +0x20f
github.com/anacrolix/torrent.(*Client).announceTorrentTrackers(0xc8200b4580, 0xc820088dc0)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:2421 +0x20c
created by github.com/anacrolix/torrent.(*Client).AddTorrentSpec
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:2217 +0x7f7

goroutine 14 [select]:
github.com/anacrolix/torrent.(*Client).announceTorrentDHT(0xc8200b4580, 0xc820088dc0, 0x1)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:2293 +0x811
created by github.com/anacrolix/torrent.(*Client).AddTorrentSpec
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:2220 +0x839

goroutine 15 [chan receive]:
main.torrentBar.func3(0xc8200b4580, 0xc820088dc0, 0xc8200a8500)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/cmd/torrent/main.go:60 +0x59
created by main.torrentBar
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/cmd/torrent/main.go:67 +0x12b

goroutine 16 [chan receive]:
main.addTorrents.func3(0xc8200b4580, 0xc820088dc0)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/cmd/torrent/main.go:106 +0x55
created by main.addTorrents
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/cmd/torrent/main.go:108 +0x23a

goroutine 19 [select]:
net/http.(*Transport).getConn(0xc820082090, 0xc8201ae000, 0x0, 0xc8201aa000, 0x4, 0xc8201aa007, 0x15, 0x0, 0x0, 0x0)
    /usr/lib/go/src/net/http/transport.go:554 +0x663
net/http.(*Transport).RoundTrip(0xc820082090, 0xc8201ae000, 0x150, 0x0, 0x0)
    /usr/lib/go/src/net/http/transport.go:228 +0x4ac
net/http.send(0xc8201ae000, 0x7f50d7b544d8, 0xc820082090, 0xc8201aa100, 0x0, 0x0)
    /usr/lib/go/src/net/http/client.go:220 +0x52c
net/http.(*Client).send(0xb65c20, 0xc8201ae000, 0xf6, 0x0, 0x0)
    /usr/lib/go/src/net/http/client.go:143 +0x15a
net/http.(*Client).doFollowingRedirects(0xb65c20, 0xc8201ae000, 0x9d3cf0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/net/http/client.go:380 +0xbc0
net/http.(*Client).Get(0xb65c20, 0xc8201aa000, 0xf6, 0xc8201a6000, 0x0, 0x0)
    /usr/lib/go/src/net/http/client.go:306 +0xaa
net/http.Get(0xc8201aa000, 0xf6, 0xf6, 0x0, 0x0)
    /usr/lib/go/src/net/http/client.go:281 +0x45
github.com/anacrolix/torrent/tracker.(*client).Announce(0xc8200a8480, 0xc820016840, 0x0, 0xc800000000, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/tracker/http.go:74 +0xd43
github.com/anacrolix/torrent.(*Client).announceTorrentSingleTracker(0xc8200b4580, 0x7f50d7b55d08, 0xc8200a8480, 0xc820016840, 0xc820088dc0, 0x0, 0x0)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:2362 +0x3ed
github.com/anacrolix/torrent.(*Client).announceTorrentTrackersFastStart.func1(0xc8200b4580, 0xc820016840, 0xc820088dc0, 0xc8200168a0, 0x7f50d7b55d08, 0xc8200a8480)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:2390 +0x50
created by github.com/anacrolix/torrent.(*Client).announceTorrentTrackersFastStart
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/client.go:2392 +0x195

goroutine 72 [semacquire]:
sync.runtime_Semacquire(0xc8202187fc)
    /usr/lib/go/src/runtime/sema.go:43 +0x26
sync.(*WaitGroup).Wait(0xc8202187f0)
    /usr/lib/go/src/sync/waitgroup.go:126 +0xb4
github.com/anacrolix/torrent/dht.(*Server).bootstrap.func2(0xc8202187f0, 0xc820226660)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/server.go:582 +0x21
created by github.com/anacrolix/torrent/dht.(*Server).bootstrap
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/server.go:584 +0x3f6

goroutine 66 [IO wait]:
net.runtime_pollWait(0x7f50d7b55630, 0x77, 0x453980)
    /usr/lib/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc82019e220, 0x77, 0x0, 0x0)
    /usr/lib/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitWrite(0xc82019e220, 0x0, 0x0)
    /usr/lib/go/src/net/fd_poll_runtime.go:82 +0x36
net.(*netFD).connect(0xc82019e1c0, 0x0, 0x0, 0x7f50d7b55d48, 0xc820190500, 0xece0b1cc5, 0x397e26a5, 0xb65ce0, 0x0, 0x0)
    /usr/lib/go/src/net/fd_unix.go:114 +0x1f6
net.(*netFD).dial(0xc82019e1c0, 0x7f50d7b54aa8, 0x0, 0x7f50d7b54aa8, 0xc82018e780, 0xece0b1cc5, 0x397e26a5, 0xb65ce0, 0x0, 0x0)
    /usr/lib/go/src/net/sock_posix.go:137 +0x351
net.socket(0x903060, 0x3, 0x2, 0x1, 0x0, 0xc82018e700, 0x7f50d7b54aa8, 0x0, 0x7f50d7b54aa8, 0xc82018e780, ...)
    /usr/lib/go/src/net/sock_posix.go:89 +0x411
net.internetSocket(0x903060, 0x3, 0x7f50d7b54aa8, 0x0, 0x7f50d7b54aa8, 0xc82018e780, 0xece0b1cc5, 0x5b397e26a5, 0xb65ce0, 0x1, ...)
    /usr/lib/go/src/net/ipsock_posix.go:160 +0x141
net.dialTCP(0x903060, 0x3, 0x0, 0xc82018e780, 0xece0b1cc5, 0xc8397e26a5, 0xb65ce0, 0x1, 0x0, 0x0)
    /usr/lib/go/src/net/tcpsock_posix.go:171 +0x11e
net.dialSingle(0xc820188280, 0x7f50d7b54a40, 0xc82018e780, 0xece0b1cc5, 0x7fff397e26a5, 0xb65ce0, 0x0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/net/dial.go:364 +0x3f5
net.dialSerial.func1(0xece0b1cc5, 0x397e26a5, 0xb65ce0, 0x0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/net/dial.go:336 +0x75
net.dial(0x903060, 0x3, 0x7f50d7b54a40, 0xc82018e780, 0xc8201596e8, 0xece0b1cc5, 0x397e26a5, 0xb65ce0, 0x0, 0x0, ...)
    /usr/lib/go/src/net/fd_unix.go:40 +0x60
net.dialSerial(0xc820188280, 0xc82018c670, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/net/dial.go:338 +0x760
net.(*Dialer).Dial(0xc820012410, 0x903060, 0x3, 0xc8201aa007, 0x15, 0x0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/net/dial.go:232 +0x50f
net.(*Dialer).Dial-fm(0x903060, 0x3, 0xc8201aa007, 0x15, 0x0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/net/http/transport.go:38 +0x6e
net/http.(*Transport).dial(0xc820082090, 0x903060, 0x3, 0xc8201aa007, 0x15, 0x0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/net/http/transport.go:499 +0x79
net/http.(*Transport).dialConn(0xc820082090, 0x0, 0xc8201aa000, 0x4, 0xc8201aa007, 0x15, 0x0, 0x0, 0x0)
    /usr/lib/go/src/net/http/transport.go:596 +0x19a9
net/http.(*Transport).getConn.func4(0xc820082090, 0x0, 0xc8201aa000, 0x4, 0xc8201aa007, 0x15, 0xc8201bc000)
    /usr/lib/go/src/net/http/transport.go:549 +0x66
created by net/http.(*Transport).getConn
    /usr/lib/go/src/net/http/transport.go:551 +0x265

goroutine 83 [select]:
github.com/anacrolix/torrent/dht.(*Server).Announce.func2(0xc8201fc000)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/announce.go:76 +0x244
created by github.com/anacrolix/torrent/dht.(*Server).Announce
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/announce.go:87 +0x474
panic: sync: inconsistent mutex state

goroutine 10 [running]:
sync.(*Mutex).Lock(0xc8200856b8)
    /usr/lib/go/src/sync/mutex.go:74 +0x16d
github.com/anacrolix/torrent/dht.(*Server).serve(0xc820085680, 0x0, 0x0)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/server.go:213 +0x1a7
github.com/anacrolix/torrent/dht.NewServer.func1(0xc820038088)
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/server.go:102 +0x28
created by github.com/anacrolix/torrent/dht.NewServer
    /home/clandmeter/go-torrent-orig/src/github.com/anacrolix/torrent/dht/server.go:111 +0x3aa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant