[Issue 11803] New: DMD tester core.exception.AssertError at core.thread(26XX): unittest failure

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 22 11:20:33 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11803

           Summary: DMD tester
                    core.exception.AssertError at core.thread(26XX): unittest
                    failure
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: maxim at maxim-fomin.ru


--- Comment #0 from Maxim Fomin <maxim at maxim-fomin.ru> 2013-12-22 11:20:31 PST ---
This is similar to issue 8960:

from core/thread.d:2637 

unittest
{
    import core.sync.semaphore;

    shared bool inCriticalRegion;
    auto sem = new Semaphore();

    auto thr = new Thread(
    {
        thread_enterCriticalRegion();
        inCriticalRegion = true;
        sem.notify();
        Thread.sleep(dur!"msecs"(1));
        inCriticalRegion = false;
        thread_exitCriticalRegion();
    });
    thr.start();

    sem.wait();
    assert(inCriticalRegion);
    thread_suspendAll();
    assert(!inCriticalRegion);
    thread_resumeAll();
}

Started thread may terminate before executing se,.wait() thus leaving
inCriticalSection = false. The root of the problem is absence of supporting
code to launch thread and wait for a semaphore. This makes current unittest to
speculate whether thread will terminate before waiting semaphore or not.

Example of non-deterministic failure:

d.puremagic.com/test-results/pull.ghtml?projectid=1&runid=829992&logid=5

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list