Half-baked thought: Out-of-process asserts
Neia Neutuladh
neia at ikeran.org
Tue Sep 4 06:02:18 UTC 2018
On Tuesday, 4 September 2018 at 03:39:04 UTC, Nick Sabalausky
(Abscissa) wrote:
> Discussion questions:
> - What would be the feasibility of the various parts of this?
You'd need to interrupt the process. You'd need a parent process
that detects the interrupt. Then you'd need to use the debugger
API to attach to the child process and get the relevant data.
Annoying to write, but it should work, assuming the child process
didn't install a signal handler to handle SIGABRT.
You could simply call SIGABRT and create a core dump, but that
can be costly on a system where your application might use
multiple gigabytes of RAM.
> - What would be the downsides, and how serious would they be?
It's extra complexity. It means you must run in a multiprocessing
environment (which is almost, but not quite, a trivial
requirement). If you're running as a user without debugger
privileges, you're horked; you aren't getting an error message at
all.
The benefit is that you can safely do more elaborate logging when
more of your runtime and base frameworks are in an invalid state.
I think most people are happy to live dangerously or to go with
simpler logging.
More information about the Digitalmars-d
mailing list