Access Violation Tracking

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Nov 7 22:50:20 PST 2014


On Fri, 07 Nov 2014 13:52:33 +0000
"Nordlöw" via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com>
wrote:

> On Friday, 7 November 2014 at 03:22:59 UTC, ketmar via 
> Digitalmars-d-learn wrote:
> > crash+coredump is alot more useful than intercepting error 
> > and...
> > trying to recover from undefined state? or just exit to OS, 
> > losing
> > valuable information about a crash?
> 
> Together with the DUB package backtrace this gives really nice 
...undefined behavior. this code is not only unsafe (even in perverted
D "safety"), it's plainly wrong. you are not allowed to call most of
the libc functions from signal handler. actually, the things you can do
safely in signal handler is setting some variable or calling _exit(2).
ok, there are some more syscalls which are safe, but obviously not
FILE* i/o from libc.

so it doesn't matter wether i want coredumps or you want stack traces,
the only correct solution is coredumps. printing stack trace from
signal handler is UB, and it works only by accident. there is no good
in using code that relies on UB.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20141108/1eb9899d/attachment.sig>


More information about the Digitalmars-d-learn mailing list