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 subtle/weird UB in the multi threaded executor #15309

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

SkiFire13
Copy link
Contributor

Objective

Solution

  • Don't create a &mut World reference outside async blocks and then capture it, but instead directly create it inside the async blocks. This avoids it being captured, which has some weird requirement on its validity.

Testing

  • Added a regression test

@SkiFire13 SkiFire13 marked this pull request as ready for review September 19, 2024 16:42
@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events P-Unsound A bug that results in undefined compiler behavior S-Needs-Review Needs reviewer attention (from anyone!) to move forward P-High This is particularly urgent, and deserves immediate attention C-Bug An unexpected or incorrect behavior labels Sep 19, 2024
@alice-i-cecile alice-i-cecile added this to the 0.14.3 milestone Sep 19, 2024
@alice-i-cecile
Copy link
Member

Great find, thank you! This unblocks #15276.

@MiniaczQ
Copy link
Contributor

MiniaczQ commented Sep 19, 2024

Does this resolve #15289 or are those different UBs,
since it was also proposed as solution to #15276

@Victoronz
Copy link
Contributor

Victoronz commented Sep 19, 2024

#15289 is not resolved, however your #15276 blockage is!

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 19, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 19, 2024
Merged via the queue into bevyengine:main with commit 106db47 Sep 19, 2024
27 checks passed
@SkiFire13 SkiFire13 deleted the fix-ub-scheduler branch September 19, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior P-High This is particularly urgent, and deserves immediate attention P-Unsound A bug that results in undefined compiler behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants