Bug 11803 – DMD tester [email protected](26XX): unittest failure

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-12-22T11:20:00Z
Last change time
2015-06-09T05:14:41Z
Assigned to
nobody
Creator
maxim

Comments

Comment #0 by maxim — 2013-12-22T11:20:31Z
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
Comment #1 by maxim — 2013-12-22T13:12:46Z
*** This issue has been marked as a duplicate of issue 11519 ***