#4914: FPU initialization required again
---------------------------------+------------------------------------------
    Reporter:  aruiz             |        Owner:                             
        Type:  bug               |       Status:  new                        
    Priority:  normal            |    Milestone:  7.2.1                      
   Component:  Compiler (NCG)    |      Version:  7.0.1                      
    Keywords:                    |     Testcase:                             
   Blockedby:                    |   Difficulty:                             
          Os:  Unknown/Multiple  |     Blocking:                             
Architecture:  x86               |      Failure:  Incorrect result at runtime
---------------------------------+------------------------------------------

Comment(by aruiz):

 I have done as suggested and I think that I have found a small test case
 that only requires `QuickCheck`.

 I have defined `OnExitHook()` in file `hook.c` to check the FPU status.
 The test case is in `bug.hs`.

 {{{
 $ gcc -c hook.c
 $ ghc --make bug.hs hook.o -fforce-recomp
 [1 of 1] Compiling Main             ( bug.hs, bug.o )
 Linking bug ...
 $ ./bug
 True
 140
 +++ OK, passed 100 tests.
 OnExitHook: NONEMPTY FPU Stack (7)
 }}}

 The stack seems to be ok after normal operations, but using functions in
 `QuickCheck` we get the problem. This can be observed if we comment out
 line 8 in `bug.hs`:

 {{{
 $ ghc --make bug.hs hook.o -fforce-recomp
 [1 of 1] Compiling Main             ( bug.hs, bug.o )
 Linking bug ...
 $ ./bug
 True
 140
 OnExitHook: FPU STACK OK
 }}}

 I know very little assembler, so please verify that this makes sense. I
 have some confidence in the stack check used in the hook for the following
 reason: in the hmatrix tests which expose the problem I have inserted the
 check at the beginning of the foreign calls and only call finit if the
 stack is non-empty. Doing this all errors disappear.

 Please let me know if you need more info.

 I have used `ghc-7.0.2-i386-unknown-linux.tar.bz2` and
 `QuickCheck-2.4.0.1`.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4914#comment:4>
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