Debugging silent exit of threads in Phobos calls
Russel Winder
russel at winder.org.uk
Fri Jun 1 14:47:03 UTC 2018
On Fri, 2018-06-01 at 16:37 +0300, ketmar via Digitalmars-d-learn
wrote:
>
[…]
> yeah. if it receives something it doesn't expect (and there is no
> `Variant`
> clause to catch it), it throws. and exceptions from threads are
> silently
> dropped on the floor -- along with the dead threads. so it is better
> to
> always wrap your threads in `try/catch`, and at least log an
> exception.
It seems that in the case he presence of the Variant doesn't matter.
The message sent is of type frontend_manager.FrontendAppeared and one
of the receive types is frontend_manager.FrontendAppreared yet this
fails to match but it is not treated as a Variant.
The stack trace is:
ControlWindowDaemon: receive threw an exception core.exception.AssertError@/usr/include/dmd/phobos/std/variant.d(323): FrontendAppeared
----------------
??:? _d_assert_msg [0x55e72826]
??:? bool std.variant.VariantN!(32uL).VariantN.handler!(frontend_manager.FrontendAppeared).handler(std.variant.VariantN!(32uL).VariantN.OpID, ubyte[32]*, void*).tryPutting(frontend_manager.FrontendAppeared*, TypeInfo, void*) [0x55ba1dc1]
??:? long std.variant.VariantN!(32uL).VariantN.handler!(frontend_manager.FrontendAppeared).handler(std.variant.VariantN!(32uL).VariantN.OpID, ubyte[32]*, void*) [0x55ba1949]
??:? inout @property inout(frontend_manager.FrontendAppeared) std.variant.VariantN!(32uL).VariantN.get!(frontend_manager.FrontendAppeared).get() [0x55b9fadf]
??:? void std.concurrency.Message.map!(void function(frontend_manager.FrontendAppeared) @safe*).map(void function(frontend_manager.FrontendAppeared) @safe*) [0x55b9fa9c]
??:? bool std.concurrency.MessageBox.get!(void function(frontend_manager.FrontendAppeared) @safe*, void function(frontend_manager.FrontendDisappeared) @safe*, void delegate(std.concurrency.OwnerTerminated) @safe).get(scope void function(frontend_manager.FrontendAppeared) @safe*, scope void function(frontend_manager.FrontendDisappeared) @safe*, scope void delegate(std.concurrency.OwnerTerminated) @safe).onStandardMsg(ref std.concurrency.Message) [0x55b9f3b4]
??:? bool std.concurrency.MessageBox.get!(void function(frontend_manager.FrontendAppeared) @safe*, void function(frontend_manager.FrontendDisappeared) @safe*, void delegate(std.concurrency.OwnerTerminated) @safe).get(scope void function(frontend_manager.FrontendAppeared) @safe*, scope void function(frontend_manager.FrontendDisappeared) @safe*, scope void delegate(std.concurrency.OwnerTerminated) @safe).scan(ref std.concurrency.List!(std.concurrency.Message).List) [0x55b9f834]
??:? bool std.concurrency.MessageBox.get!(void function(frontend_manager.FrontendAppeared) @safe*, void function(frontend_manager.FrontendDisappeared) @safe*, void delegate(std.concurrency.OwnerTerminated) @safe).get(scope void function(frontend_manager.FrontendAppeared) @safe*, scope void function(frontend_manager.FrontendDisappeared) @safe*, scope void delegate(std.concurrency.OwnerTerminated) @safe) [0x55b9f2c8]
??:? void std.concurrency.receive!(void function(frontend_manager.FrontendAppeared) @safe*, void function(frontend_manager.FrontendDisappeared) @safe*, void delegate(std.concurrency.OwnerTerminated) @safe).receive(void function(frontend_manager.FrontendAppeared) @safe*, void function(frontend_manager.FrontendDisappeared) @safe*, void delegate(std.concurrency.OwnerTerminated) @safe) [0x55b9f0ec]
??:? void control_window.runControlWindowDaemon() [0x55b9edb3]
??:? void std.concurrency._spawn!(void function()*)._spawn(bool, void function()*).exec() [0x55ba3f4f]
??:? void core.thread.Thread.run() [0x55e739a7]
??:? thread_entryPoint [0x55ea5267]
??:? [0xf79bd5a9]
--
Russel.
===========================================
Dr Russel Winder t: +44 20 7585 2200
41 Buckmaster Road m: +44 7770 465 077
London SW11 1EN, UK w: www.russel.org.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20180601/4ebe65f7/attachment-0001.sig>
More information about the Digitalmars-d-learn
mailing list