Re: Better diagnostics for null classes dereferencing

2018-07-11 Thread Per Nordlöw via Digitalmars-d-learn
On Wednesday, 11 July 2018 at 04:17:49 UTC, Seb wrote: https://github.com/dlang/druntime/pull/2249 Thanks!

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Seb via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 20:57:02 UTC, Steven Schveighoffer wrote: On 7/10/18 4:02 PM, Per Nordlöw wrote: On Tuesday, 10 July 2018 at 19:27:07 UTC, Steven Schveighoffer wrote: On 7/10/18 3:01 PM, Per Nordlöw wrote: [...] Yes, call this function on startup: import etc.linux : 

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Neia Neutuladh via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 22:53:25 UTC, kdevel wrote: extern (C) __gshared bool rt_trapExceptions; static this () { rt_trapExceptions = false; } This will catch exceptions raised in main and in static constructors that run after this one. However, if you put that code in

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread kdevel via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 22:31:54 UTC, Adam D. Ruppe wrote: Turn off rtTrapExceptions though the command line switch PR is STILL NOT MERGED https://github.com/dlang/druntime/pull/2035 extern (C) __gshared bool rt_trapExceptions; static this () { rt_trapExceptions =

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 21:18:01 UTC, kdevel wrote: but how do I force the runtime to generate a coredump for real post-mortem analysis? Turn off rtTrapExceptions though the command line switch PR is STILL NOT MERGED https://github.com/dlang/druntime/pull/2035 come on, people.

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/10/18 5:18 PM, kdevel wrote: On Tuesday, 10 July 2018 at 21:09:23 UTC, Steven Schveighoffer wrote: [...] As far as the OS is concerned, a[2 .. $] is within the process memory limit. Of course, that's an out of bounds access, so the compiler or the bounds check *should* complain. It

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 19:27:07 UTC, Steven Schveighoffer wrote: import etc.linux : registerMemoryErrorHandler; Needs to be: import etc.linux.memoryerror : registerMemoryErrorHandler;

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread kdevel via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 21:09:23 UTC, Steven Schveighoffer wrote: [...] As far as the OS is concerned, a[2 .. $] is within the process memory limit. Of course, that's an out of bounds access, so the compiler or the bounds check *should* complain. It complains at runtime > ./dumpme2

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/10/18 5:01 PM, kdevel wrote: On Tuesday, 10 July 2018 at 20:10:54 UTC, Adam D. Ruppe wrote: On Tuesday, 10 July 2018 at 19:01:22 UTC, Per Nordlöw wrote: [...] Run the program in a debugger, or run `ulimit -c unlimited` to enable core dumps [...] Works for null ptr deref but how do I

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread kdevel via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 20:10:54 UTC, Adam D. Ruppe wrote: On Tuesday, 10 July 2018 at 19:01:22 UTC, Per Nordlöw wrote: [...] Run the program in a debugger, or run `ulimit -c unlimited` to enable core dumps [...] Works for null ptr deref but how do I enforce core dumps in this code:

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/10/18 4:02 PM, Per Nordlöw wrote: On Tuesday, 10 July 2018 at 19:27:07 UTC, Steven Schveighoffer wrote: On 7/10/18 3:01 PM, Per Nordlöw wrote: Is it possible to change run-time behaviour of null-class dereferencing, on Linux, so that it gives some other diagnostics than: Program exited

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Seb via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 19:01:22 UTC, Per Nordlöw wrote: Is it possible to change run-time behaviour of null-class dereferencing, on Linux, so that it gives some other diagnostics than: Program exited with code -11 Does DMD and LDC provide different alternatives here? On a Systemd

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 19:01:22 UTC, Per Nordlöw wrote: Is it possible to change run-time behaviour of null-class dereferencing, on Linux, so that it gives some other diagnostics than: Run the program in a debugger, or run `ulimit -c unlimited` to enable core dumps so you can run a

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 19:27:07 UTC, Steven Schveighoffer wrote: On 7/10/18 3:01 PM, Per Nordlöw wrote: Is it possible to change run-time behaviour of null-class dereferencing, on Linux, so that it gives some other diagnostics than: Program exited with code -11 Does DMD and LDC provide

Re: Better diagnostics for null classes dereferencing

2018-07-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/10/18 3:01 PM, Per Nordlöw wrote: Is it possible to change run-time behaviour of null-class dereferencing, on Linux, so that it gives some other diagnostics than: Program exited with code -11 Does DMD and LDC provide different alternatives here? Yes, call this function on startup:

Better diagnostics for null classes dereferencing

2018-07-10 Thread Per Nordlöw via Digitalmars-d-learn
Is it possible to change run-time behaviour of null-class dereferencing, on Linux, so that it gives some other diagnostics than: Program exited with code -11 Does DMD and LDC provide different alternatives here?