[Issue 15513] Memory Corruption with thread local objects

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jan 19 18:54:54 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15513

--- Comment #1 from Puneet Goel <puneet at coverify.org> ---
I am getting hit by this issue often when I have static variables declared
inside a function and the function is being called in multiple threads.

Another observation is that the memory corruption happens if the static
variable is allocated on the heap rather than stack. For example if I declare a
static variable array with fixed length, then there will not be any issue. But
if the static variable is a dynamically sized array which gets allocated on the
heap on the first call to the function, it gets corrupted after a while.

I am reducing another test case where the contents of a dynamic array are
getting corrupted though the code writes into it only once. Since I work on a
large project with almost 100000 lines of code, dustmite takes days to reduce.

--


More information about the Digitalmars-d-bugs mailing list