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

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17132

Iain Buclaw  changed:

   What|Removed |Added

   Priority|P1  |P3

--


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

2017-01-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17132

j...@red.email.ne.jp changed:

   What|Removed |Added

   Keywords||dll

--


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

2017-01-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17132

--- Comment #1 from j...@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.

--