BufferSet::get_image uses the stack quite liberately
BufferSet::get_image
creates arrays on the stack. The size of these arrays scales with the grid size. For larger images (say 30kx30k) the memory usage becomes excessive (several MB). Because this part is multi-threaded, the stack size is smaller then the default 8MB (for linux). This leads to a stack overflow, resulting in a segfault. The stacksize for the threads can be increased by setting the environment variable OMP_STACKSIZE=8MB
.
It would be better if these arrays were allocated on the heap, so that idg can handle large images with the default stack size.