> I know this isn't exactly an admin question [...] Isn't there a "Languages and Scripting" section? > Here's a short chunk of code: Missing a few pieces. I'll assume "int dataend". > The problem is when I increase the value of messagebuf past 8MB, I get > a segmentation fault (core dumped) [...] Without considering the wisdom of using fscanf( , "%c", ) to get each character from a file, did you ask a debugger to tell you _where_ the segmentation fault occurred? Around here (some 64-bit Debian version), it seems to be pretty early, like before any of the actual executable statements ("{"), suggesting that the problem really is with the size of the array. deb64# cc -o at -g -O0 at.c deb64# ./at Segmentation fault (core dumped) deb64# ulimit -s 8192 deb64# ulimit -s 16384 deb64# ./at ERROR: could not open file: at.dat Apparently, an automatic array like this goes on the stack, and if your stack is too small, then it can't. A different storage class can also make a difference: deb64# diff at.c at2.c 8c8 < char messagebuf[10199999]; /* [NOTE THIS CAUSES segmentation faults] */ --- > static char messagebuf[10199999]; deb64# cc -o at2 -g -O0 at2.c deb64# ./at Segmentation fault (core dumped) deb64# ./at2 ERROR: could not open file: at.dat I'm too lazy to try, but I suspect that using malloc() would be similarly beneficial. (Or "man mmap".)