Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@lidel
Copy link
Member

@lidel lidel commented Dec 20, 2025

This PR aims to fix a data race where the same backing array was shared between peerstore and channel consumers.

When peerstore modified addresses (TTL expiry, updates), it raced with consumers reading channel data, causing memory corruption (impossible slice state like len=6, cap=3).

The fix clones Addrs before sending peer.AddrInfo on the channel, ensuring each consumer has its own backing array.

Fixes a data race where the same backing array was shared between
peerstore and channel consumers. When peerstore modified addresses
(TTL expiry, updates), it raced with consumers reading channel data,
causing memory corruption (impossible slice state like len=6, cap=3).

The fix clones `Addrs` before sending `peer.AddrInfo` on the channel,
ensuring each consumer has its own backing array.

Should help with ipfs/kubo#11116
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

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.