#5386: GHCi crashes with SIGFPE when using double-conversion package
---------------------------------+------------------------------------------
    Reporter:  bos               |       Owner:            
        Type:  bug               |      Status:  new       
    Priority:  normal            |   Component:  GHCi      
     Version:  7.0.4             |    Keywords:            
    Testcase:                    |   Blockedby:            
          Os:  Unknown/Multiple  |    Blocking:            
Architecture:  Unknown/Multiple  |     Failure:  GHCi crash
---------------------------------+------------------------------------------

Comment(by bos):

 I've narrowed the source of the bug down.

 The crash occurs on [https://github.com/mailrank/double-
 conversion/blob/master/double-conversion/src/cached-powers.cc#L153 line
 153 of cached-powers.cc] in the double-conversion source, where a divide
 by zero occurs because `kDecimalExponentDistance` is zero.

 Now it's clear from [https://github.com/mailrank/double-
 conversion/blob/master/double-conversion/src/cached-powers.cc#L137 the
 definition of that variable] that it should not be zero; its value should
 be 8.

 However, on inspecting the symbols in the compiled source file, I see that
 the symbol for `kDecimalExponentDistance` is actually in the BSS section
 of the object file. It looks like its value is supposed to be computed at
 startup time by an initializer, which I assume is the first symbol in the
 list below:

 {{{
 00000000 t
 
_GLOBAL__sub_I__ZN17double_conversion16PowersOfTenCache24kDecimalExponentDistanceE
 00000000 B double_conversion::PowersOfTenCache::kMaxDecimalExponent
 00000004 B double_conversion::PowersOfTenCache::kMinDecimalExponent
 00000008 B double_conversion::PowersOfTenCache::kDecimalExponentDistance
 }}}

 This is all a roundabout way of saying that the crash seems to be due to
 GHCi not calling initializers.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to