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

Jack Kelly jack at jackkelly.name
Wed Apr 1 09:48:42 UTC 2020


I am not a maintainer for mmap, and do not know.

-- Jack

YueCompl <compl.yue at icloud.com> writes:

> 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


More information about the Haskell-Cafe mailing list