Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“counter is atomic” test fails #25

Open
Profpatsch opened this issue Dec 21, 2017 · 5 comments
Open

“counter is atomic” test fails #25

Profpatsch opened this issue Dec 21, 2017 · 5 comments

Comments

@Profpatsch
Copy link

Building unagi-chan-0.4.0.0...
Preprocessing library unagi-chan-0.4.0.0...
[ 1 of 14] Compiling Utilities        ( src/Utilities.hs, dist/build/Utilities.o )
[ 2 of 14] Compiling Data.Atomics.Counter.Fat ( src/Data/Atomics/Counter/Fat.hs, dist/build/Data/Atomics/Counter/Fat.o )
[ 3 of 14] Compiling Control.Concurrent.Chan.Unagi.NoBlocking.Types ( src/Control/Concurrent/Chan/Unagi/NoBlocking/Types.hs, dist/build/Control/Concurrent/Chan/Unagi/NoBlocking/Types.o )
[ 4 of 14] Compiling Control.Concurrent.Chan.Unagi.Constants ( src/Control/Concurrent/Chan/Unagi/Constants.hs, dist/build/Control/Concurrent/Chan/Unagi/Constants.o )
[ 5 of 14] Compiling Control.Concurrent.Chan.Unagi.Internal ( src/Control/Concurrent/Chan/Unagi/Internal.hs, dist/build/Control/Concurrent/Chan/Unagi/Internal.o )
[ 6 of 14] Compiling Control.Concurrent.Chan.Unagi.NoBlocking.Internal ( src/Control/Concurrent/Chan/Unagi/NoBlocking/Internal.hs, dist/build/Control/Concurrent/Chan/Unagi/NoBlocking/Internal.o )
[ 7 of 14] Compiling Control.Concurrent.Chan.Unagi.NoBlocking ( src/Control/Concurrent/Chan/Unagi/NoBlocking.hs, dist/build/Control/Concurrent/Chan/Unagi/NoBlocking.o )
[ 8 of 14] Compiling Control.Concurrent.Chan.Unagi.Unboxed.Internal ( src/Control/Concurrent/Chan/Unagi/Unboxed/Internal.hs, dist/build/Control/Concurrent/Chan/Unagi/Unboxed/Internal.o )
[ 9 of 14] Compiling Control.Concurrent.Chan.Unagi.NoBlocking.Unboxed.Internal ( src/Control/Concurrent/Chan/Unagi/NoBlocking/Unboxed/Internal.hs, dist/build/Control/Concurrent/Chan/Unagi/NoBlocking/Unboxed/Internal.o )
[10 of 14] Compiling Control.Concurrent.Chan.Unagi.Unboxed ( src/Control/Concurrent/Chan/Unagi/Unboxed.hs, dist/build/Control/Concurrent/Chan/Unagi/Unboxed.o )
[11 of 14] Compiling Control.Concurrent.Chan.Unagi.NoBlocking.Unboxed ( src/Control/Concurrent/Chan/Unagi/NoBlocking/Unboxed.hs, dist/build/Control/Concurrent/Chan/Unagi/NoBlocking/Unboxed.o )
[12 of 14] Compiling Control.Concurrent.Chan.Unagi.Bounded.Internal ( src/Control/Concurrent/Chan/Unagi/Bounded/Internal.hs, dist/build/Control/Concurrent/Chan/Unagi/Bounded/Internal.o )
[13 of 14] Compiling Control.Concurrent.Chan.Unagi.Bounded ( src/Control/Concurrent/Chan/Unagi/Bounded.hs, dist/build/Control/Concurrent/Chan/Unagi/Bounded.o )
[14 of 14] Compiling Control.Concurrent.Chan.Unagi ( src/Control/Concurrent/Chan/Unagi.hs, dist/build/Control/Concurrent/Chan/Unagi.o )
Preprocessing test suite 'test' for unagi-chan-0.4.0.0...
[ 1 of 26] Compiling Utilities        ( src/Utilities.hs, dist/build/test/test-tmp/Utilities.dyn_o )
[ 2 of 26] Compiling IndexedMVar      ( tests/IndexedMVar.hs, dist/build/test/test-tmp/IndexedMVar.dyn_o )
[ 3 of 26] Compiling Data.Atomics.Counter.Fat ( src/Data/Atomics/Counter/Fat.hs, dist/build/test/test-tmp/Data/Atomics/Counter/Fat.dyn_o )
[ 4 of 26] Compiling Control.Concurrent.Chan.Unagi.NoBlocking.Types ( src/Control/Concurrent/Chan/Unagi/NoBlocking/Types.hs, dist/build/test/test-tmp/Control/Concurrent/Chan/Unagi/NoBlocking/Types.dyn_o )
[ 5 of 26] Compiling Control.Concurrent.Chan.Unagi.Constants ( src/Control/Concurrent/Chan/Unagi/Constants.hs, dist/build/test/test-tmp/Control/Concurrent/Chan/Unagi/Constants.dyn_o )
[ 6 of 26] Compiling Control.Concurrent.Chan.Unagi.Internal ( src/Control/Concurrent/Chan/Unagi/Internal.hs, dist/build/test/test-tmp/Control/Concurrent/Chan/Unagi/Internal.dyn_o )
[ 7 of 26] Compiling Control.Concurrent.Chan.Unagi.NoBlocking.Internal ( src/Control/Concurrent/Chan/Unagi/NoBlocking/Internal.hs, dist/build/test/test-tmp/Control/Concurrent/Chan/Unagi/NoBlocking/Internal.dyn_o )
[ 8 of 26] Compiling Control.Concurrent.Chan.Unagi.NoBlocking ( src/Control/Concurrent/Chan/Unagi/NoBlocking.hs, dist/build/test/test-tmp/Control/Concurrent/Chan/Unagi/NoBlocking.dyn_o )
[ 9 of 26] Compiling UnagiNoBlocking  ( tests/UnagiNoBlocking.hs, dist/build/test/test-tmp/UnagiNoBlocking.dyn_o )
[10 of 26] Compiling Control.Concurrent.Chan.Unagi.Unboxed.Internal ( src/Control/Concurrent/Chan/Unagi/Unboxed/Internal.hs, dist/build/test/test-tmp/Control/Concurrent/Chan/Unagi/Unboxed/Internal.dyn_o )
[11 of 26] Compiling Control.Concurrent.Chan.Unagi.NoBlocking.Unboxed.Internal ( src/Control/Concurrent/Chan/Unagi/NoBlocking/Unboxed/Internal.hs, dist/build/test/test-tmp/Control/Concurrent/Chan/Unagi/NoBlocking/Unboxed/Internal.dyn_o )
[12 of 26] Compiling Control.Concurrent.Chan.Unagi.Unboxed ( src/Control/Concurrent/Chan/Unagi/Unboxed.hs, dist/build/test/test-tmp/Control/Concurrent/Chan/Unagi/Unboxed.dyn_o )
[13 of 26] Compiling Control.Concurrent.Chan.Unagi.NoBlocking.Unboxed ( src/Control/Concurrent/Chan/Unagi/NoBlocking/Unboxed.hs, dist/build/test/test-tmp/Control/Concurrent/Chan/Unagi/NoBlocking/Unboxed.dyn_o )
[14 of 26] Compiling UnagiNoBlockingUnboxed ( tests/UnagiNoBlockingUnboxed.hs, dist/build/test/test-tmp/UnagiNoBlockingUnboxed.dyn_o )
[15 of 26] Compiling UnagiUnboxed     ( tests/UnagiUnboxed.hs, dist/build/test/test-tmp/UnagiUnboxed.dyn_o )
[16 of 26] Compiling Control.Concurrent.Chan.Unagi.Bounded.Internal ( src/Control/Concurrent/Chan/Unagi/Bounded/Internal.hs, dist/build/test/test-tmp/Control/Concurrent/Chan/Unagi/Bounded/Internal.dyn_o )
[17 of 26] Compiling Control.Concurrent.Chan.Unagi.Bounded ( src/Control/Concurrent/Chan/Unagi/Bounded.hs, dist/build/test/test-tmp/Control/Concurrent/Chan/Unagi/Bounded.dyn_o )
[18 of 26] Compiling UnagiBounded     ( tests/UnagiBounded.hs, dist/build/test/test-tmp/UnagiBounded.dyn_o )
[19 of 26] Compiling Control.Concurrent.Chan.Unagi ( src/Control/Concurrent/Chan/Unagi.hs, dist/build/test/test-tmp/Control/Concurrent/Chan/Unagi.dyn_o )
[20 of 26] Compiling Implementations  ( tests/Implementations.hs, dist/build/test/test-tmp/Implementations.dyn_o )
[21 of 26] Compiling Deadlocks        ( tests/Deadlocks.hs, dist/build/test/test-tmp/Deadlocks.dyn_o )
[22 of 26] Compiling DupChan          ( tests/DupChan.hs, dist/build/test/test-tmp/DupChan.dyn_o )
[23 of 26] Compiling Smoke            ( tests/Smoke.hs, dist/build/test/test-tmp/Smoke.dyn_o )

