
#9673: aarch64 7.8.4, 7.10, 7.11: lib/ghc/bin/ghc-pkg --version does not output from subprocess -------------------------------------+------------------------------------- Reporter: juhpetersen | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Linux | Architecture: aarch64 Type of failure: Installing GHC | Test Case: failed | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Comment (by rwbarton): Interesting results. This seems to confirm that the issue is whether stdout is a tty. When stdout is redirected to a file (and thus not a tty), the stdout Handle will have BlockBuffering (see `GHC.IO.Handle.Internals.getCharBuffer`). Perhaps the output is being written to that buffer, but never flushed. (Whereas when stdout is a tty, the stdout Handle has LineBuffering so the output is flushed immediately.) `ghc-pkg --version` calls `exitWith ExitSuccess`, so I think stdout is supposed to be flushed by `GHC.TopHandler.flushStdHandles`. I'm very suspicious of the two `ioctl` syscalls, where there is only one on x86_64. It looks as though the stdout Handle CAF (which is a `unsafePerformIO $ do { ... ; mkHandle ... }`) has been copied by the dynamic loader and the version referred to by the executable has a separate identity from the version referred to internally by libHSbase in `GHC.TopHandler.flushStdHandles`. On Linux x86_64 I see these references to the stdout Handle in ghc-pkg: {{{ rwbarton@morphism:/tmp$ objdump -DR ~/lib/ghc-7.8.4/bin/ghc-pkg | grep stdout 6407a0: R_X86_64_GLOB_DAT base_GHCziIOziHandleziFD_stdout_closure 6493a0: R_X86_64_64 base_GHCziIOziHandleziFD_stdout_closure 6495b8: R_X86_64_64 base_GHCziIOziHandleziFD_stdout_closure 649968: R_X86_64_64 base_GHCziIOziHandleziFD_stdout_closure 649ce0: R_X86_64_64 base_GHCziIOziHandleziFD_stdout_closure 649e30: R_X86_64_64 base_GHCziIOziHandleziFD_stdout_closure }}} What is the corresponding output on your ARM system? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9673#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler