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

fix(@libp2p/webtransport): maximum call stack size exceeded on abort #1947

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

achingbrain
Copy link
Member

Fixes bug in webtransport where the .abort method on the stream class was calling stream.abort and leading to a call stack overflow.

image

Also splits the code into multiple files to make it a bit easier to see what is doing what.

Fixes bug in webtransport where the `.abort` method on the stream class
was calling `stream.abort` and leading to a call stack overflow.
writer.abort()
writerClosed = true
}
stream.abort(err)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the call stack overflow was happening.

@achingbrain achingbrain changed the title fix: call stack overflow in webtransport transport fix(@libp2p/webtransport): maximum call stack size exceeded on abort Aug 10, 2023
@achingbrain achingbrain merged commit 5e85154 into master Aug 10, 2023
18 checks passed
@achingbrain achingbrain deleted the fix/call-stack-overflow-in-webtransport branch August 10, 2023 11:05
@maschad
Copy link
Member

maschad commented Aug 10, 2023

@achingbrain I am not familiar with this commit convention, where is it derived from?

@achingbrain
Copy link
Member Author

Do you mean the (@libp2p/webtransport) bit? It's a scope. Just an experiment - I figure it might make our release notes a bit more readable as it'll indicate which module is affected by which PR.

@SgtPooki
Copy link
Member

It's hard to fit the scope into the git commit and still be under 50 characters, but with modern technology, I prefer scoped commits rather than short git commit messages.

Comment on lines +7 to +12
export function isSubset (set: Uint8Array[], maybeSubset: Uint8Array[]): boolean {
const intersection = maybeSubset.filter(byteArray => {
return Boolean(set.find((otherByteArray: Uint8Array) => uint8ArrayEquals(byteArray, otherByteArray)))
})
return (intersection.length === maybeSubset.length)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this to be Uint8array or can it be generic?

This was referenced Jan 18, 2024
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.

3 participants