Mysterious function timer_settime

Simon Marlow marlowsd at gmail.com
Thu Oct 6 14:37:58 CEST 2011


On 28/09/2011 11:58, Volker Wysk wrote:
> Hi!
>
> Im porting my HsShellScript library to GHC-7.0.4 and to Cabal/Hackage.
>
> It builds and installs fine:
>
> ~/src/hsshellscript-3.0.0 $ cabal clean
> 	cleaning...
>
> ~/src/hsshellscript-3.0.0 $ cabal configure
> 	Resolving dependencies...
> 	Configuring hsshellscript-3.0.0...
>
> ~/src/hsshellscript-3.0.0 $ cabal build
> 	Preprocessing library hsshellscript-3.0.0...
> 	Building hsshellscript-3.0.0...
> 	(...)
> 	Registering hsshellscript-3.0.0...
>
> ~/src/hsshellscript-3.0.0 $ cabal haddock
> 	Running Haddock for hsshellscript-3.0.0...
> 	Preprocessing library hsshellscript-3.0.0...
> 	(...)
> 	Documentation created: dist/doc/html/hsshellscript/index.html
>
> ~/src/hsshellscript-3.0.0 $ cabal install
> 	Resolving dependencies...
> 	Configuring hsshellscript-3.0.0...
> 	Preprocessing library hsshellscript-3.0.0...
> 	Building hsshellscript-3.0.0...
> 	Registering hsshellscript-3.0.0...
> 	Installing library in /home/v/.cabal/lib/hsshellscript-3.0.0/ghc-7.0.4
> 	Registering hsshellscript-3.0.0...
>
> I've made a fine little test program src/test.hs:
>
> 	import HsShellScript
>
> 	main =
> 	  (outm "3\n1\n2\n")
> 	  -|- exec "/usr/bin/sort" ["-n"]
>
> But this doesn't work. It generates a mysterious error message:
>
> ~/src/hsshellscript-3.0.0 $ src/test
> 	test:<stderr>: hPutStr: illegal operation (handle is closed)
> 	test: timer_settime: Invalid argument

timer_settime is used by the RTS, see the file rts/posix/Itimer.c.  I 
don't know why it's being called with an invalid argument in your 
program - maybe you can compile with -debug and use gdb to find out?

Cheers,
	Simon


>
> "timer_settime" occurs only in the generated test binary. It doesn't occur
> anywhere in the library or in "/usr/bin/sort":
>
> ~/src/hsshellscript-3.0.0 $ find -type f -print0|xargs -0 egrep timer_settime
> 	Übereinstimmungen in Binärdatei ./src/test.
> ~/src/hsshellscript-3.0.0 $ egrep timer_settime /usr/bin/sort
> 	(no output)
>
> It looks like GHC has introduced this mysterous call of timer_settime. What
> does that mean?
>
>
> Thanks for any help,
> Volker W.
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users




More information about the Glasgow-haskell-users mailing list