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

TestHandshake fails occasionally #61

Closed
btc opened this issue Sep 12, 2014 · 11 comments
Closed

TestHandshake fails occasionally #61

btc opened this issue Sep 12, 2014 · 11 comments
Assignees
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@btc
Copy link
Contributor

btc commented Sep 12, 2014

=== RUN TestHandshake
fatal error: all goroutines are asleep - deadlock!
goroutine 16 [chan receive]:
testing.RunTests(0x69de80, 0x76a710, 0x1, 0x1, 0x1)
    /home/travis/.gvm/gos/go1.3.1/src/pkg/testing/testing.go:505 +0x923
testing.Main(0x69de80, 0x76a710, 0x1, 0x1, 0x7780a0, 0x0, 0x0, 0x7780a0, 0x0, 0x0)
    /home/travis/.gvm/gos/go1.3.1/src/pkg/testing/testing.go:435 +0x84
main.main()
    github.com/jbenet/go-ipfs/identify/_test/_testmain.go:47 +0x9c
goroutine 19 [finalizer wait]:
runtime.park(0x413090, 0x7739f0, 0x7724e9)
    /home/travis/.gvm/gos/go1.3.1/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0x7739f0, 0x7724e9)
    /home/travis/.gvm/gos/go1.3.1/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
    /home/travis/.gvm/gos/go1.3.1/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
    /home/travis/.gvm/gos/go1.3.1/src/pkg/runtime/proc.c:1445
goroutine 20 [chan receive]:
github.com/jbenet/go-ipfs/identify.Handshake(0xc208086380, 0xc20802d490, 0xc20802a0d0, 0xc20802a000, 0x30, 0x0, 0x0, 0x0)
    /home/travis/gopath/src/github.com/jbenet/go-ipfs/identify/identify.go:157 +0x159f
github.com/jbenet/go-ipfs/identify.TestHandshake(0xc2080501b0)
    /home/travis/gopath/src/github.com/jbenet/go-ipfs/identify/identify_test.go:50 +0x6f1
testing.tRunner(0xc2080501b0, 0x76a710)
    /home/travis/.gvm/gos/go1.3.1/src/pkg/testing/testing.go:422 +0x8b
created by testing.RunTests
    /home/travis/.gvm/gos/go1.3.1/src/pkg/testing/testing.go:504 +0x8db
goroutine 22 [chan receive]:
github.com/jbenet/go-ipfs/identify.secureInProxy(0xc20802a0d0, 0xc20807e720, 0x64e230, 0x6, 0xc208066870, 0x10, 0x44, 0xc208066880, 0x20, 0x34, ...)
    /home/travis/gopath/src/github.com/jbenet/go-ipfs/identify/identify.go:186 +0x168
created by github.com/jbenet/go-ipfs/identify.Handshake
    /home/travis/gopath/src/github.com/jbenet/go-ipfs/identify/identify.go:151 +0x1402
goroutine 23 [chan receive]:
github.com/jbenet/go-ipfs/identify.secureOutProxy(0xc20802a000, 0xc20807e780, 0x64e230, 0x6, 0xc208066820, 0x10, 0x44, 0xc208066830, 0x20, 0x34, ...)
    /home/travis/gopath/src/github.com/jbenet/go-ipfs/identify/identify.go:221 +0x16b
created by github.com/jbenet/go-ipfs/identify.Handshake
    /home/travis/gopath/src/github.com/jbenet/go-ipfs/identify/identify.go:152 +0x14b9
FAIL    github.com/jbenet/go-ipfs/identify  0.112s
@btc btc added the kind/bug A bug in existing code (including security flaws) label Sep 12, 2014
@whyrusleeping
Copy link
Member

Im glad im not crazy, i ran into this once. Havent been able to get a repro since.

@btc
Copy link
Contributor Author

btc commented Sep 12, 2014

I'll continue to report test failures as I discover them. I hope that collecting them will help

ps. To help with investigation, I'll also make sure to include the commit hash of the code that failed.

@btc
Copy link
Contributor Author

btc commented Sep 12, 2014

@whyrusleeping
Copy link
Member

Yeah, there's another random error I get "malformed public key" every so often.

@whyrusleeping
Copy link
Member

This deadlock is weird. There should be two goroutines in the Handshake method (and two sets of secure I/O). Im only seeing one... One must have somehow failed, but didnt end up causing a t.Fatal to trigger. Im gonna throw some panics in and run the test until i can repro a failure.

@btc
Copy link
Contributor Author

btc commented Sep 13, 2014

It was on feat/bitswap-internal-notifications at 6f82f7b

@whyrusleeping
Copy link
Member

I was also able to reproduce it once after switching to master. 20 runs later, no luck with a repro

@btc
Copy link
Contributor Author

btc commented Sep 13, 2014

Looks like deadlock occurs when:

  • peer a's handshake fails silently, peer b signals finished (identify.go:156) and waits on secureIn for a response(identify.go:157)

I found some spots where errors are ignored. Adding error handling. Will open a PR.

@btc btc added status/in-progress In progress and removed ready labels Sep 13, 2014
@btc
Copy link
Contributor Author

btc commented Sep 13, 2014

@jbenet Is there a spec for the handshake anywhere?

@btc btc added ready and removed status/in-progress In progress labels Sep 13, 2014
@jbenet jbenet added status/in-progress In progress and removed ready labels Sep 26, 2014
@jbenet
Copy link
Member

jbenet commented Sep 27, 2014

should have been fixed in #128

@jbenet jbenet closed this as completed Sep 27, 2014
@jbenet jbenet removed the status/in-progress In progress label Sep 27, 2014
@jbenet
Copy link
Member

jbenet commented Sep 27, 2014

Though, see: #130

@Stebalien Stebalien mentioned this issue May 26, 2020
77 tasks
@aschmahmann aschmahmann mentioned this issue Sep 22, 2020
72 tasks
ribasushi pushed a commit that referenced this issue Jul 4, 2021
Experimental: zap backend for go-log
ariescodescream pushed a commit to ariescodescream/go-ipfs that referenced this issue Oct 23, 2021
Update go-cid and gx-publish 2.5.2
laurentsenta pushed a commit to laurentsenta/kubo that referenced this issue Feb 25, 2022
…/libp2p/go-libp2p-core-0.3.1

Bump github.com/libp2p/go-libp2p-core from 0.3.0 to 0.3.1
laurentsenta pushed a commit to laurentsenta/kubo that referenced this issue Feb 25, 2022
…dules/github.com/libp2p/go-libp2p-core-0.3.1

Bump github.com/libp2p/go-libp2p-core from 0.3.0 to 0.3.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

3 participants