Skip to content

Stack space overflow when using -N2 and not with -N1

I get a stack space overflow error when using -N2 (or -N4), but the program works with -N1. The program is my test and benchmarking program for Etage-Graph package.

So this works normally: ./etage-graph-test -s 10 +RTS -N1

Generating a random graph of size 10.
Graph contains 10 nodes.
Dijkstra search time for shortest paths: 0.000875s
Etage search time for shortest paths: 0.010341s (0.5s timeout)
Found 100.00 % shortest paths.
etage-graph-test: DissolvingException "()"

But this does not: ./etage-graph-test -s 10 +RTS -N2

Generating a random graph of size 10.
Graph contains 10 nodes.
Stack space overflow: current size 8388608 bytes.
Use `+RTS -Ksize -RTS' to increase it.

The most interesting thing is that this happens only for graph sizes (-s parameter) between (including) 1-19. For larger sizes it works without problems. What means that the problem is this line:

map spFromSource (nodes graph) `using` parListChunk (noNodes graph `div` (numCapabilities * 10)) rdeepseq

Yes. So also /etage-graph-test -s 5 +RTS -N1 fails. OK, so parListChunk with 0 as an argument is not well defined, or it is defined to diverge. Is this a wanted feature or it is a bug?

Trac metadata
Trac field Value
Version 7.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC mmitar@gmail.com
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information