Debugging silent exit of threads in Phobos calls

Steven Schveighoffer schveiguy at yahoo.com
Fri Jun 1 15:20:50 UTC 2018


On 6/1/18 10:53 AM, ketmar wrote:
> Russel Winder wrote:
> 
>> 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:
> 
> it looks like "// type T is not constructible from A" phobos assertion 
> triggered. that is, std.variant cannot wrap the struct, and all hell 
> breaks loose.

That assertion is something that should never happen. Something is wrong 
with the type checking here.

If you look up earlier, clearly the type id matches. There is something 
weird about that static if that is not working.

Can you put in some more debug messages and see what the exact types of 
A and T are? Just put it right before the assert.

-Steve


More information about the Digitalmars-d-learn mailing list