Why do I get a segfault in C from declaring a large array on the stack? September 4, 2022 by Tarik Because your stack segment is smaller then 1820*285*5 ints. It’s usually in a neighborhood of 1MB.