# Bug: Calling SetSharedVariable while kernels are running hangs them up/crashes them

Bug introduced in 9.0 or earlier and persisting through 11.0.1 or later

Start a fresh kernel Quit, and maybe launch ParallelDeveloperKernelStatus[], that is Evaluation > Parallel Kernel Status....

The following succeeds and finishes:

dummy = ParallelSubmit[Null];
w = ParallelSubmit[Pause[2]]
WaitAll[dummy]
WaitAll[w]


This however never stops

dummy = ParallelSubmit[Null];
w = ParallelSubmit[Pause[2]]
WaitAll[dummy]
SetSharedVariable[x];
WaitAll[w]


and generates

ParallelDeveloperQueueRun::hmm: Received unexpected result Null from KernelObject[3,local].

Calling ParallelDeveloperQueueRun[] directly instead of relying on a dummy task and WaitAll to do it, reveals that the kernels get locked up one after the other:

ParallelSubmit[Pause[2]]
ParallelDeveloperQueueRun[]
SetSharedVariable[u];
ParallelDeveloperQueueRun[]


Will on the first run create an EvaluationObject saying that it is running on kernel 4, then on the next run on kernel 3, etc., until the the task just stays ready for processing.

I am positive that the problem comes from SetSharedVariable, probably because it is trying to communicate with the running kernels and failing. Still I think this shouldn't crash/hang up the kernels.

Worth reporting?

• Yes, worth reporting. – Szabolcs Aug 18 '16 at 11:35
• I filed a report. – masterxilo Aug 18 '16 at 12:55
• The reply is "I was able to reproduce the issue and have filed a report to the development team, raising this issue to them." – masterxilo Aug 22 '16 at 18:24