Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thread blocked indefinitely - Haskell - Acid State

Tags:

haskell

acid

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?

like image 451
Illiax Avatar asked Oct 07 '22 22:10

Illiax


2 Answers

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.

like image 107
Ben Millwood Avatar answered Oct 12 '22 12:10

Ben Millwood


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

like image 21
Rose Perrone Avatar answered Oct 12 '22 12:10

Rose Perrone