Quantcast

[GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

classic Classic list List threaded Threaded
26 messages Options
12
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
--------------------------+-------------------------------------------------
    Reporter:  pturnbull  |       Owner:            
        Type:  bug        |      Status:  new      
    Priority:  normal     |   Component:  GHCi      
     Version:  6.12.3     |    Keywords:  MVar      
    Testcase:             |   Blockedby:            
          Os:  MacOS X    |    Blocking:            
Architecture:  x86        |     Failure:  GHCi crash
--------------------------+-------------------------------------------------
 I stumbled across this error today:
 {{{
 phil ~
 $ ghci
 GHCi, version 6.12.3: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Loading package ffi-1.0 ... linking ... done.
 Prelude>
 [1]+  Stopped                 ghci
 phil ~
 $ fg
 ghci
 ^C^C

 Prelude>
 ghc: panic! (the 'impossible' happened)
   (GHC version 6.12.3 for i386-apple-darwin):
         thread blocked indefinitely in an MVar operation

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

 phil ~
 $
 }}}

 Steps to reproduce:
  * start ghci
  * ctrl-z
  * fg
  * ctrl-c
  * ctrl-c
  * enter
  * wait ~2 seconds

 I'm not sure if it is related but while waiting for the impossible to
 happen, any characters typed are not echoed to the screen.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
--------------------------+-------------------------------------------------
    Reporter:  pturnbull  |        Owner:            
        Type:  bug        |       Status:  new      
    Priority:  normal     |    Milestone:            
   Component:  GHCi       |      Version:  6.12.3    
    Keywords:  MVar       |     Testcase:            
   Blockedby:             |   Difficulty:            
          Os:  MacOS X    |     Blocking:            
Architecture:  x86        |      Failure:  GHCi crash
--------------------------+-------------------------------------------------

Comment(by simonmar):

 I don't see the bug on Linux, but I do see something else slightly
 strange.  After foregrounding GHCi again, the first Ctrl-C brings up
 another `Prelude>` prompt which is fine, but if I then Ctrl-D to exit I
 get

 {{{
 Prelude>
 <stdin>: hWaitForInput: end of file
 }}}

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
--------------------------+-------------------------------------------------
    Reporter:  pturnbull  |        Owner:            
        Type:  bug        |       Status:  new      
    Priority:  high       |    Milestone:  6.14.1    
   Component:  GHCi       |      Version:  6.12.3    
    Keywords:  MVar       |     Testcase:            
   Blockedby:             |   Difficulty:            
          Os:  MacOS X    |     Blocking:            
Architecture:  x86        |      Failure:  GHCi crash
--------------------------+-------------------------------------------------
Changes (by igloo):

  * priority:  normal => high
  * milestone:  => 6.14.1


--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
--------------------------+-------------------------------------------------
    Reporter:  pturnbull  |        Owner:            
        Type:  bug        |       Status:  new      
    Priority:  normal     |    Milestone:  6.14.1    
   Component:  GHCi       |      Version:  6.12.3    
    Keywords:  MVar       |     Testcase:            
   Blockedby:             |   Difficulty:            
          Os:  MacOS X    |     Blocking:            
Architecture:  x86        |      Failure:  GHCi crash
--------------------------+-------------------------------------------------
Changes (by simonmar):

  * priority:  high => normal


Comment:

 Anyone with access to a Mac care to look into this one?  It doesn't seem
 important enough to hold up the release for.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
---------------------------------+------------------------------------------
    Reporter:  pturnbull         |        Owner:            
        Type:  bug               |       Status:  new      
    Priority:  normal            |    Milestone:  7.0.2    
   Component:  GHCi              |      Version:  7.0.1    
    Keywords:  MVar              |     Testcase:            
   Blockedby:                    |   Difficulty:            
          Os:  Unknown/Multiple  |     Blocking:            
Architecture:  x86               |      Failure:  GHCi crash
---------------------------------+------------------------------------------
Changes (by Jafet):

  * version:  6.12.3 => 7.0.1
  * os:  MacOS X => Unknown/Multiple


Comment:

 I've encountered the same bug, but in the Windows console with GHC 7.0.1.

 To reproduce:
  1. Start {{{ghci}}} from cmd.exe (or Cygwin bash) in a console.
  2. Press {{{^C}}}.
  3. Hold down the return key.

 {{{
 C:\>ghci
 GHCi, version 7.0.1: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Loading package ffi-1.0 ... linking ... done.
 Prelude> ^C
 C:\>
 Prelude>
 C:\>
 Prelude>
 C:\>

 ... after a moment ...

 Prelude>
 C:\>
 Prelude>
 ghc.exe: panic! (the 'impossible' happened)
   (GHC version 7.0.1 for i386-unknown-mingw32):
         thread blocked indefinitely in an MVar operation

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug


 C:\>
 C:\>
 }}}

 After {{{^C}}}, GHC backgrounds itself from cmd.exe and subsequent input
 finds its way to the shell:

 {{{
 Prelude> ^C
 C:\>
 Prelude> input
 'input' is not recognized as an internal or external command,
 operable program or batch file.
 C:\>input
 'nput' is not recognized as an internal or external command,
 operable program or batch file.
 }}}

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
---------------------------------+------------------------------------------
    Reporter:  pturnbull         |        Owner:            
        Type:  bug               |       Status:  new      
    Priority:  normal            |    Milestone:  7.0.2    
   Component:  GHCi              |      Version:  7.0.1    
    Keywords:  MVar              |     Testcase:            
   Blockedby:                    |   Difficulty:            
          Os:  Unknown/Multiple  |     Blocking:            
Architecture:  x86               |      Failure:  GHCi crash
---------------------------------+------------------------------------------

Comment(by Jafet):

 Hi again. The previous message is incorrect; I didn't know that
 {{{ghci.exe}}} always uses a child {{{ghc.exe}}} process.

 What really happens on Windows is that {{{ghci.exe}}} is right away killed
 by {{{^C}}}, and the child {{{ghc.exe}}} doesn't realize that until a
 little later, so it goes into a panic. They also spawn some new threads
 before they die for some reason. I've attached a trace by Process Monitor,
 which records the syscalls made after {{{^C}}}.

 Someone with a Mac could {{{ktrace}}} to check that it's really the same
 bug.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
---------------------------------+------------------------------------------
    Reporter:  pturnbull         |        Owner:            
        Type:  bug               |       Status:  new      
    Priority:  normal            |    Milestone:  7.0.2    
   Component:  GHCi              |      Version:  7.0.1    
    Keywords:  MVar              |     Testcase:            
   Blockedby:                    |   Difficulty:            
          Os:  Unknown/Multiple  |     Blocking:            
Architecture:  x86               |      Failure:  GHCi crash
---------------------------------+------------------------------------------

Comment(by simonmar):

 The Control-C behaviour on Windows was also reported as #4531.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
-------------------------------+--------------------------------------------
    Reporter:  pturnbull       |        Owner:            
        Type:  bug             |       Status:  new      
    Priority:  normal          |    Milestone:  7.0.2    
   Component:  GHCi            |      Version:  6.12.3    
    Keywords:  MVar            |     Testcase:            
   Blockedby:                  |   Difficulty:            
          Os:  MacOS X         |     Blocking:            
Architecture:  x86_64 (amd64)  |      Failure:  GHCi crash
-------------------------------+--------------------------------------------
Changes (by paterno):

  * version:  7.0.1 => 6.12.3
  * os:  Unknown/Multiple => MacOS X
  * architecture:  x86 => x86_64 (amd64)


Comment:

 I can verify this problem appears in the Mac OS X release as well.
 My output is below.
 {{{
 bash-$ uname -a
 Darwin thomas 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:11:58 PST
 2010; root:xnu-1504.9.26~3/RELEASE_X86_64 x86_64

 bash-$ ghci
 GHCi, version 6.12.3: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Loading package ffi-1.0 ... linking ... done.
 Prelude>
 [1]+  Stopped                 ghci
 bash-$ fg
 ghci
 ^C^C

 Prelude>
 ghc: panic! (the 'impossible' happened)
   (GHC version 6.12.3 for i386-apple-darwin):
         thread blocked indefinitely in an MVar operation

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
-------------------------------+--------------------------------------------
    Reporter:  pturnbull       |        Owner:            
        Type:  bug             |       Status:  new      
    Priority:  normal          |    Milestone:  7.2.1    
   Component:  GHCi            |      Version:  6.12.3    
    Keywords:  MVar            |     Testcase:            
   Blockedby:                  |   Difficulty:            
          Os:  MacOS X         |     Blocking:            
Architecture:  x86_64 (amd64)  |      Failure:  GHCi crash
-------------------------------+--------------------------------------------
Changes (by altaic):

 * cc: william.knop.nospam@… (added)


Comment:

 I confirmed that this bug exists on my recent x86_64 HEAD build targeting
 OS X 10.6.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
-------------------------------+--------------------------------------------
    Reporter:  pturnbull       |        Owner:            
        Type:  bug             |       Status:  new      
    Priority:  normal          |    Milestone:  7.2.1    
   Component:  GHCi            |      Version:  6.12.3    
    Keywords:  MVar            |     Testcase:            
   Blockedby:                  |   Difficulty:            
          Os:  MacOS X         |     Blocking:            
Architecture:  x86_64 (amd64)  |      Failure:  GHCi crash
-------------------------------+--------------------------------------------

Comment(by Artyom.Kazak):

 I'm using Windows 7, GHC 7.0.2. I don't know is it the same bug…

 I was playing with my module called Helpers.Numeric located in file called
 Numeric.hs. As you can see, I compiled it using GHC and by mistake ran
 Numeric.hs instead of Numeric.exe, so I had GHCi in GHCi. Then I wanted to
 enter ':q', but entered just 'q', and the inner GHCi crashed.

 {{{
 *Helpers.Numeric Math.Root.Finder> :! ghc --make -O2 -main-is
 Halpers.Numeric Numeric.hs
 [2 of 2] Compiling Helpers.Numeric  ( Numeric.hs, Numeric.o )
 *Helpers.Numeric Math.Root.Finder> :! Numeric.hs
 GHCi, version 7.0.2: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Loading package ffi-1.0 ... linking ... done.
 Ok, modules loaded: Helpers.Numeric, Ratio'.
 Prelude Helpers.Numeric>
 Prelude Helpers.Numeric> q

 <interactive>:1:1: Not in scope: `q'
 Prelude Helpers.Numeric>
 ghc.exe: panic! (the 'impossible' happened)
   (GHC version 7.0.2 for i386-unknown-mingw32):
         thread blocked indefinitely in an MVar operation

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
-------------------------------+--------------------------------------------
    Reporter:  pturnbull       |        Owner:            
        Type:  bug             |       Status:  new      
    Priority:  normal          |    Milestone:  7.2.1    
   Component:  GHCi            |      Version:  6.12.3    
    Keywords:  MVar            |     Testcase:            
   Blockedby:                  |   Difficulty:            
          Os:  MacOS X         |     Blocking:            
Architecture:  x86_64 (amd64)  |      Failure:  GHCi crash
-------------------------------+--------------------------------------------
Changes (by fryguybob):

 * cc: fryguybob@… (added)


Comment:

 I've experienced the behavior from the last reporter on Windows with
 7.0.2.  For a while I've tried to get something repeatable to no avail.
 When it is happening it seems to happen fairly frequently.  Some days I
 never run into it.  I have never had it happen with HEAD which makes me
 suspect that #4531 fixed it.  Some things that have triggered it for me:

  * Typing `q` instead of `:q` (other things not in scope too).
  * Hitting tab then `y` to display all.
  * Pasting a long line.  When it fails in this case I have been pasting a
 `let` expression and initially just an `l` shows.  I hit backspace and
 paste again then it fails with the full line.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
-------------------------------+--------------------------------------------
    Reporter:  pturnbull       |        Owner:            
        Type:  bug             |       Status:  new      
    Priority:  normal          |    Milestone:  7.2.1    
   Component:  GHCi            |      Version:  6.12.3    
    Keywords:  MVar            |     Testcase:            
   Blockedby:                  |   Difficulty:            
          Os:  MacOS X         |     Blocking:            
Architecture:  x86_64 (amd64)  |      Failure:  GHCi crash
-------------------------------+--------------------------------------------

Comment(by simonmar):

 Also reported in #5191

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
-------------------------------+--------------------------------------------
    Reporter:  pturnbull       |        Owner:            
        Type:  bug             |       Status:  new      
    Priority:  normal          |    Milestone:  7.2.1    
   Component:  GHCi            |      Version:  6.12.3    
    Keywords:  MVar            |     Testcase:            
   Blockedby:                  |   Difficulty:            
          Os:  MacOS X         |     Blocking:            
Architecture:  x86_64 (amd64)  |      Failure:  GHCi crash
-------------------------------+--------------------------------------------
Changes (by modchan):

 * cc: malicious.wizard@… (added)


--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
-------------------------------+--------------------------------------------
    Reporter:  pturnbull       |        Owner:            
        Type:  bug             |       Status:  new      
    Priority:  normal          |    Milestone:  7.2.1    
   Component:  GHCi            |      Version:  6.12.3    
    Keywords:  MVar            |     Testcase:            
   Blockedby:                  |   Difficulty:            
          Os:  MacOS X         |     Blocking:            
Architecture:  x86_64 (amd64)  |      Failure:  GHCi crash
-------------------------------+--------------------------------------------

Comment(by modchan):

 Issued `fst ((1, 'a'),"foo")`, GHCi answered correctly, but then crashed
 out with "thread blocked indefinitely in an MVar operation".
 Unfortunately, I cannot reproduce this.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:15>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
-------------------------------+--------------------------------------------
    Reporter:  pturnbull       |        Owner:            
        Type:  bug             |       Status:  new      
    Priority:  high            |    Milestone:  7.2.1    
   Component:  GHCi            |      Version:  6.12.3    
    Keywords:  MVar            |     Testcase:            
   Blockedby:                  |   Difficulty:            
          Os:  MacOS X         |     Blocking:            
Architecture:  x86_64 (amd64)  |      Failure:  GHCi crash
-------------------------------+--------------------------------------------
Changes (by simonmar):

  * priority:  normal => high


Comment:

 More reports of this bug: #5191 #5368 (also #5029 and #4000, but these had
 no info)

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:16>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
-------------------------------+--------------------------------------------
    Reporter:  pturnbull       |        Owner:            
        Type:  bug             |       Status:  new      
    Priority:  high            |    Milestone:  7.4.1    
   Component:  GHCi            |      Version:  6.12.3    
    Keywords:  MVar            |     Testcase:            
   Blockedby:                  |   Difficulty:            
          Os:  MacOS X         |     Blocking:            
Architecture:  x86_64 (amd64)  |      Failure:  GHCi crash
-------------------------------+--------------------------------------------
Changes (by igloo):

  * milestone:  7.2.1 => 7.4.1


--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:17>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
-------------------------------+--------------------------------------------
    Reporter:  pturnbull       |        Owner:  igloo    
        Type:  bug             |       Status:  new      
    Priority:  high            |    Milestone:  7.4.1    
   Component:  GHCi            |      Version:  6.12.3    
    Keywords:  MVar            |     Testcase:            
   Blockedby:                  |   Difficulty:            
          Os:  MacOS X         |     Blocking:            
Architecture:  x86_64 (amd64)  |      Failure:  GHCi crash
-------------------------------+--------------------------------------------
Changes (by igloo):

  * owner:  => igloo


--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:18>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
-------------------------------+--------------------------------------------
    Reporter:  pturnbull       |        Owner:  igloo    
        Type:  bug             |       Status:  new      
    Priority:  high            |    Milestone:  7.4.1    
   Component:  GHCi            |      Version:  6.12.3    
    Keywords:  MVar            |     Testcase:            
   Blockedby:                  |   Difficulty:            
          Os:  MacOS X         |     Blocking:            
Architecture:  x86_64 (amd64)  |      Failure:  GHCi crash
-------------------------------+--------------------------------------------

Comment(by igloo):

 With `z.hs`:
 {{{
 import Control.Concurrent
 import Control.Exception
 import Prelude hiding (catch)
 import System.IO

 main :: IO ()
 main = do mv <- newEmptyMVar
           tid <- forkIO $ otherThread mv
           takeMVar mv
               `catch` \e ->
               do putStrLn ("Got exception: " ++ show (e :: SomeException))
                  putStrLn "Killing thread"
                  killThread tid
                  putStrLn "Killed thread"

 otherThread :: MVar () -> IO ()
 otherThread mv = do putStrLn "Waiting for input"
                     _ <- hWaitForInput stdin (-1)
                     putStrLn "There's some input"
                     putMVar mv ()
 }}}
 if we compile with HEAD on OS X (x86 or x86_64) with the threaded RTS:
 {{{
 ghc --make z -threaded
 }}}
 then run it, `^Z` it, `fg` it, then `^C` it, then the `killThread` blocks:
 {{{
 $ ./z
 Waiting for input
 ^Z
 [1]+  Stopped                 ./z
 212:examples ian$ fg
 ./z
 ^CGot exception: user interrupt
 Killing thread
 }}}
 Another `^C` silently terminates the program.

 It doesn't happen if:
  * We don't do the `^Z`/`fg`
  * We don't use the threaded RTS
  * It is run on Linux

 So now the question is, why does it happen and how do we fix it?

 (I believe Haskeline doing something like the above, mixed in with using
 an MVar, is the underlying case of the GHCi bug)

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:19>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
-------------------------------+--------------------------------------------
    Reporter:  pturnbull       |        Owner:  igloo    
        Type:  bug             |       Status:  new      
    Priority:  high            |    Milestone:  7.4.1    
   Component:  GHCi            |      Version:  6.12.3    
    Keywords:  MVar            |     Testcase:            
   Blockedby:                  |   Difficulty:            
          Os:  MacOS X         |     Blocking:            
Architecture:  x86_64 (amd64)  |      Failure:  GHCi crash
-------------------------------+--------------------------------------------

Comment(by igloo):

 I have a hunch the problem will be around `rts/posix/Signals.c`
 `sigtstp_handler` and `set_sigtstp_action`.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:20>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #4245: ghci panic: thread blocked indefinitely in an MVar operation

GHC
In reply to this post by GHC
#4245: ghci panic: thread blocked indefinitely in an MVar operation
-------------------------------+--------------------------------------------
    Reporter:  pturnbull       |        Owner:  igloo    
        Type:  bug             |       Status:  new      
    Priority:  high            |    Milestone:  7.4.1    
   Component:  GHCi            |      Version:  6.12.3    
    Keywords:  MVar            |     Testcase:            
   Blockedby:                  |   Difficulty:            
          Os:  MacOS X         |     Blocking:            
Architecture:  x86_64 (amd64)  |      Failure:  GHCi crash
-------------------------------+--------------------------------------------

Comment(by simonmar):

 See also #5565

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4245#comment:21>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
12
Loading...