5

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?

Illiax
  • 1,002
  • 1
  • 8
  • 21
  • 2
    Might be related to a bug in GHC 7.4.1: http://hackage.haskell.org/trac/ghc/ticket/5943 – vivian May 05 '12 at 03:38
  • It says its fixed, so if i download haskell plataform i should be able to work with it, right! Thanks – Illiax May 05 '12 at 04:22
  • 1
    @Iliax, I doubt the most recent Haskell Platform has 7.4.2 yet. It is on a longer release cycle than GHC. – vivian May 05 '12 at 05:16
  • 1
    7.4.2 hasn't even been released yet! You'll have to wait a little while before the fix for this is widely available. It's not anything to do with permissions, that much is certain. – Ben Millwood May 05 '12 at 13:55
  • If the answer I gave didn't work, you'll probably need to provide more information – are you compiling with/without optimisations? Which version of `acid-state` are you using? Can you provide your code, or better still a smaller program that produces the same error? – Ben Millwood May 08 '12 at 13:34

2 Answers2

2

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.

Ben Millwood
  • 6,754
  • 24
  • 45
  • This is not working, though i didnt understand the related bug u.u – Illiax May 08 '12 at 04:38
  • I expanded the answer a little bit; see also the comment I left to your question. If it's not the GHC bug, it might well be an `acid-state` bug, but it's hard to tell without more information. – Ben Millwood May 08 '12 at 13:43
2

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

Rose Perrone
  • 61,572
  • 58
  • 208
  • 243