[GHC] #7815: STM fails to validate read.

GHC cvs-ghc at haskell.org
Mon Apr 8 16:13:48 CEST 2013


#7815: STM fails to validate read.
-------------------------------+--------------------------------------------
    Reporter:  fryguybob       |       Owner:                             
        Type:  bug             |      Status:  new                        
    Priority:  normal          |   Milestone:                             
   Component:  Runtime System  |     Version:  7.7                        
    Keywords:  STM             |          Os:  Unknown/Multiple           
Architecture:  x86             |     Failure:  Incorrect result at runtime
  Difficulty:  Unknown         |    Testcase:                             
   Blockedby:                  |    Blocking:                             
     Related:                  |  
-------------------------------+--------------------------------------------
Changes (by simonpj):

  * difficulty:  => Unknown


Comment:

 Tim Harris writes: Yes, this looks like a genuine bug -- surprised it
 could have lurked
 here this long!

 I think the suggested fix is right -- i.e., to replace:
 {{{
         if (s -> num_updates != e -> num_updates) {
             // ||s -> current_value != e -> expected_value) {
 }}}
 with:
 {{{
         // Check for concurrent updates (note: current_value may refer to
 a TRec
         // at this point if this TVar is currently locked for making an
 update).
         if (s -> current_value != e -> expected_value ||
            s -> num_updates != e -> num_updates) {
 }}}
 Could someone execute on this?  By which I mean:

  * Make the change
  * Add a bit more explanation than Tim does here; perhaps a `Note [blah]`
 that explains the subtlety, and a reference to this ticket for more
 details.
  * Add a regression test, if possible, that
  * Check that it all validates.

 Thanks!

 Amazing job, `fryguybob`, in identifying the problem so precisely.


 Simon

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



More information about the ghc-tickets mailing list