https://run.dlang.io/is/NMMpLn - minimal example. Debugging on Windows, it crashes on synchronized(mutex)
with "Access violation" trying to read at zero address.
Thread overview | ||||||
---|---|---|---|---|---|---|
|
September 11, 2023 Why does logging in destructor lead to segmentation fault? | ||||
---|---|---|---|---|
| ||||
September 11, 2023 Re: Why does logging in destructor lead to segmentation fault? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vladimir Marchevsky | On Monday, 11 September 2023 at 17:31:17 UTC, Vladimir Marchevsky wrote: >https://run.dlang.io/is/NMMpLn - minimal example. Debugging on Windows, it crashes on
|
September 11, 2023 Re: Why does logging in destructor lead to segmentation fault? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vladimir Marchevsky | On Monday, 11 September 2023 at 17:31:17 UTC, Vladimir Marchevsky wrote: >https://run.dlang.io/is/NMMpLn - minimal example. Debugging on Windows, it crashes on Generally you shouldn't access anything to do with the GC (or even really global state, such as the What's happening is that the GC is running the dtors for all objects after the main function's finished in a final cleanup, which prevents you from allocating any GC memory without crashing. Potentially as well the GC has already cleaned up the If you look at this example: https://run.dlang.io/is/PvyfOc By making the class instance It's a bit of an annoying, weird quirk. |
September 11, 2023 Re: Why does logging in destructor lead to segmentation fault? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bradley Chatha | On Monday, 11 September 2023 at 18:08:45 UTC, Bradley Chatha wrote: >What's happening is that the GC is running the dtors for all objects after the main function's finished in a final cleanup, which prevents you from allocating any GC memory without crashing. Potentially as well the GC has already cleaned up the What's confusing me is that debugger stops exactly on |