On Sun, 26 Apr 2015 13:49:59 +0200, Sönke Ludwig wrote:

Am 22.04.2015 um 21:32 schrieb Márcio Martins:

On Linux, when I get any sort of uncaught Error/Throwable, the process just reports:

Task terminated with unhandled exception:

without any other information, and then just sits there taking up 100% CPU.

Is this known? Can I do something about it? I need to have it die normally.

Cheers,
-M

For segmentation faults, the process directly exists with -11 for me,
but for Throwables (non-Exceptions) I also get a segfault in
__d_throwc. It seems like throwing across C boundaries (libevent's
event_base_loop) may be the issue here. I couldn't reproduce the
hanging process, though.

Since the goal is to eventually switch to the libasync backend by
default, can you try of that works better for you? It should at least
have pure D call stacks.

For the libevent driver, the best option may be to simply directly call
C's exit() when an uncaught error happens in one of the C event callbacks.

Thanks Sönke!

I remember I removed this line in core.d, and it suddenly works great:

			// always pass Errors on
			if (auto err = cast(Error)th) throw err;

It has the side effect of continuing execution on any type of error, if it's in a fiber, which is sort of cool, but certainly not for every application. I'd rather shutdown and restart than to risk any sort of corruption, even if the chances are very slim.

I will try libasync. Is it ready for production use?