Program crash: GC destroys an object unexpectedly

eugene dee0xeed at gmail.com
Sun Sep 19 17:40:47 UTC 2021


On Sunday, 19 September 2021 at 16:27:55 UTC, jfondren wrote:
> So the problem here is that ctrl-C causes that message to come 
> but Stopper's been collected and that address contains garbage.

This is exactly what I was trying to say...
Thanx a lot for your in-depth investigation of the trouble!
I'll try your patches later.

> Since the Message in the MessageQueue should keep it alive, I 
> think this is probably a bug in dmd.

In the starting post I noticed that

- when compiled with gdc, echo-client does not crash
- when compiled with ldc, no crash
- but when compiled with gdc -Os, same crash as with dmd.

The last was (and still is) the most confusing observation for me.



More information about the Digitalmars-d-learn mailing list