Hey everyone,<br><div class="gmail_quote">
<br>
I'm looking for help with a seg fault that takes out both my ghci and
darcs as well as anything that uses haskeline. A bug on the haskeline
trac hasn't gotten any response so I figured I might as well figure this
out myself and get ghci up and running again.<br>
<br>
Using the test program below I get the same segmentation fault, so I run
it using gdb and get the following,<br>
<br>
Program received signal SIGSEGV, Segmentation fault.<br>
0x000000000053fdce in base_ForeignziCziString_zdwa_info ()<br>
<br>
My knowledge of this is very limited from here on out so here is what I
was able to get together.<br>
<br>
On the 20th call of base_ForeignziCziString_zdwa_info <br>
r14 is 0 so<br>
<br>
0x000000000053fdce <+22>: movsbq (%r14),%rax<br>
<br>
produces the segfault.<br>
>From what I understand this is happening in the Foreign.C.String module
but thats as much as I know. <br>
Anyone have advice on where to go next? <br>
<br>
System info:<br>
Distribution: gentoo amd64<br>
Ghc version: currently 6.12.1 (though the segfault happends on any of
the ones with haskeline)<br>
Haskeline version: 0.6.2.2<br>
<br>
Here is the test program <br>
<br>
----------------------------------------------------------------------------------------------------<br>
module Main where<br>
<br>
import System.Console.Haskeline<br>
import System.Environment<br>
<br>
{--<br>
Testing the line-input functions and their interaction with ctrl-c
signals.<br>
<br>
Usage:<br>
./Test (line input)<br>
./Test chars (character input)<br>
--}<br>
<br>
mySettings :: Settings IO<br>
mySettings = defaultSettings {historyFile = Just "myhist"}<br>
<br>
main :: IO ()<br>
main = do<br>
args <- getArgs<br>
let inputFunc = case args of<br>
["chars"] -> fmap (fmap (\c -> [c])) .
getInputChar<br>
_ -> getInputLine<br>
runInputT mySettings $ withInterrupt $ loop inputFunc 0<br>
where<br>
loop inputFunc n = do<br>
minput <- handleInterrupt (return (Just "Caught
interrupted"))<br>
$ inputFunc (show n ++ ":")<br>
case minput of<br>
Nothing -> return ()<br>
Just "quit" -> return ()<br>
Just "q" -> return ()<br>
Just s -> do<br>
outputStrLn ("line " ++ show n ++ ":" ++ s)<br>
loop inputFunc (n+1)<br>
<br>
------------------------------------------------------------------------------------------------------------------------
<br><br>Syfran<br>
</div>