On 5/5/2011 10:11 PM, Walter Bright wrote:


On 5/5/2011 6:44 PM, David Simcha wrote:

I've found the extremely subtle race condition that was destroying stack-allocated tasks in amap and parallel foreach while they were still referenced and causing scope closures to be deallocated prematurely in a few ridiculously rare cases.  This is obviously capable of causing stack corruption.  I'm going to try to fix it tonight, but I'm not guaranteeing anything.

Awesome! How'd you find it?

Reading the code carefully after remembering how hard a similar bug was to debug a long time ago.  I've given up and decided to start using the GC a little more to simplify things.  When I wrote the old version, I was in the middle of an "avoid malloc like the plague" streak.  Now, I'm taking a more level-headed approach and realizing that any solution that doesn't involve heap allocations is going to be even more expensive than heap allocations.
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to