関数やメソッド内で大きな配列を宣言すると、プログラム実行直後にいきなり落ちることが。
デバッグすると、CHKSTK.ASM の
probepages:
sub ecx,_PAGESIZE_ ; yes, move down a page
sub eax,_PAGESIZE_ ; adjust request and...
test dword ptr [ecx],eax ; ...probe it
なんて行で落ちている様子。
謎なのでググってみると・・・
GAH! WTF? - GameDev.Net Discussion Forums
your overflowing your stack, check your functions maybe one has a huge
array defined or something (place it on the heap [global] or malloc it).
Or try a complete rebuild.
なるほど。スタックオーバーフローと。
対処法はいろいろ書いてるけど、とりあえず一番楽&可読性高いかなということで static 変数にしておきました。