[GHC] #10731: System.IO.openTempFile is not thread safe on Windows

GHC ghc-devs at haskell.org
Tue Jan 2 23:56:17 UTC 2018


#10731: System.IO.openTempFile is not thread safe on Windows
-------------------------------------+-------------------------------------
        Reporter:  NeilMitchell      |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  libraries/base    |              Version:  7.10.1
      Resolution:                    |             Keywords:
Operating System:  Windows           |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Runtime crash     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4278
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"46287af0911f7cb446c62850630f85af567ac512/ghc"
 46287af0/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="46287af0911f7cb446c62850630f85af567ac512"
 Make System.IO.openTempFile thread-safe on Windows

 This calls out to the Win32 API `GetTempFileName` to generate
 a temporary file. Using `uUnique = 0` guarantees that the file
 we get back is unique and the file is "reserved" by creating it.

 Test Plan:
 ./validate

 I can't think of any sensible tests that shouldn't run for a while
 to verify. So the example in #10731 was ran for a while and no
 collisions in new code

 Reviewers: hvr, bgamari, erikd

 Reviewed By: bgamari

 Subscribers: RyanGlScott, rwbarton, thomie, carter

 GHC Trac Issues: #10731

 Differential Revision: https://phabricator.haskell.org/D4278
 }}}

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


More information about the ghc-tickets mailing list