[Issue 17132] Using DLL makes an empty stacktrace on error

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jan 30 19:36:35 PST 2017


https://issues.dlang.org/show_bug.cgi?id=17132

--- Comment #1 from jiki at red.email.ne.jp ---
The reason is that each dlls and app initialize the own druntime (and
stacktrace modules)
though the Windows' DBGHELP does not allow to initialize *more than once*.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms681351(v=vs.85).aspx

So the latter initialization for app fails, leaving the initialized flag false.


QUICK WORKAROUND:
at core.sys.windows.stacktrace: shared static this()

    dbghelp.SymCleanup(hProcess); // @@@ ADD
    if (!dbghelp.SymInitialize(hProcess, generateSearchPath().ptr, TRUE))
        return;

NOTE:
For now, we cannot raise exceptions over DLL boundary.
So I've no idea how to solve this correctly.

--


More information about the Digitalmars-d-bugs mailing list