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

EnC: stack corruption when editing recursive function #9653

Open
tmat opened this issue Feb 4, 2018 · 1 comment
Open

EnC: stack corruption when editing recursive function #9653

tmat opened this issue Feb 4, 2018 · 1 comment

Comments

@tmat
Copy link
Member

tmat commented Feb 4, 2018

Version:

CoreCLR 2.1.0 and Desktop CLR 4.7.1

Steps to Reproduce:

using System;

class Program
{
    static void Main()
    {
        FuncTest(30);
    }

    static int FuncTest(int i)
    {
        Console.WriteLine(i);

        int j = 100; // conditional BP: "i == 20"
        j++;
        // j++;
        if (i == 1)
        {
            return 10;
        }
        else
        {
            return FuncTest(i - 1);
        }
    }
}     
  1. In the above code place conditional BP as indicated.
  2. F5
  3. When the BP is hit, uncomment // j++;
  4. Step (F11) until Console.WriteLine(i) is reached and then step over (F10).
  5. Observe the output.

Expected Behavior:

30
29
28
27
26
25
24
23
22
21
20
19

Actual Behavior:

30
29
28
27
26
25
24
23
22
21
20
32765

Notes

The IP is remapped once from IL offset 8 to 8.

IL delta:
image

Copied from dotnet/roslyn#24622

@lt72 lt72 assigned davmason and unassigned lt72 Feb 15, 2018
@lt72
Copy link
Contributor

lt72 commented Feb 15, 2018

@davmason: Assigning to David for execution on 2.1 first.

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the 5.0 milestone Jan 31, 2020
@tommcdon tommcdon added the p1 label Mar 7, 2020
@tommcdon tommcdon modified the milestones: 5.0.0, 6.0.0 Jul 27, 2020
@tommcdon tommcdon removed the p1 label Oct 13, 2020
@tommcdon tommcdon modified the milestones: 6.0.0, Future Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants