but when i use -Ct (which i thought caught stack problems in compiling) [...]
I have no idea what your problem might be* but according to the manual (the User Reference actually):
-Ct Generate stack checking code. If your program performs a faulty stack operation, a run-rime error will be generated.
*Since you're getting a Stack overflow, maybe you need to use option -Cs?
-Csxxx Set stack size to xxx.
But this is just a shot in the dark, just looking for stack related options
