[Haskell-cafe] mmap Failure in: 24:Counters should be zero

YueCompl compl.yue at icloud.com
Wed Apr 1 09:41:27 UTC 2020


Hi mmap maintainers,

Today I found the last test case out of 25 failed like:

```bash
$ cabal v2-run -f mmaptest mmaptest
Resolving dependencies...
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - mmap-0.5.9 (exe:mmaptest) (configuration changed)
Configuring mmap-0.5.9...
Preprocessing executable 'mmaptest' for mmap-0.5.9..
Building executable 'mmaptest' for mmap-0.5.9..

<no location info>: warning: [-Wmissing-home-modules]
    These modules are needed for compilation but not listed in your .cabal file's other-modules: 
        System.IO.MMap

<no location info>: warning: [-Wmissing-home-modules]
    These modules are needed for compilation but not listed in your .cabal file's other-modules: 
        System.IO.MMap
### Failure in: 24:Counters should be zero  
tests/mmaptest.hs:256
expected: 0
 but got: 4
Cases: 25  Tried: 25  Errors: 0  Failures: 1
```

And the test code is:

```haskell
test_counters_zero = do
    System.Mem.performGC
    threadDelay 1000
    counters <- c_system_io_counters
    return (counters @?= 0)
```

I see it is to make sure no resource held open after 1 millisecond after garbage collection is triggered. 
I tried extending the threadDelay to 10 second and still got 4 thus failing the test, maybe newer machinery of GC with GHC 8.6 should be leveraged to prevent such leakage?

I CC haskell-cafe list to seek for broader community help, maybe some one can confirm that I can just live with this specific failure without worries?

Thanks & best regards,
Compl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20200401/9a5bab38/attachment.html>


More information about the Haskell-Cafe mailing list