<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 5/5/2011 10:11 PM, Walter Bright wrote:
<blockquote cite="mid:4DC358B6.1070102@digitalmars.com" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
<br>
<br>
On 5/5/2011 6:44 PM, David Simcha wrote:
<blockquote cite="mid:4DC3527F.5020503@gmail.com" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
<br>
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.<br>
</blockquote>
<br>
Awesome! How'd you find it?<br>
</blockquote>
<br>
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.<br>
</body>
</html>