Re: Mysterious function timer_settime

2011-10-06 Thread Simon Marlow

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@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Mysterious function timer_settime

2011-09-28 Thread Volker Wysk
Hi

Here's an addition to my Mysterious function timer_settime message:

This test program:

import HsShellScript

main =
   call (exec /bin/echo [bla bla]
 -|- exec /bin/cat [])

produces this output:

test: test: stderr: hPutStr: illegal operation (handle is 
closed)stderr:
hPutStr: illegal operation (handle is closed)

test: timer_settimetest: : Invalid argument
timer_settime: Invalid argument
test: Exited (ExitFailure 1)

I'm almost sure that the two examples work fine in the last working version of 
HsShellScript. They use GHC-6.11. (I can't verify this, since I have 
GHC-7.0.4 version installed. The old GHC version isn't available as a Debian 
package any longer.)

So there appears to be a downwards-incompatibilty in the GHC libraries. I'm 
fiddling with the internals quite a bit, in order to get forks, pipes and 
redirects etc. working.

Any hint would be appreciated.

Volker

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Mysterious function timer_settime

2011-09-28 Thread Volker Wysk
On Wednesday 28 September 2011 14:27:13 Volker Wysk wrote:
 I'm almost sure that the two examples work fine in the last working version
 of HsShellScript. They use GHC-6.11. 

That is, they work fine when compiled with GHC-6.11.
Sorry.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users