Skip to content

RTS ticker thread can cause trouble #3

@sorki

Description

@sorki

Recently I found that a testsuite using this package started failing with unshare: invalid argument but I wasn't sure what was going on as command line unshare worked just fine. Comparing both calls I didn't see much difference but then stumbled on clone3 call done by GHC forking a process called ghc_ticker. The use of ticker seems to depend on compile time options and availability of packages during GHC build.

Some more info https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/rts/signals#the-rts-timer-signal

This started manifesting in CI which used latest Ubuntu and on NixOS as well.

The fix is to disable the timer with

ghc-options:       -rtsopts "-with-rtsopts -V0"

From help:

hnix-store-remote-tests:   -V<secs>  Master tick interval in seconds (0 == disable timer).
hnix-store-remote-tests:             This sets the resolution for -C and the heap profile timer -i,
hnix-store-remote-tests:             and is the frequency of time profile samples.
hnix-store-remote-tests:             Default: 0.01 sec.

Should we add this to the comments (or README) that already mention issues with -threaded?

During the debugging I've also extracted the example to separate cabal executable - want a PR? I can also PR a simple testsuite + CI if you want.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions