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

foreach will jump to other code in dotnet9 #109812

Closed
Coloryr opened this issue Nov 14, 2024 · 6 comments · Fixed by #110484
Closed

foreach will jump to other code in dotnet9 #109812

Coloryr opened this issue Nov 14, 2024 · 6 comments · Fixed by #110484
Assignees
Labels
area-Diagnostics-coreclr in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@Coloryr
Copy link

Coloryr commented Nov 14, 2024

Description

When I upgrade the project to Dotnet9 and foreach the list, I will jump to other code by myself after the list is not fully foreach.
dotnet8
https://github.com/user-attachments/assets/5bd3c4cb-2c7f-4b53-ae2f-adc318f6ee80

dotnet9
https://github.com/user-attachments/assets/9ddfc90d-0000-4bc7-a177-d962416d2d83

Reproduction Steps

  1. make a List
  2. add some thing
  3. foreach it

Expected behavior

foreach every item

Actual behavior

foreach some item and exit all code

Regression?

dotnet9

Known Workarounds

No response

Configuration

windows x64

Other information

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 14, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Nov 14, 2024
@Coloryr Coloryr changed the title foreach will jump to other code in dotnet9 foreach will jump to other code in dotnet9 Nov 14, 2024
@huoyaoyuan huoyaoyuan added area-Diagnostics-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Nov 14, 2024
Coloryr added a commit to Coloryr/ColorMC that referenced this issue Nov 14, 2024
@am11
Copy link
Member

am11 commented Nov 14, 2024

I have seen this (and stuff like debugger is stepping through both if and else in single iteration) happening in unclean state. I'd close all VS instances, kill -name dotnet in powershell and delete bin and obj directories before retrying.

@hoyosjs
Copy link
Member

hoyosjs commented Nov 14, 2024

cc: @dotnet/dotnet-diag

@mikelle-rogers - you might be the most familiar with this codepath right now in case you have cycles.

@Coloryr - are there any repros for this?

@tommcdon might be a manifestation of #109785. It's async stepping becomes a go and ends up in the next bp set by the user.

@Coloryr
Copy link
Author

Coloryr commented Nov 15, 2024

Yes, it will skip most of the code.

@Coloryr
Copy link
Author

Coloryr commented Nov 15, 2024

I have seen this (and stuff like debugger is stepping through both if and else in single iteration) happening in unclean state. I'd close all VS instances, kill -name dotnet in powershell and delete bin and obj directories before retrying.

Clean everything did't work.

@tommcdon tommcdon added this to the 10.0.0 milestone Nov 15, 2024
@tommcdon tommcdon removed the untriaged New issue has not been triaged by the area owner label Nov 15, 2024
@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Dec 9, 2024
@tommcdon tommcdon modified the milestones: 10.0.0, 9.0.x Dec 9, 2024
@tommcdon
Copy link
Member

tommcdon commented Dec 9, 2024

Reactivated for backport to 9.0

@tommcdon tommcdon reopened this Dec 9, 2024
Coloryr added a commit to Coloryr/ColorMC that referenced this issue Dec 15, 2024
@tommcdon
Copy link
Member

Fixed via #110533

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Diagnostics-coreclr in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants