#4993: getDirectoryContents goes into an infinite loop
---------------------------+------------------------------------------------
 Reporter:  bos            |          Owner:                     
     Type:  bug            |         Status:  closed             
 Priority:  normal         |      Component:  libraries/directory
  Version:  7.0.1          |     Resolution:  invalid            
 Keywords:                 |       Testcase:                     
Blockedby:                 |             Os:  Linux              
 Blocking:                 |   Architecture:  x86                
  Failure:  Runtime crash  |  
---------------------------+------------------------------------------------
Changes (by bos):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 I've got it figured out. It's not a GHC bug, and it's quite subtle.

 So. On a 32-bit system, glibc relies on being able to do tricks like
 %gs:-1234 to get negative offsets from the TLS (thread-local storage)
 base. But in fact that's really gsbase + (big positive number), and glibc
 relies on wraparound to get the resulting negative value. But the CPU only
 does that iff the segment limit is a full 4G.

 Under Xen, segments are clipped to protect the hypervisor, so we need a
 version of glibc which spends a couple more instructions to compute the
 negative offset without relying on segment wrapping.

 This is done via an {{{ld.so.conf}}} entry:

 {{{
 hwcap 1 nosegneg
 }}}

 The above directs {{{ldconfig}}} and {{{ld.so}}} to use the Xen-friendly
 version of glibc.

 So this isn't really a GHC bug at all, but perhaps a boxgrinder bug. In
 any case, the symptom is appearing in GHC :-(

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to