[Issue 15256] New: Data races with arrays allowed in @safe code

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Oct 29 02:10:13 PDT 2015


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

          Issue ID: 15256
           Summary: Data races with arrays allowed in @safe code
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: accepts-invalid, safe
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dfj1esp02 at sneakemail.com

@safe:
shared string s;
void f() @safe
{
    s="s";
}

A slice is stored with two mov instructions, so when the global variable is
modified concurrently, it can end up with pointer from one array and length
from another.

--


More information about the Digitalmars-d-bugs mailing list