[GHC] #7695: Hang when locale-archive and gconv-modules are not there

GHC ghc-devs at haskell.org
Fri Jul 10 17:54:55 UTC 2015


#7695: Hang when locale-archive and gconv-modules are not there
-------------------------------------+-------------------------------------
        Reporter:  hpd               |                   Owner:
            Type:  bug               |                  Status:  closed
        Priority:  highest           |               Milestone:  7.10.2
       Component:  None              |                 Version:  7.8.1
      Resolution:  fixed             |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Runtime crash     |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:  #8977, #10298     |                Blocking:
                                     |  Differential Revisions:  Phab:D898
-------------------------------------+-------------------------------------

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

 In [changeset:"d69dfba4e27c4ec33459906fd87c9a56a371f510/ghc"]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="d69dfba4e27c4ec33459906fd87c9a56a371f510"
 Fix self-contained handling of ASCII encoding

 D898 was primarily intended to fix hangs in the event that iconv was
 unavailable (namely #10298 and #7695). In addition to this fix, it also
 introduced self-contained handling of ANSI terminals to allow compiled
 executables to run in minimal environments lacking iconv.

 However, the behavior that the patch introduced is highly suspicious.
 Specifically, it gives the user a UTF-8 encoding even if they requested
 ASCII.

 This has the potential to break quite a lot of code. At very least it
 breaks GHC's Unicode terminal detection logic, which attempts to catch
 an invalid character when encoding a pair of smart-quotes. Of course,
 this exception will never be thrown if a UTF-8 encoder is used.

 Here we use the `char8` encoding to handle requests for ASCII encodings
 in the event that we find iconv to be non-functional.

 Fixes #10623.

 Test Plan: Validate with T8959a

 Reviewers: rwbarton, hvr, austin, hsyl20

 Subscribers: thomie

 Differential Revision: https://phabricator.haskell.org/D1059

 GHC Trac Issues: #10623
 }}}

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


More information about the ghc-tickets mailing list