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 off-by-1 in CallbackStack#pack #3936

Merged
merged 1 commit into from Jan 8, 2024

Conversation

armanbilge
Copy link
Member

Fixes #3935.

An off-by-1 error was causing pack() to under-report how many CallbackStack nodes were removed. Thus the clearCounter in IODeferred was continually growing, causing packing to occur less and less frequently such that the stack would grow unboundedly large.

Copy link
Member

@djspiewak djspiewak left a comment

Choose a reason for hiding this comment

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

Really nice catch. Should we retarget this at 3.5?

@armanbilge
Copy link
Member Author

Oh, arg. The branch is based right, screwed up the PR. one sec :)

@armanbilge armanbilge changed the base branch from series/3.x to series/3.5.x January 8, 2024 20:20
@armanbilge armanbilge closed this Jan 8, 2024
@armanbilge armanbilge reopened this Jan 8, 2024
@mernst-github
Copy link
Contributor

LGTM, I still see the same effect though.

@armanbilge
Copy link
Member Author

@mernst-github are you sure? I tried running your reproducer from #3359 (comment) with the debug println I added in #3935 against this PR and it consistently prints 0. Unless we have some other CallbackStack leak unrelated to IODeferred ...

@armanbilge
Copy link
Member Author

I'm going to merge, since this definitely fixes a bug, but as noted there may still be another issue at large.

@armanbilge armanbilge merged commit 1de67c5 into typelevel:series/3.5.x Jan 8, 2024
41 of 62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IODeferred's CallbackStack becomes unboundedly large
3 participants