I finally got a stack trace on my InvalidMemoryOperationError
Vladimir Panteleev via Digitalmars-d
digitalmars-d at puremagic.com
Thu Jun 4 16:59:10 PDT 2015
On Thursday, 4 June 2015 at 23:56:28 UTC, Etienne wrote:
> Since the application will probably have to stop, might as well
> use the GC:
>
> in GC:
>
> if (gcx.running) {
> gcx.running = false;
> onInvalidMemoryOperationError();
> }
>
> in core.exception:
>
> throw new InvalidMemoryOperationError();
>
> And there you go, a beautiful stack trace. I now have a
> pinpoint of the error within 100k++ LOC. Thank you.
>
> Why D? Why fail with a one line message and no debug tools?
> Why??
I don't understand what you're grieving about, but:
1. We can't show a stack trace in an InvalidMemoryOperationError
situation because we need to allocate memory for the stack trace,
which we can't do in an InvalidMemoryOperationError situation.
2. Hope this helps:
http://wiki.dlang.org/InvalidMemoryOperationError
More information about the Digitalmars-d
mailing list