tests/Smoke.hs:175:14: warning: [-Wdeprecations]
    In the use of ‘isEmptyChan’
    (imported from Control.Concurrent.Chan):
    Deprecated: "if you need this operation, use Control.Concurrent.STM.TChan instead.  See <http://ghc.haskell.org/trac/ghc/ticket/4154> for details"
[24 of 26] Compiling Unagi            ( tests/Unagi.hs, dist/build/test/test-tmp/Unagi.dyn_o )
[25 of 26] Compiling Atomics          ( tests/Atomics.hs, dist/build/test/test-tmp/Atomics.dyn_o )
[26 of 26] Compiling Main             ( tests/Main.hs, dist/build/test/test-tmp/Main.dyn_o )
Linking dist/build/test/test ...
running tests
Running 1 test suites...
Test suite test: RUNNING...
Assertions: On
Testing atomic-primops:
    counter smoke test... OK
    counter overflow... OK
    counter is atomic... test: Counter broken: expecting 10000000 got 9999984
CallStack (from HasCallStack):
  error, called at tests/Atomics.hs:150:9 in main:Atomics
Test suite test: FAIL
Test suite logged to: dist/test/unagi-chan-0.4.0.0-test.log
0 of 1 test suites (0 of 1 test cases) passed.
builder for '/nix/store/9df6kxl68z3ij9hdsdis8p5f2l3wfwxd-unagi-chan-0.4.0.0.drv' failed with exit code 1
@Profpatsch Profpatsch changed the title counter is atomic test fails “counter is atomic” test fails Dec 21, 2017
@jberryman
Copy link
Owner

