
#10298: Infinite loop when shared libraries are unavailable -------------------------------------+------------------------------------- Reporter: snoyberg | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Runtime crash | (amd64) Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): I was able to reproduce the loop, but rather than copying `/usr/lib/x86_64 -linux-gnu/gconv/` into the chroot, I tried copying in `/usr/lib/locale/` instead, and that was also sufficient to let the program run normally. It's to be expected that a program built with GHC needs those locale files, since String IO is locale-aware. Of course an infinite loop is not so easy to debug, and it'd be nice to have an error message. In fact the error status from `iconv_open` is being correctly checked, and converted to an exception, which is then caught and displayed by the default exception handler. The trouble is that the display of exceptions is also locale-aware... Curiously even an empty `main = return ()` triggers this behavior with 7.8.4, but it runs successfully on 7.10.1. I couldn't figure out why, perhaps some change in the IO manager? I don't have any good ideas about how to improve this situation. Maybe try to set up the locale for IO at some point, catch the exception if it fails and `barf()` rather than using regular IO to display the exception. But when exactly? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10298#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler