www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5009] New: TraceHandler not being called on Access Violation

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5009

           Summary: TraceHandler not being called on Access Violation
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: code benjamin-thaut.de


--- Comment #0 from Benjamin Thaut <code benjamin-thaut.de> 2010-10-07 02:54:34
PDT ---
The TraceHandler that is built into the core runtime is not being called on
Access Violation errors. Try this piece of sourcecode:

import std.stdio;
import core.runtime;

Throwable.TraceInfo TraceHandler1(void* ptr){
    writefln("TraceHandler1");
    return null;
}

Throwable.TraceInfo TraceHandler2(void* ptr){
    writefln("TraceHandler2");
    return null;
}

void main(string[] argv){
    Runtime.traceHandler(&TraceHandler1);
    try {
        int[] array = new int[20];
        array[20] = 0;
    }
    catch(Error e){
    }

    Runtime.traceHandler(&TraceHandler2);

    int* ptr = null;
    *ptr = 0;
}

TraceHandler2 is never being called. I tested this with dmd 2.046, 2.048 and
2.049.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 07 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5009



--- Comment #1 from Benjamin Thaut <code benjamin-thaut.de> 2013-02-09 03:55:31
PST ---
Fixed in https://github.com/D-Programming-Language/druntime/pull/368

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