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

0.18.0-rc1: panic in webtransport.(*stream).Write/Read #9515

Closed
3 tasks done
ylempereur opened this issue Dec 20, 2022 · 2 comments · Fixed by #9522
Closed
3 tasks done

0.18.0-rc1: panic in webtransport.(*stream).Write/Read #9515

ylempereur opened this issue Dec 20, 2022 · 2 comments · Fixed by #9522
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@ylempereur
Copy link

Checklist

Installation method

ipfs-update or dist.ipfs.tech

Version

Kubo version: 0.18.0-rc1
Repo version: 13
System version: amd64/darwin
Golang version: go1.19.1

Config

No response

Description

18-rc1 appears to crash randomly while running. After looking at the log (enclosed), I issued the following command, which eliminated the crashes:

ipfs config --json Swarm.Transports.Network.WebTransport false

Here are a few examples of the log after a crash:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x1c1fb84]

goroutine 879095 [running]:
github.com/libp2p/go-libp2p/p2p/transport/webtransport.(*stream).Write(0x10?, {0xc00c4e7000?, 0x100c013489c00?, 0x0?})
        github.com/libp2p/go-libp2p@v0.24.1/p2p/transport/webtransport/stream.go:46 +0x24
github.com/libp2p/go-libp2p/p2p/net/swarm.(*Stream).Write(0xc00721e880, {0xc00c4e7000?, 0x2d?, 0xc00e5ec100?})
        github.com/libp2p/go-libp2p@v0.24.1/p2p/net/swarm/swarm_stream.go:66 +0x36
bufio.(*Writer).Flush(0xc00e5ec100)
        bufio/bufio.go:629 +0x62
github.com/multiformats/go-multistream.(*lazyClientConn).doWriteHandshakeWithData(0xc0076af810, {0xc004be6000, 0x2d, 0x1000})
        github.com/multiformats/go-multistream@v0.3.3/lazyClient.go:114 +0x145
github.com/multiformats/go-multistream.(*lazyClientConn).Write.func1()
        github.com/multiformats/go-multistream@v0.3.3/lazyClient.go:129 +0xf2
sync.(*Once).doSlow(0x170aca7?, 0x2d?)
        sync/once.go:74 +0xc2
sync.(*Once).Do(...)
        sync/once.go:65
github.com/multiformats/go-multistream.(*lazyClientConn).Write(0xc0076af810?, {0xc004be6000?, 0x2d?, 0x1000?})
        github.com/multiformats/go-multistream@v0.3.3/lazyClient.go:127 +0x93
github.com/libp2p/go-libp2p/p2p/host/basic.(*streamWrapper).Write(0xc018f28b80?, {0xc004be6000?, 0x0?, 0x0?})
        github.com/libp2p/go-libp2p@v0.24.1/p2p/host/basic/basic_host.go:1023 +0x27
bufio.(*Writer).Flush(0xc00907b800)
        bufio/bufio.go:629 +0x62
github.com/libp2p/go-libp2p-kad-dht/internal/net.(*bufferedDelimitedWriter).Flush(...)
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/internal/net/message_manager.go:381
github.com/libp2p/go-libp2p-kad-dht/internal/net.WriteMsg({0x2cd678e8?, 0xc00e145840}, 0xc005aa0930?)
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/internal/net/message_manager.go:373 +0x145
github.com/libp2p/go-libp2p-kad-dht/internal/net.(*peerMessageSender).writeMsg(...)
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/internal/net/message_manager.go:321
github.com/libp2p/go-libp2p-kad-dht/internal/net.(*peerMessageSender).SendRequest(0xc00beee640, {0x2b81c00, 0xc005aa0930}, 0xc01c4ad020?)
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/internal/net/message_manager.go:281 +0x16d
github.com/libp2p/go-libp2p-kad-dht/internal/net.(*messageSenderImpl).SendRequest(0xc001655ac0, {0x2b81b58, 0xc00bf5bac0}, {0xc01c4ad020, 0x26}, 0xc018f28b80?)
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/internal/net/message_manager.go:88 +0x374
github.com/libp2p/go-libp2p-kad-dht/pb.(*ProtocolMessenger).GetClosestPeers(0xc0004a0780, {0x2b81b58, 0xc00bf5bac0}, {0xc01c4ad020, 0x26}, {0xc003df87b0?, 0xc0008d9da0?})
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/pb/protocol_messenger.go:108 +0xd4
github.com/libp2p/go-libp2p-kad-dht.(*IpfsDHT).FindPeer.func1({0x2b81b58, 0xc00bf5bac0}, {0xc01c4ad020, 0x26})
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/routing.go:604 +0xfb
github.com/libp2p/go-libp2p-kad-dht.(*query).queryPeer(0xc014621c20, {0x2b81b58, 0xc00bf5bac0}, 0xc00013fe40?, {0xc01c4ad020, 0x26})
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/query.go:408 +0x26e
created by github.com/libp2p/go-libp2p-kad-dht.(*query).spawnQuery
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/query.go:325 +0x44a

----

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x1c1fb84]

goroutine 2542410 [running]:
github.com/libp2p/go-libp2p/p2p/transport/webtransport.(*stream).Write(0x10?, {0xc04cf20000?, 0x100c0161fbd80?, 0x0?})
        github.com/libp2p/go-libp2p@v0.24.1/p2p/transport/webtransport/stream.go:46 +0x24
github.com/libp2p/go-libp2p/p2p/net/swarm.(*Stream).Write(0xc00a1a6300, {0xc04cf20000?, 0x2d?, 0xc01788d8c0?})
        github.com/libp2p/go-libp2p@v0.24.1/p2p/net/swarm/swarm_stream.go:66 +0x36
bufio.(*Writer).Flush(0xc01788d8c0)
        bufio/bufio.go:629 +0x62
github.com/multiformats/go-multistream.(*lazyClientConn).doWriteHandshakeWithData(0xc03d128540, {0xc04de75000, 0x2d, 0x1000})
        github.com/multiformats/go-multistream@v0.3.3/lazyClient.go:114 +0x145
github.com/multiformats/go-multistream.(*lazyClientConn).Write.func1()
        github.com/multiformats/go-multistream@v0.3.3/lazyClient.go:129 +0xf2
sync.(*Once).doSlow(0x170aca7?, 0x2d?)
        sync/once.go:74 +0xc2
sync.(*Once).Do(...)
        sync/once.go:65
github.com/multiformats/go-multistream.(*lazyClientConn).Write(0xc03d128540?, {0xc04de75000?, 0x2d?, 0x1000?})
        github.com/multiformats/go-multistream@v0.3.3/lazyClient.go:127 +0x93
github.com/libp2p/go-libp2p/p2p/host/basic.(*streamWrapper).Write(0xc009e5e300?, {0xc04de75000?, 0x0?, 0x0?})
        github.com/libp2p/go-libp2p@v0.24.1/p2p/host/basic/basic_host.go:1023 +0x27
bufio.(*Writer).Flush(0xc00adfaf80)
        bufio/bufio.go:629 +0x62
github.com/libp2p/go-libp2p-kad-dht/internal/net.(*bufferedDelimitedWriter).Flush(...)
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/internal/net/message_manager.go:381
github.com/libp2p/go-libp2p-kad-dht/internal/net.WriteMsg({0x2ce9baf8?, 0xc010ff6700}, 0xc0493729c0?)
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/internal/net/message_manager.go:373 +0x145
github.com/libp2p/go-libp2p-kad-dht/internal/net.(*peerMessageSender).writeMsg(...)
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/internal/net/message_manager.go:321
github.com/libp2p/go-libp2p-kad-dht/internal/net.(*peerMessageSender).SendRequest(0xc004fda2d0, {0x2b81c00, 0xc0493729c0}, 0xc019ee49c0?)
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/internal/net/message_manager.go:281 +0x16d
github.com/libp2p/go-libp2p-kad-dht/internal/net.(*messageSenderImpl).SendRequest(0xc002a75980, {0x2b81b58, 0xc017c632c0}, {0xc019ee49c0, 0x26}, 0x23a2740?)
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/internal/net/message_manager.go:88 +0x374
github.com/libp2p/go-libp2p-kad-dht/pb.(*ProtocolMessenger).GetClosestPeers(0xc002b8db00, {0x2b81b58, 0xc017c632c0}, {0xc019ee49c0, 0x26}, {0xc004d6b860?, 0xc0032225a0?})
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/pb/protocol_messenger.go:108 +0xd4
github.com/libp2p/go-libp2p-kad-dht.(*IpfsDHT).FindPeer.func1({0x2b81b58, 0xc017c632c0}, {0xc019ee49c0, 0x26})
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/routing.go:604 +0xfb
github.com/libp2p/go-libp2p-kad-dht.(*query).queryPeer(0xc00828bd40, {0x2b81b58, 0xc017c632c0}, 0xc04484b3c0?, {0xc019ee49c0, 0x26})
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/query.go:408 +0x26e
created by github.com/libp2p/go-libp2p-kad-dht.(*query).spawnQuery
        github.com/libp2p/go-libp2p-kad-dht@v0.20.0/query.go:325 +0x44a

----

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x1c1faa4]

goroutine 1131866 [running]:
github.com/libp2p/go-libp2p/p2p/transport/webtransport.(*stream).Read(0xc0004aed40?, {0xc004ae1869?, 0x4341878?, 0x23a2740?})
        github.com/libp2p/go-libp2p@v0.24.1/p2p/transport/webtransport/stream.go:38 +0x24
github.com/libp2p/go-libp2p/p2p/net/swarm.(*Stream).Read(0xc014a98100, {0xc004ae1869?, 0x10?, 0x4341878?})
        github.com/libp2p/go-libp2p@v0.24.1/p2p/net/swarm/swarm_stream.go:55 +0x36
github.com/multiformats/go-multistream.(*byteReader).ReadByte(0xc0174bac30)
        github.com/multiformats/go-multistream@v0.3.3/multistream.go:328 +0x4e
github.com/multiformats/go-varint.ReadUvarint({0x2b6e4e0, 0xc0174bac30})
        github.com/multiformats/go-varint@v0.0.7/varint.go:80 +0x5a
github.com/multiformats/go-multistream.lpReadBuf({0x2cdb4cc8?, 0xc014a98100})
        github.com/multiformats/go-multistream@v0.3.3/multistream.go:292 +0x94
github.com/multiformats/go-multistream.ReadNextTokenBytes({0x2cdb4cc8?, 0xc014a98100?})
        github.com/multiformats/go-multistream@v0.3.3/multistream.go:275 +0x27
github.com/multiformats/go-multistream.ReadNextToken(...)
        github.com/multiformats/go-multistream@v0.3.3/multistream.go:264
github.com/multiformats/go-multistream.(*lazyClientConn).doReadHandshake(0xc00630e690)
        github.com/multiformats/go-multistream@v0.3.3/lazyClient.go:74 +0xaf
sync.(*Once).doSlow(0x1042ec5?, 0xc0004aef50?)
        sync/once.go:74 +0xc2
sync.(*Once).Do(0x2b856c0?, 0xc011ee9f40?)
        sync/once.go:65 +0x1f
created by github.com/multiformats/go-multistream.(*lazyClientConn).Write.func1
        github.com/multiformats/go-multistream@v0.3.3/lazyClient.go:128 +0xd9

Please advise.

@ylempereur ylempereur added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Dec 20, 2022
@Jorropo
Copy link
Contributor

Jorropo commented Dec 20, 2022

Related to libp2p/go-libp2p#1958

@lidel lidel changed the title 0.18.0-rc1: Random crashes 0.18.0-rc1: panic in webtransport.(*stream).Write/Read Dec 20, 2022
@lidel
Copy link
Member

lidel commented Dec 20, 2022

Unsure if #9516 is related, or a different issue.
Something to look into in January.

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) need/triage Needs initial labeling and prioritization
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants