Quantcast

[GHC] #5943: Code without MVar: "thread blocked indefinitely in an MVar operation"

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

[GHC] #5943: Code without MVar: "thread blocked indefinitely in an MVar operation"

GHC
#5943: Code without MVar: "thread blocked indefinitely in an MVar operation"
--------------------------+-------------------------------------------------
 Reporter:  cobb          |          Owner:                  
     Type:  bug           |         Status:  new            
 Priority:  normal        |      Component:  Compiler        
  Version:  7.4.1         |       Keywords:                  
       Os:  Linux         |   Architecture:  Unknown/Multiple
  Failure:  None/Unknown  |       Testcase:                  
Blockedby:                |       Blocking:                  
  Related:                |  
--------------------------+-------------------------------------------------
 The attached code produces the above message when compiled with
 optimisations on - even -O1 is enough. The same happens on both 32 and
 64-bit architectures.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5943>
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

Re: [GHC] #5943: Code without MVar: "thread blocked indefinitely in an MVar operation"

GHC
#5943: Code without MVar: "thread blocked indefinitely in an MVar operation"
---------------------------------+------------------------------------------
    Reporter:  cobb              |       Owner:  simonmar    
        Type:  bug               |      Status:  new        
    Priority:  high              |   Milestone:  7.4.2      
   Component:  Compiler          |     Version:  7.4.1      
    Keywords:                    |          Os:  Linux      
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
  Difficulty:  Unknown           |    Testcase:              
   Blockedby:                    |    Blocking:              
     Related:                    |  
---------------------------------+------------------------------------------
Changes (by simonmar):

  * owner:  => simonmar
  * difficulty:  => Unknown
  * priority:  normal => high
  * milestone:  => 7.4.2


--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5943#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

Re: [GHC] #5943: Code without MVar: "thread blocked indefinitely in an MVar operation"

GHC
In reply to this post by GHC
#5943: Code without MVar: "thread blocked indefinitely in an MVar operation"
---------------------------------+------------------------------------------
    Reporter:  cobb              |       Owner:  simonmar    
        Type:  bug               |      Status:  merge      
    Priority:  high              |   Milestone:  7.4.2      
   Component:  Compiler          |     Version:  7.4.1      
    Keywords:                    |          Os:  Linux      
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
  Difficulty:  Unknown           |    Testcase:              
   Blockedby:                    |    Blocking:              
     Related:                    |  
---------------------------------+------------------------------------------
Changes (by simonmar):

  * status:  new => merge


Comment:

 {{{
 commit 9ab1f46d601e0f4c4582a1a77d9b4c26bf166daa
 Author: Simon Marlow <[hidden email]>
 Date:   Fri Mar 23 12:28:18 2012 +0000

     change unsafeDupableInterleaveIO from INLINE to NOINLINE (#5943)

     See the comment for details.
 }}}

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5943#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

Re: [GHC] #5943: Code without MVar: "thread blocked indefinitely in an MVar operation"

GHC
In reply to this post by GHC
#5943: Code without MVar: "thread blocked indefinitely in an MVar operation"
---------------------------+------------------------------------------------
  Reporter:  cobb          |          Owner:  simonmar        
      Type:  bug           |         Status:  closed          
  Priority:  high          |      Milestone:  7.4.2          
 Component:  Compiler      |        Version:  7.4.1          
Resolution:  fixed         |       Keywords:                  
        Os:  Linux         |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown  |     Difficulty:  Unknown        
  Testcase:                |      Blockedby:                  
  Blocking:                |        Related:                  
---------------------------+------------------------------------------------
Changes (by pcapriotti):

  * status:  merge => closed
  * resolution:  => fixed


Comment:

 Merged as b5ae8e3f64218f45c845c4aac2d05d967cfd6ba6.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5943#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

Re: [GHC] #5943: Code without MVar: "thread blocked indefinitely in an MVar operation"

GHC
In reply to this post by GHC
#5943: Code without MVar: "thread blocked indefinitely in an MVar operation"
---------------------------+------------------------------------------------
  Reporter:  cobb          |          Owner:  simonmar        
      Type:  bug           |         Status:  closed          
  Priority:  high          |      Milestone:  7.4.2          
 Component:  Compiler      |        Version:  7.4.1          
Resolution:  fixed         |       Keywords:                  
        Os:  Linux         |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown  |     Difficulty:  Unknown        
  Testcase:                |      Blockedby:                  
  Blocking:                |        Related:                  
---------------------------+------------------------------------------------

Comment(by simonpj):

 Comments from the commit
 {{{
 -- We used to believe that INLINE on unsafeInterleaveIO was safe,
 -- because the state from this IO thread is passed explicitly to the
 -- interleaved IO, so it cannot be floated out and shared.
 --
 -- HOWEVER, if the compiler figures out that r is used strictly here,
 -- then it will eliminate the thunk and the side effects in m will no
 -- longer be shared in the way the programmer was probably expecting,
 -- but can be performed many times.  In #5943, this broke our
 -- definition of fixIO, which contains
 --
 --    ans <- unsafeInterleaveIO (takeMVar m)
 --
 -- after inlining, we lose the sharing of the takeMVar, so the second
 -- time 'ans' was demanded we got a deadlock.  We could fix this with
 -- a readMVar, but it seems wrong for unsafeInterleaveIO to sometimes
 -- share and sometimes not (plus it probably breaks the noDuplicate).
 -- So now, we do not inline unsafeDupableInterleaveIO.
 }}}
 See also #5859.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5943#comment:4>
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
Loading...