Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

killThread hangs on GHC 7.0.4 7.2.1 but NOT 6.12.3 and 7.4.1 #7

Closed
rrnewton opened this issue Feb 25, 2012 · 2 comments
Closed

killThread hangs on GHC 7.0.4 7.2.1 but NOT 6.12.3 and 7.4.1 #7

rrnewton opened this issue Feb 25, 2012 · 2 comments

Comments

@rrnewton
Copy link
Member

The bug is found in DemoTransport.hs, which will hang when trying to "killThread"
(Pipes backend only, demo3 and demo4). Yet this hang happens ONLY under GHC
7.0.4 and 7.2.1. Under GHC 6.12.3 and GHC 7.4.1 it works fine!

At first I thought this may be an issue with non-allocating threads not
being preempted by the runtime system (and therefore not servicing the
ThreadKilled asynchronous exception). But it's hard to explain that
pattern of outcomes on different GHC versions.

See commit: 48e257a

@rrnewton
Copy link
Member Author

Note for reproducing:

You can use the following bash script inside the examples directory to build all four versions of this and compare them for yourself.

#!/bin/bash

set -e

function go() {
  VER=$1
  make clean
  GHC=ghc-$1 make DemoTransport.exe
  mv -f DemoTransport.exe DemoTransport_$VER.exe
}

go 6.12.3
go 7.0.4
go 7.2.1
go 7.4.1

@simonmar
Copy link
Contributor

Might have been a bug in the asynchronous-exception handling code in the RTS. e.g. this commit might be the fix:

commit fa71e6c795489ec267e0d048395c2c52bea6a164
Author: Simon Marlow marlowsd@gmail.com
Date: Wed Aug 31 22:45:01 2011 +0100

Fix #4988: we were wrongly running exception handlers in the
maskUninterruptible state instead of ordinary mask, due to a
misinterpretation of the way the TSO_INTERRUPTIBLE flag works.

Remarkably this must have been broken for quite some time.  Indeed we
even had a test that demonstrated the wrong behaviour (conc015a) but
presumably I didn't look hard enough at the output to notice that it
was wrong.

@edsko edsko closed this as completed Jul 27, 2012
hyperthunk added a commit that referenced this issue Oct 19, 2015
Add dependency on ghc-prim for ghc-7.4.2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants