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

bitswap(session): fix slice prealloc #702

Merged
merged 3 commits into from
Oct 25, 2024
Merged

bitswap(session): fix slice prealloc #702

merged 3 commits into from
Oct 25, 2024

Conversation

Wondertan
Copy link
Member

Fixes the following:

panic: runtime error: makeslice: cap out of range

goroutine 632 [running]:
github.com/ipfs/boxo/bitswap/client/internal/session.(*sessionWants).GetNextWants(0xc004e06060)
	/go/pkg/mod/github.com/!wondertan/[email protected]/bitswap/client/internal/session/sessionwants.go:64 +0x98
github.com/ipfs/boxo/bitswap/client/internal/session.(*Session).wantBlocks(0xc004e06000, {0x3a8ff70, 0xc000531040}, {0xc03d3b6908?, 0x80?, 0x80?})
	/go/pkg/mod/github.com/!wondertan/[email protected]/bitswap/client/internal/session/session.go:469 +0x9a
github.com/ipfs/boxo/bitswap/client/internal/session.(*Session).run(0xc004e06000, {0x3a8ff70, 0xc000531040})
	/go/pkg/mod/github.com/!wondertan/[email protected]/bitswap/client/internal/session/session.go:317 +0x34b
created by github.com/ipfs/boxo/bitswap/client/internal/session.New in goroutine 283
	/go/pkg/mod/github.com/!wondertan/[email protected]/bitswap/client/internal/session/session.go:176 +0x659

Introduced in #692

@Wondertan Wondertan requested a review from a team as a code owner October 24, 2024 03:09
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 60.31%. Comparing base (2f2c9dd) to head (6932e99).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
bitswap/client/internal/session/sessionwants.go 0.00% 0 Missing and 1 partial ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #702      +/-   ##
==========================================
- Coverage   60.36%   60.31%   -0.05%     
==========================================
  Files         243      243              
  Lines       31025    31025              
==========================================
- Hits        18727    18714      -13     
- Misses      10630    10639       +9     
- Partials     1668     1672       +4     
Files with missing lines Coverage Δ
bitswap/client/internal/session/sessionwants.go 88.99% <0.00%> (ø)

... and 13 files with indirect coverage changes

@gammazero gammazero added the P0 Critical: Tackled by core team ASAP label Oct 25, 2024
@gammazero
Copy link
Contributor

Thank you for this fix!

@gammazero gammazero merged commit d2b99eb into ipfs:main Oct 25, 2024
13 checks passed
@gammazero gammazero mentioned this pull request Oct 25, 2024
gammazero pushed a commit that referenced this pull request Oct 25, 2024
bitswap(session): fix slice prealloc

(cherry picked from commit d2b99eb)
@gammazero gammazero mentioned this pull request Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 Critical: Tackled by core team ASAP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants