rrnewton / haskell-lockfree

A collection of different packages for CAS based data structures.
106 stars 25 forks source link

[atomic-primops] casmutarray1 test failure in GHC 7.10 #42

Closed rrnewton closed 9 years ago

rrnewton commented 9 years ago

As mentioned in #40, this was one of the two tests that failed under GHC 7.10. It needs to be investigated.

jberryman commented 9 years ago

It seems to me this was a testing bug; the code had:

writeArray arr 4 33
 putStrLn "Wrote array elements..."

 tick <- readArrayElem arr 4                        -- TICKET FROM IX 4
 putStrLn$ "(Peeking at array gave: "++show (peekTicket tick)++")"

 (res1,tick2) <- casArrayElem arr 3 tick 44   -- BEING USED ON IX 3
 (res2,_)     <- casArrayElem arr 3 tick 44

When I change the last two lines above to 4 as well the test passes. AFAICT the behavior of the original was undefined and shouldn't be expected to work. If that sounds right I'll close the ticket when I commit.

rrnewton commented 9 years ago

Yes, indeed, that looks like a simple bug in the test! Thanks for catching it.