Summary: [64-bit] Global Hidden Mutexes Seem to share Addresses
                    W/ Global Variables
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from David Simcha <> 2011-02-13 18:43:48 PST ---
Apparently global gets overwritten when the synchronized block is entered in
the following code:

import std.stdio;

void doSynchronized() {
    stderr.writeln("In doSynchronized() 1:  ", cast(void*) global);
    synchronized {
        stderr.writeln("In doSynchronized() 2:  ", cast(void*) global);

__gshared Object global;

void main() {
    auto local = new Object;
    global = local;

    stderr.writeln("In main() 1:  ",
        cast(void*) global, '\t', cast(void*) local);
    stderr.writeln("In main() 2:  ",
        cast(void*) global, '\t', cast(void*) local);



In main() 1:  7F4E605D8E70    7F4E605D8E70
In doSynchronized() 1:  7F4E605D8E70
In doSynchronized() 2:  0
In main() 2:  0    7F4E605D8E70

Happens only in 64-bit mode.  -O, -inline and -release flags seem to be

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to