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

Step becomes a "go" in .NET 9 #109785

Closed
gregg-miskelly opened this issue Nov 13, 2024 · 10 comments · Fixed by #110484
Closed

Step becomes a "go" in .NET 9 #109785

gregg-miskelly opened this issue Nov 13, 2024 · 10 comments · Fixed by #110484
Assignees
Milestone

Comments

@gregg-miskelly
Copy link
Contributor

Description

.NET 9 contains a regression where ICorDebugStepper's are not always firing. The issue is non-deterministic, and causes intermittent failures in our debugging tests, and we have had a few customers reports of the problem.

Reproduction Steps

A Microsoft employee can reproduce this problem by:

  1. Enlisting in the 'Concord' repo
  2. Following instructs in '/glass.md' for setting up a local test environment
  3. Open Test Explorer
  4. Enter “CSAsyncStepOverinTryBlock-NetCore-Latest-x64” in the filter box
  5. Navigate to the test
  6. Right click and invoke “Run Until Failure”

Expected behavior

Stepper should complete

Actual behavior

Stepper sometimes fails to detect when it is complete and this the debugger behaves as if there was no stepper

Regression?

This regressed between .NET 8 and .NET 9

Known Workarounds

None

Configuration

So far all of the reports are from Windows, but I don't know if this is actually a causal connection.
We have at least mostly seen this on x64, but again, I am not sure if that is actually a causal connection or just because that is the most frequent configuration

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 13, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Nov 13, 2024
@jkotas jkotas 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 13, 2024
Copy link
Contributor

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

@tommcdon tommcdon added this to the 10.0.0 milestone Nov 13, 2024
@tommcdon tommcdon removed the untriaged New issue has not been triaged by the area owner label Nov 13, 2024
@tommcdon tommcdon self-assigned this Nov 13, 2024
@tommcdon tommcdon assigned thaystg and unassigned tommcdon Nov 19, 2024
@f2bo
Copy link

f2bo commented Dec 2, 2024

I'm seeing this all the time. I hadn't seen this issue before. I reported the problem here a few days ago: https://developercommunity.visualstudio.com/t/Single-stepping-is-broken-when-targettin/10802855.

I can reproduce it with the following simple steps:

  • Create a new Console App project that targets .NET 8.

  • Replace the contents of Program.cs with the following code:

    foreach (Range range in new Range[5])
    {
       Console.WriteLine($"{range.Start}, {range.End}");
    }
  • Execute in the debugger by using Step Over (F10) or Step Into (F11) to verify that the debugger is able to single-step through each line in the program correctly.

  • Change the project file to target .NET 9.

  • Execute again with Step Over (F10) or Step Into (F11) . Notice that single-stepping no longer advances to the next line as expected, but that execution suddenly continues without breaking, as if F5 had been pressed.

NOTE: This behavior is erratic, so you may need to repeat a few times if it seems to work correctly.

@geoffrey-gaspari
Copy link

Same problem here.

@thaystg
Copy link
Member

thaystg commented Dec 2, 2024

Hi @f2bo!
Every time that you run this app this "resume" happens?
It happens any time in the foreach loop or it's always in the last loop for example?
Can you share a video with the bug happening?

@f2bo
Copy link

f2bo commented Dec 2, 2024

Hi @thaystg,

Every time that you run this app this "resume" happens?

Almost every time (see video below).

It happens any time in the foreach loop or it's always in the last loop for example?

In this example, it usually happens on the first iteration of the foreach loop. I should mention that I've had this problem in other code and it's not always associated with a loop. In fact, in one of my tests, I saw it happen on a Console.WriteLine that I temporarily added before the loop using the code above.

Can you share a video with the bug happening?

Sure. Here it is.

The video shows the program being executed with F10, 3 times in succession. The first time, it run through the 5 iterations without failing, though I have to say that this is much less frequent. The remaining 2 times, instead of single-stepping, it resumes execution on the first iteration.

@f2bo
Copy link

f2bo commented Dec 6, 2024

Interesting fact. After disabling CET in the project file, I have been unable to reproduce the problem so far, at least in this simple example.

<CETCompat>false</CETCompat>

@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
@IamIC
Copy link

IamIC commented Dec 19, 2024

Same problem here.

@Ollhax
Copy link

Ollhax commented Dec 19, 2024

I'm getting this all the time, both on my main machine and laptop.

@tommcdon
Copy link
Member

Fixed via #110533

@tommcdon tommcdon removed the in-pr There is an active PR which will close this issue when it is merged label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants