Bug 17132 – Using DLL makes an empty stacktrace on error

Status
NEW
Severity
normal
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2017-01-31T03:30:24Z
Last change time
2024-12-07T13:37:16Z
Keywords
dll
Assigned to
No Owner
Creator
jiki
Moved to GitHub: dmd#17343 →

Comments

Comment #0 by jiki — 2017-01-31T03:30:24Z
I am working with DLL in Windows. When some error raises, the stacktrace always generates empty. Probably, this is a Windows issue.
Comment #1 by jiki — 2017-01-31T03:36:35Z
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.
Comment #2 by robert.schadek — 2024-12-07T13:37:16Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17343 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB