"use after free" crashbug in DMD (and fix)
ketmar via Digitalmars-d
digitalmars-d at puremagic.com
Sat Jan 31 19:29:29 PST 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. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150201/0328d1ba/attachment.sig>
More information about the Digitalmars-d
mailing list