#2972: ppc ghci segfaults at startup
------------------------+---------------------------------------------------
    Reporter:  cemeyer  |        Owner:  erikd     
        Type:  bug      |       Status:  new       
    Priority:  normal   |    Milestone:  _|_       
   Component:  GHCi     |      Version:  7.0.3     
    Keywords:           |     Testcase:            
   Blockedby:           |   Difficulty:  Unknown   
          Os:  Linux    |     Blocking:            
Architecture:  powerpc  |      Failure:  GHCi crash
------------------------+---------------------------------------------------
Changes (by erikd):

  * owner:  => erikd
  * failure:  None/Unknown => GHCi crash


Comment:

 If I compile ghc from git, but with the vector and dph packages absent
 from the tree, I can get a ghci that segfaults.

 I've been slowly debugging this in the little spare time I have and have
 got to the stage where I found that it was segfault in function
 `turnOffBuffering` (ghc/GhciMonad.hs) which looks like:

 {{{
 turnOffBuffering :: IO ()
 turnOffBuffering
  = do hdls <- mapM getHandle [stdin_ptr,stdout_ptr,stderr_ptr]
       mapM_ (\h -> hSetBuffering h NoBuffering) hdls
 }}}

 Funnily enough, if replace the code in that function with just a `return
 ()` ghci no longer segfaults during startup and I actually get the ghci
 `Prelude >` prompt.

 At that prompt, some commands like the `:t` command work while any that
 require actual computation result in a segfault again. Eg running under
 gdb:

 {{{
 Prelude> :t 1 + 1
 1 + 1 :: Num a => a
 Prelude> 1 + 1

 Program received signal SIGSEGV, Segmentation fault.
 [Switching to Thread 0xf71ff490 (LWP 5458)]
 0xf51cad7c in ?? ()
 }}}

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