PR# 18432 Deadlock on simple barrier program

Problem Report Summary
Submitter: saynte
Category: Runtime
Priority: Medium
Date: 2012/11/28
Class: Bug
Severity: Serious
Number: 18432
Release: 7.1
Confidential: No
Status: Analyzed
Responsible:
Environment: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.91 Safari/537.11
Synopsis: Deadlock on simple barrier program

Description
The program implements a simple barrier.

Every process repeatedly:

1) increments the shared variable
2) waits for the 'is_full' query to be true
3) sets itself to done (which will then reset the count of the barrier when all separate objects call 'set_done')

Sometimes it completes, sometimes it deadlocks.

The same algorithm works in other languages, which leads me to believe this is a SCOOP runtime issue. 

Also, if you add some debugging print statements (this may make it harder to find the deadlock) the deadlocks happen with more or less random program states: ie, there's no reason for it to be deadlocked either on a wait-condition or because of processor locking.
To Reproduce
Compile the attached code in finalized mode, run it a few times until it deadlocks.
Problem Report Interactions
From:saynte    Date:2012/11/28    Download   
Attachments for problem report #18432

Attachment: barrier.zip     Size:1833