www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - "use after free" crashbug in DMD (and fix)

reply ketmar <ketmar ketmar.no-ip.org> writes:
https://issues.dlang.org/show_bug.cgi?id=3D14097

i know that bugzilla patches can be slow to review, but this is a=20
critical heisenbug which must be fixed ASAP, i believe. so i'm pinging=20
here.=
Jan 31 2015
parent reply "ZombineDev" <valid_email he.re> writes:
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.
Jan 31 2015
parent reply ketmar <ketmar ketmar.no-ip.org> writes:
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.=
Jan 31 2015
parent ketmar <ketmar ketmar.no-ip.org> writes:
On Sun, 01 Feb 2015 03:27:06 +0000, ketmar wrote:

 On Sun, 01 Feb 2015 03:09:15 +0000, ZombineDev wrote:
=20
 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=20 executed before loop in `startthread` finishes, so `startthread` will try=20 to dereference `aw->filesdim` and hit the same "use after free" bug. multithreaded code is a very fragile thing. ;-)=
Jan 31 2015