Sample program that reproduces the desribed error.
text/x-dsrc
543
Comments
Comment #0 by christoph — 2013-12-23T07:09:19Z
Created attachment 1304
Sample program that reproduces the desribed error.
When an in-contract of an interface fails, the in-contract of the implementing
class is used. This works fine in single-threaded applications. In
multithreaded applications however, the program freezes after a while when
executing the in-contract of the interface. I attached a small program "main.d"
that shows the problem. The program should execute endlessly, but in fact it
freezes always at the same spot. The output is always:
...
foo 401
base in-contract
derived in-contract
foo 402
base in-contract
derived in-contract
foo 403
base in-contract
[freezes]
Comment #1 by christoph — 2013-12-24T13:05:29Z
Using my debugger I found out, that the Garbage Collector always freezes in multithreading. GC.collect() causes an instant freeze when more than one thread is running.
Comment #2 by christoph — 2014-01-24T02:42:12Z
Seems to be fixed in the most recent version in the repository.
Comment #3 by andrea.9940 — 2014-10-01T07:58:11Z
The deadlock is still present in DMD 2.066 and 2.067.0-b1 (on linux x86_64)
Stacktrace of the sample program http://pastebin.com/iXWWrcBR
Comment #4 by andrea.9940 — 2014-10-01T08:29:40Z
Both issues show a deadlock after a call to gc.gc.Gcx.fullcollect().
In this particular case, the GC collection is triggered by continuously allocating exceptions in the base contract because of assert(false).
*** This issue has been marked as a duplicate of issue 4890 ***