[Issue 12200] New: Strange crash while debugging in Win64

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 18 21:14:54 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12200

           Summary: Strange crash while debugging in Win64
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: turkeyman at gmail.com


--- Comment #0 from Manu <turkeyman at gmail.com> 2014-02-18 21:14:51 PST ---
This code:

void main()
{
  Test();
}

static void Test()
{
    int[16] step;
    int depth;
    step[depth] = 8;

    ptrdiff_t[9] holds = -1;

    char s = '[';

    switch(s)
    {
        case '[':
            // set breakpoint on ++depth
            ++depth;
            step[depth] = 24;
            break;
        default:
            break;
    }
}

Steps:
 Compile with DMD-Win64 2.064.
 Launch in debugger (I'm using VS2010 + VisualD).
 Notice that program completes successfully.
 Place a breakpoint on the line '++depth;'
 Launch in debugger again.
 Program will pause at the ++depth line.
 Press F10 (step).
 Crashes with an access violation.

If I remove the line: ptrdiff_t[9] holds = -1;
The crash stops happening, even when the breakpoint is present.

This is quite strange. Somehow the presence of a breakpoint causes the
executing code to crash, and only in the presence of another variable on the
stack, which isn't even referenced.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list