Thread overview
"use after free" crashbug in DMD (and fix)
Feb 01, 2015
ketmar
Feb 01, 2015
ZombineDev
Feb 01, 2015
ketmar
Feb 01, 2015
ketmar
February 01, 2015
https://issues.dlang.org/show_bug.cgi?id=14097

i know that bugzilla patches can be slow to review, but this is a critical heisenbug which must be fixed ASAP, i believe. so i'm pinging here.

February 01, 2015
I have made a pull request[1] with your fix, if you don't mind.


[1]: https://github.com/D-Programming-Language/dmd/pull/4363


On Sunday, 1 February 2015 at 01:30:40 UTC, ketmar wrote:
> https://issues.dlang.org/show_bug.cgi?id=14097
>
> i know that bugzilla patches can be slow to review, but this is a
> critical heisenbug which must be fixed ASAP, i believe. so i'm pinging
> here.

February 01, 2015
On Sun, 01 Feb 2015 03:09:15 +0000, ZombineDev wrote:

> I have made a pull request[1] with your fix, if you don't mind.
thank you.

February 01, 2015
On Sun, 01 Feb 2015 03:27:06 +0000, ketmar wrote:

> On Sun, 01 Feb 2015 03:09:15 +0000, ZombineDev wrote:
> 
>> I have made a pull request[1] with your fix, if you don't mind.
> thank you.

ah, and that caching is needed. `free()` in `AsyncRead::dispose` *can* be executed before loop in `startthread` finishes, so `startthread` will try to dereference `aw->filesdim` and hit the same "use after free" bug.

multithreaded code is a very fragile thing. ;-)