[Haskell-cafe] runghc dies silently when given large numbers of arguments

Gareth Smith gds at doc.ic.ac.uk
Fri Jun 7 14:16:00 CEST 2013


Hi all,

The other day, I wrote the following program in /tmp/test.hs

--8<---------------cut here---------------start------------->8---
main = error "An Error message"
--8<---------------cut here---------------end--------------->8---

Then I ran the following:

,----
| gds at lithium:/tmp$ runghc ./test.hs `seq 1 100000`
| gds at lithium:/tmp$ ghc -o test test.hs
| gds at lithium:/tmp$ ./test `seq 1 100000`
| test: An Error message
| gds at lithium:/tmp$
`----

Notice that when I use runghc, my main function doesn't appear to run at
all. But when I run the compiled program, my main function does seem to
run, and produce the error message I expected.

It seems to me like runghc can't cope with that large a number of
arguments or size of argument string, or similar. That seems entirely
reasonable, but if so, then might it be a good idea to have an error
message when we accidentally hit that limit?

I'm using ghc 7.6.2 on Ubuntu 13.04.

Thanks!

Gareth.



More information about the Haskell-Cafe mailing list