Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#8977 closed bug (duplicate)

GHC infinite loop on Solaris

Reported by: kgardas Owned by:
Priority: normal Milestone: 7.8.3
Component: Compiler Version: 7.8.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #7695 Differential Rev(s):
Wiki Page:

Description

Hello, sometimes on Solaris ghc gets into infinite loop while trying to print something. E.g. ghc --version or ghc --info are good examples. This also happens for example while trying to build another ghc by already installed ghc. The reason for loop is simple: ghc is using libiconv for printing and libiconv is using its own libraries/binary tables. The problem arise when libiconv is not able to find the appropriate library/table file, then it tries to print error message (or GHC itself) which results in calling libiconv for printing which goes to search for appropriate library/table file and loop is closed. Please note that library/table file is different for different LANG settings. That also means that if you are able to invoke ghc --version on command line, still your ./configure of a new ghc may stuck on checking ghc version since configure sets LANG=C while on command line you may have LANG=en_US.UTF-8. Running ghc --version in truss shows this issue nicely as:

/1:     munmap(0xFF210000, 8790)                        = 0
/1:     access("/usr/lib/iconv/geniconvtbl/binarytables/646%UTF-32BE.bt", R_OK) Err#2 ENOENT
/1:     access("/usr/lib/iconv/646%UTF-32BE.so", R_OK)  Err#2 ENOENT
/1:     lwp_unpark(2)                                   = 0
/2:     lwp_park(0x00000000, 0)                         = 0
/2:     clock_gettime(4, 0xFF0D9E68)                    = 0
/2:     lwp_unpark(1)                                   = 0
/1:     lwp_park(0x00000000, 0)                         = 0
/1:     access("/usr/lib/iconv/geniconvtbl/binarytables/646%UTF-32BE.bt", R_OK) Err#2 ENOENT
/1:     access("/usr/lib/iconv/646%UTF-32BE.so", R_OK)  Err#2 ENOENT
/1:     open("/usr/lib/iconv/alias", O_RDONLY)          = 7
/1:     fstat64(7, 0xFFBFD388)                          = 0
/1:     fstat64(7, 0xFFBFD5C8)                          = 0
/1:     mmap(0x00000000, 8790, PROT_READ, MAP_SHARED, 7, 0) = 0xFF210000
/1:     close(7)                                        = 0
/1:     munmap(0xFF210000, 8790)                        = 0
/1:     access("/usr/lib/iconv/geniconvtbl/binarytables/646%UTF-32BE.bt", R_OK) Err#2 ENOENT
/1:     access("/usr/lib/iconv/646%UTF-32BE.so", R_OK)  Err#2 ENOENT
/1:     access("/usr/lib/iconv/geniconvtbl/binarytables/646%UTF-32BE.bt", R_OK) Err#2 ENOENT
/1:     access("/usr/lib/iconv/646%UTF-32BE.so", R_OK)  Err#2 ENOENT
/1:     open("/usr/lib/iconv/alias", O_RDONLY)          = 7
/1:     fstat64(7, 0xFFBFD388)                          = 0
/1:     fstat64(7, 0xFFBFD5C8)                          = 0

So, the solution on Solaris is simple. Install appropriate libiconv files. Usually if you are hit by this issue, then at least on Solaris 11 you are missing unicode-core package and this may be installed by:

# pkg install unicode-core

Change History (4)

comment:1 Changed 5 years ago by kgardas

Resolution: wontfix
Status: newclosed

I'm closing since this was merely for documentation purposes. Hopefully google find it.

comment:2 Changed 5 years ago by trommler

Resolution: wontfix
Status: closednew

This looks like a duplicate of #7695. I am reopening and closing as duplicate.

comment:3 Changed 5 years ago by trommler

Milestone: 7.8.2
Operating System: SolarisUnknown/Multiple
Resolution: duplicate
Status: newclosed

comment:4 Changed 5 years ago by thoughtpolice

Milestone: 7.8.27.8.3
Note: See TracTickets for help on using tickets.