Skip to content

ghci leaves /tmp/ghc* directory if killed by signal

I was wondering where do numerous /tmp/ghc${PID}_0 directories come from. And noticed that they are not removed when I kill (close) '*haskell*' Emacs buffer instead of typing ':q' in ghci prompt...

I've investigated this problem down to ghci: when ghci has an .hs file :load-ed and is killed with SIGHUP or SIGTERM signal, it leaves /tmp/ghc${PID}_0 directory.

$ ls -d /tmp/ghc*
ls: cannot access /tmp/ghc*: No such file or directory
$ ghci *.hs &
[1] 26384
$ GHCi, version 6.10.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling Main             ( proxy-POC.hs, interpreted )
Ok, modules loaded: Main.
*Main> 
$ ls -d /tmp/ghc*
/tmp/ghc26384_0

[1]+  Stopped                 ghci *.hs
$ kill -HUP %%

[1]+  Stopped                 ghci *.hs
$ ls -d /tmp/ghc*
/tmp/ghc26384_0
[1]+  Hangup                  ghci *.hs
$ ls -d /tmp/ghc*
/tmp/ghc26384_0
$ pgrep ghc
$ ps 26384
  PID TTY      STAT   TIME COMMAND
Trac metadata
Trac field Value
Version 6.10.4
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC valery.vv@gmail.com
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information