Jump to page: 1 2
Thread overview
[Issue 17811] No stack for Win32 exceptions
Sep 06, 2017
bitwise
Sep 06, 2017
bitwise
Sep 06, 2017
Rainer Schuetze
Sep 06, 2017
bitwise
Sep 06, 2017
bitwise
Sep 07, 2017
Rainer Schuetze
Sep 07, 2017
bitwise
Sep 08, 2017
bitwise
Sep 16, 2017
Rainer Schuetze
Sep 17, 2017
bitwise
Oct 22, 2017
Rainer Schuetze
Dec 17, 2022
Iain Buclaw
September 06, 2017
https://issues.dlang.org/show_bug.cgi?id=17811

bitwise <nicolas.jinchereau@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |blocker

--
September 06, 2017
https://issues.dlang.org/show_bug.cgi?id=17811

--- Comment #1 from bitwise <nicolas.jinchereau@gmail.com> ---
I actually just figured out where the problem was, and it wasn't even C++ code. I was the assert that fires when you try to access an uninitialized payload of RefCounted:

@property nothrow @safe pure @nogc
ref inout(T) refCountedPayload() inout return
{
--> assert(_refCounted.isInitialized, "Attempted to access uninitialized..");
    return _refCounted._store._payload;
}

--
September 06, 2017
https://issues.dlang.org/show_bug.cgi?id=17811

Rainer Schuetze <r.sagitario@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario@gmx.de

--- Comment #2 from Rainer Schuetze <r.sagitario@gmx.de> ---
The main problem with the missing stack trace for exceptions is that druntime is not built with standard stack frames.

Sometimes it helps if you load symbols from the Microsoft symbol server for Kernelbase.dll and anything else shown on the stack.

Another option might be to use the linker setting "Build and use local version of phobos with same compiler options" to link a debug version of druntime.

--
September 06, 2017
https://issues.dlang.org/show_bug.cgi?id=17811

--- Comment #3 from bitwise <nicolas.jinchereau@gmail.com> ---
@Rainer Schuetze

Thanks - I hadn't tried that option yet.

I just tried it though, and I'm getting build errors due to the incorrect compiler being used.

Currently, certain parts of Visual D ignore the selected compiler for the project. For example, I have chosen Compiler=LDC in my project settings. The project builds fine using LDC, but when I "Go to definition" on any symbol in my project, it opens the source file from DMD's import path. This can be verified by F12'ing on a symbol, right clicking the newly opened tab, and selecting "Open Containing Folder". The build log from trying to build phobos also shows that DMD is being used to try and compile phobos, which gives tonnes of these errors:

Debug\privatedruntime.lib: Error: corrupt OMF object module
Debug\phobos-errno.c.obj 161
Debug\privatedruntime.lib: Error: corrupt OMF object module
Debug\phobos-adler32.c.obj 161
....

--
September 06, 2017
https://issues.dlang.org/show_bug.cgi?id=17811

--- Comment #4 from bitwise <nicolas.jinchereau@gmail.com> ---
Using LDC, I've added this flag, and the stack frame situation seems greatly improved, if not fixed.

Shouldn't this be default for debug mode?

-link-debuglib

--
September 07, 2017
https://issues.dlang.org/show_bug.cgi?id=17811

--- Comment #5 from Rainer Schuetze <r.sagitario@gmx.de> ---
Yeah, some parts are tuned for dmd only. With "Goto Definition" I suspect that you have "Built Phobos browse info" some time in the past? That would be used as a fallback if semantic analysis didn't find a result.

"Build and use local version of phobos with same compiler options" hasn't been tested on LDC, because, as you noted, the main use case is using a debug version of the runtime, and that is provided by LDC.

The debug version is a lot slower, though. I don't think it should be the default, but there should probably be an option to enable it (replacing "build and use...").

--
September 07, 2017
https://issues.dlang.org/show_bug.cgi?id=17811

--- Comment #6 from bitwise <nicolas.jinchereau@gmail.com> ---
@Rainer Schuetze

> "Built Phobos browse info" some time in the past?

Yes, same result though - DMD imports for LDC. I suppose I should file a separate bug for this though. I thought

As was as what lib to use for debug mode, I have to disagree. Slowness is the cost of debug mode. Debug mode is not Debug mode if you can't debug. If an option was added for -link-debuglib, people could turn it off if they wanted they needed to. The issue I was having was not once-in-a-while. Every other bug I was hitting would just crash, giving me no information about what went wrong, or where. I don't believe there's a reasonable argument for this happening in Debug mode. No one will expect to have to flip a switch before debug mode actually works as advertised.

Anyways, thanks for the help. Debugging seems to work fine now that I've enable the correct std lib.

--
September 08, 2017
https://issues.dlang.org/show_bug.cgi?id=17811

bitwise <nicolas.jinchereau@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |major

--
September 16, 2017
https://issues.dlang.org/show_bug.cgi?id=17811

--- Comment #7 from Rainer Schuetze <r.sagitario@gmx.de> ---
https://github.com/dlang/visuald/releases/tag/v0.46.0-beta1 should fix the import issue with LDC and adds an option to use the debug library.

I'm unsure whether debug library by default is good, as there are some parts of the library that can get very slow with the debug version, e.g. the GC. In addition, you might "step into" a lot of operations that are assumed builtin, e.g. array operations or new.

--
September 17, 2017
https://issues.dlang.org/show_bug.cgi?id=17811

--- Comment #8 from bitwise <nicolas.jinchereau@gmail.com> ---
Thanks for adding this, it's a big help.

I don't mind flipping a switch, but am more concerned for anyone else being left empty handed when their code fails and not being able to find a solution.

Using LDC's debug library greatly improves the situation, but doesn't entirely fix it for me. I still end up with no stack-frame/code-location sometimes. I think it may be due to the compilation options of the third party libraries I'm using. I've compiled them all from source, and have only been able to do so with the multi-threaded runtime (/MT) - otherwise, they won't link with my D program. I haven't yet been able to look at this issue exhaustively, but I have a feeling it's unfixable without building my own LDC libs.

--
« First   ‹ Prev
1 2