Can you please paste me the exact versions of the dependencies you're compiling with? (atomic-primops is the one I'm really interested in).

Also uname -a.

@jberryman
Copy link
Owner

(and GHC version, please)

@Profpatsch
Copy link
Author

You can find all dependencies here: https://headcounter.org/hydra/build/2167633#tabs-build-deps

The system is an x86_64-linux, the build is done by nix.

@jberryman
Copy link
Owner

Hm, I don't get this failure when trying to repro locally with ghc-8.0.1 (I don't have 8.0.2 installed atm) and atomic-primops 0.8.1.1. I'm not sure how to repro from this since I'm not really familiar with nix.

Would you be able to try running the test suite for atomic-primops using the same configuration you used to build unagi-chan? There should be tests of the atomicity of fetch-and-add primops there. Alternatively could you spell out steps to repro with nix?

This definitely would seem to be a bad bug upstream (either in ghc or atomic-primops) that I'd like to be able to help sort out.

@Profpatsch
Copy link
Author

Profpatsch commented Jan 20, 2018

The atomic-primops tests are completely strange (they don’t use cabal testing but a Makefile that in turn needs cabal-install), so I can’t really include them into the normal nix build process, but running make simple from the testing directory manually (which calls this Makefile), gives the following output:

→ make simple
ghc -fforce-recomp hello.hs -o hello_regular.exe 
[1 of 1] Compiling Main             ( hello.hs, hello.o )
Linking hello_regular.exe ...
ghc -fforce-recomp hello.hs -o hello_threaded.exe -threaded
[1 of 1] Compiling Main             ( hello.hs, hello.o )
Linking hello_threaded.exe ...
ghc -fforce-recomp hello.hs -o hello_prof.exe -prof
[1 of 1] Compiling Main             ( hello.hs, hello.o )
Linking hello_prof.exe ...
ghc -fforce-recomp hello.hs -o hello_prof_threaded.exe -prof -threaded
[1 of 1] Compiling Main             ( hello.hs, hello.o )
Linking hello_prof_threaded.exe ...
./hello_regular.exe 
hello
4
./hello_threaded.exe
hello
4
./hello_prof.exe
hello
4
./hello_prof_threaded.exe
hello
4

So the tests seem to pass just fine? I didn’t run the complex tests, since that requires cabal itself and im pretty sure cabal install doesn’t work in that context.

Note the deprecation warning of isEmptyChan in the unagi-chan build output; according to this GHC bug that can lead to deadlocks. Maybe that has something to do with the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants