Syncleus / aparapi

The New Official Aparapi: a framework for executing native Java and Scala code on the GPU.
http://aparapi.com
Apache License 2.0
466 stars 59 forks source link

Deadlock running integration test ProfileReportBackwardsCompatTest.sequentialSingleThreadJTPTest() #101

Closed CoreRasurae closed 6 years ago

CoreRasurae commented 6 years ago

It looks like some of the threads die during kernel execution, at least there should be 16 threads and I only have 7 running and they are all waiting on a CyclicBarrier on KernelRunner.await() line 331 called from KernelRunner.access() line 679 called from KernelRunner.run() line 663. Could it be some exception that is thrown that makes the threads die and then there aren't enough parties for the CyclicBarrier to unlock? It happened running sequentialSingleThreadJTPTest().

CoreRasurae commented 6 years ago

I am able to reproduce the bug before the feature was merged at commit cd911b937c7804dac495f5fadd573fe1f2ac5a4f - test: added another test showing out of scope error.

With the attached test - ProfileReportBackwardsCompatTest.java.txt

CoreRasurae commented 6 years ago

I was also able to reproduce the bug with aparapi releases 1.4.1 and 1.6.0.

freemo commented 6 years ago

@CoreRasurae Thanks.. I am worried this might be a tricky one to catch, particularly since it has yet to occur for me locally, only on travis. But ill keep poking around and see what i come up with.

automenta commented 6 years ago

pitest might be useful here to discover test deficiencies http://pitest.org/

freemo commented 6 years ago

@automenta i got them to use pitest at comcast. Its slow but can be useful

CoreRasurae commented 6 years ago

@freemo I think the easiest way to reproduce the problem is to run it on a dual core machine, where the number of cores are restricted. KernelRunner ForkJoinPool thread number is bound to the number of processors.

freemo commented 6 years ago

This bug has been resolved, closing.