------- Comment #11 from manfred99 at gmx dot ch 2010-01-16 18:35 ------- With test case 2, I get
> ./writebug2 > writebug2.txt Interation 1 : 25 Interation 2 : 32 Interation 3 : 39 Interation 4 : 46 Interation 5 : 53 Interation 6 : 60 Interation 7 : 67 Interation 8 : 74 Interation 9 : 81 Interation 10 : 88 Interation 11 : 95 Interation 12 : 102 Interation 13 : 109 Interation 14 : 116 Interation 15 : 123 Interation 16 : 130 Interation 17 : 137 Interation 18 : 144 Interation 19 : 151 Interation 20 : 158 Interation 21 : 165 Interation 22 : 172 Interation 23 : 179 Interation 24 : 186 Interation 25 : 193 Interation 26 : 200 Interation 27 : 207 Interation 28 : 214 Interation 29 : 221 Interation 30 : 228 Segmentation fault It stops at length 228 after the 5th iteration of the inner loop. I tried 32bit and 64bit, no difference. Also, varying values of "ulimit -s" and "-fmax-stack-var-size" made no difference. Maybe your FORMAT_CACHE_STRING_LIMIT is not the same thing as the user space format length, so I can not judge your patch. It seems however, that the bug is not stack size dependent. And my box has more than enough memory. So I'm not completely convinced that the issue is a stack or heap size limitation. I further noticed, that the reached last iteration of the inner loop depends on the loop stop value. If I do "DO i=1,100", then the inner loop stops after iteration 85 (but for the same j=30). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42742