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

Crash in sizeBelowThreshold #675

Open
wenyue opened this issue Sep 25, 2024 · 3 comments
Open

Crash in sizeBelowThreshold #675

wenyue opened this issue Sep 25, 2024 · 3 comments
Assignees
Labels
need/analysis Needs further analysis before proceeding need/triage Needs initial labeling and prioritization

Comments

@wenyue
Copy link

wenyue commented Sep 25, 2024

I found a bug that can cause a crash. In the directory sizeBelowThreshold function, we call the EnumLinksAsync function, then call parallelShardWalk, and the sizeBelowThreshold function may be end if we have already fetched enough shards to assert we are above the threshold. At this time, parallelShardWalk may still running the nextShard.walkChildren.
Next, because sizeBelowThreshold has been completed, we can continue to modify direcotry. At this time, walkChildren will cause a crash because the hamt ds.childer has been modified.

An example is:
Call direcotry.unlink(), and then immediately call direcotry.addChild(). If run many times, it may trigger a crash.

@wenyue wenyue added the need/triage Needs initial labeling and prioritization label Sep 25, 2024
Copy link

welcome bot commented Sep 25, 2024

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@wenyue
Copy link
Author

wenyue commented Sep 25, 2024

This is my fix, please take a look.
wenyue@af6f2b0

@lidel
Copy link
Member

lidel commented Oct 8, 2024

@wenyue are you willing to open a PR with the fix and a test?

Triage note: we will look into this in spare time.

@lidel lidel added need/author-input Needs input from the original author P2 Medium: Good to have, but can wait until someone steps up help wanted Seeking public contribution on this issue and removed need/author-input Needs input from the original author labels Oct 8, 2024
@lidel lidel added need/analysis Needs further analysis before proceeding and removed P2 Medium: Good to have, but can wait until someone steps up help wanted Seeking public contribution on this issue labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/analysis Needs further analysis before proceeding need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

3 participants