Illiax
Illiax

Reputation: 992

Thread blocked indefinitely - Haskell - Acid State

I was worried about Acid State generating to many event files and checkpoints, and the user "stepcut" told me there were an implementation of the solution in acid called createArchive which delete old events... The problem is that when I use it I get this error :

<fileName.exe>: thread blocked indefinitely in an MVar operation

I think its due w7 permissions but when i run it under 'admin' i cant get to see console but the events files are still there so i assume its not working.

If i run code through ghci, i dont get an error, but it locks the console, so i need to CtrlC to keep working.

did somebody got this error?

Upvotes: 5

Views: 960

Answers (2)

Rose Perrone
Rose Perrone

Reputation: 63506

This error disappeared from my program after I compiled my program without optimizations, as in ghc --make -O0 Main.

Upvotes: 2

Ben Millwood
Ben Millwood

Reputation: 6991

It's certainly not anything to do with permissions. The error arises when trying to read from an empty MVar to which no-one can write, or similarly trying to put a value in an MVar that is already full and won't be emptied. It means there is a bug in someone's code.

If vivian (in the comments) is right about this being related to this GHC bug then this related bug suggests that compiling with -fno-state-hack might suffice as a workaround for your problem. Looks like the bug has existed since at least GHC 7.2.2, but is fixed in the (so far unreleased) GHC 7.4.2.

Alternatively, it might just be a bug in acid-state, which appears to make significant use of MVars. In that case you should make sure you are using the latest version of the library, then try to produce a simple testcase so that other people can verify the problem.

Upvotes: 2

Related Questions