If you want a proper core dump upon an assert failure (or generally a uncaught exception), you have to set rt_trapExceptions to 0.
You can't do that however without either compiling your own runtime or attaching a debugger and setting it from there before main() is called.
While you can change the variable (as it is a global extern (C), your change has no effect because all user code is run only after the variable has been read.
This PR changes the behavior so that changes to that variable done from a module c'tor will cause your main() to be called without the exception trap:
https://github.com/D-Programming-Language/druntime/pull/1538
Comment #1 by leandro.lucarella — 2016-04-08T14:46:24Z
What about making it a runtime option a la `--DRT-trap-exceptions`?
Comment #2 by dmdtracker — 2016-04-08T14:50:38Z
I have nothing against it, but right now I try to propose as little change as possible to increase the chances of this getting actually merged.
Implemented via #18220 as --DRT-trapExceptions=0. Exception trapping cannot be enabled if running in a debugger under windows, but not sure if that is a troublesome restriction.
*** This issue has been marked as a duplicate of issue 18220 ***