Ticket #3656 (closed merge: fixed)

Opened 4 years ago

Last modified 3 years ago

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

Reported by: vvv Owned by: igloo
Priority: normal Milestone: 6.12.2
Component: GHCi Version: 6.10.4
Keywords: Cc: valery.vv@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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

Change History

follow-up: ↓ 2   Changed 4 years ago by igloo

  • failure set to None/Unknown
  • milestone set to 6.12.2

Thanks for the report. I'm not quite sure what's going on here. After killing GHC, if I hit enter in the terminal then I get a

<stdin>: hWaitForInput: hardware fault (Input/output error)

exception, after which the directory is deleted.

in reply to: ↑ 1   Changed 4 years ago by vvv

Replying to igloo:

After killing GHC, if I hit enter in the terminal then I get a {{{ <stdin>: hWaitForInput: hardware fault (Input/output error) }}} exception, after which the directory is deleted.

I haven't noticed such behavior. What I have noticed is that /tmp/ghc* directories are not always created. They are created on one of my laptops, while on another they are not. Both have the same version of GHC (6.10.4) installed.

  Changed 3 years ago by simonmar

  • owner set to simonmar
  • status changed from new to assigned

  Changed 3 years ago by simonmar

  • owner changed from simonmar to igloo
  • status changed from assigned to new
  • type changed from bug to merge

Fixed:

Wed Jan 27 14:04:38 GMT 2010  Simon Marlow <marlowsd@gmail.com>
  * catch SIGHUP and SIGTERM and raise an exception (#3656)

  Changed 3 years ago by simonmar

this patch needs to be merge too:

Wed Jan 27 16:29:54 GMT 2010  Simon Marlow <marlowsd@gmail.com>
  * fix warning on Windows

  Changed 3 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Both merged

Note: See TracTickets for help on using tickets.