How to enable feedback for AssertError?

your_name via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 8 10:13:02 PDT 2016


On Tuesday, 7 June 2016 at 04:21:34 UTC, Mike Parker wrote:
> On Tuesday, 7 June 2016 at 02:05:00 UTC, Seb wrote:
>> On Tuesday, 7 June 2016 at 01:40:01 UTC, your_name wrote:
>>>
>>> The way I traced the problem, ironically ;), was to catch 
>>> Error and print it to screen.
>>> It involved dereferencing a null pointer in a thread and an 
>>> 'assert null this' silently killed the thread leaving me 
>>> wondering why it didn't produce data.
>>> Anyhow, I've had this behavior at least 1 more time but I 
>>> forgot what exactly it was related to.
>>>
>>> Maybe I missed something beyond building a normal -debug 
>>> version.
>>>
>>> Anyways, thanks for your reply :)
>>
>> Please open an issue - this sounds like a big then.
>
> Exceptions thrown from spawned threads do not, by default, 
> terminate the main thread, so they will not be printed to the 
> screen unless it's done explicitly. See this old forum thread 
> at [1].
>
> Note this quote from Sean Kelley (the original maintainer of 
> DRuntime):
>
> "Oh, I should mention that if you use core.thread explicitly, 
> any unhandled exception will be re-thrown in the context of 
> whoever joins that thread."
>
>
> [1] 
> http://forum.dlang.org/post/mailman.1153.1344440030.31962.digitalmars-d-learn@puremagic.com

Hi Mike,

thanks for the pointer.

However, since this is my first program in D using multi 
threading I am very sure that the other issue occured in a single 
threaded program.
This was a while ago and I have since updated dmd/druntime/phobos 
several times so I could not tell if it would still apply.

I try to investigate tomorrow, or day after tomorrow, depending 
on my schedule...

Anyways, thanks everyone for your help so far :)



More information about the Digitalmars-d-learn mailing list