toni@purkki:~$ valgrind --tool=massif fastgallery -i -o output input ==1904160== Massif, a heap profiler ==1904160== Copyright (C) 2003-2017, and GNU GPL'd, by Nicholas Nethercote ==1904160== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info ==1904160== Command: fastgallery -i -o tempgallery /home/toni/Dropbox/Pictures/Matti/Matin\ valokuvat/ ==1904160== Creating gallery... 10 / 459 [--->______________________________________________________________________________________________________________________________________________] 2.18% 1 p/s==1904160== Can't extend stack to 0xfffffffffffff0b8 during signal delivery for thread 20: ==1904160== too small or bad protection modes ==1904160== ==1904160== Process terminating with default action of signal 11 (SIGSEGV) ==1904160== Access not within mapped region at address 0xFFFFFFFFFFFFF0B8 ==1904160== at 0x38688BD9: ??? (in /run/user/1000/orcexec.mIQUuO (deleted)) ==1904160== If you believe this happened as a result of a stack ==1904160== overflow in your program's main thread (unlikely but ==1904160== possible), you can try to increase the size of the ==1904160== main thread stack using the --main-stacksize= flag. ==1904160== The main thread stack size used in this run was 8388608. ==1904160== ==1904160== Process terminating with default action of signal 11 (SIGSEGV) ==1904160== Access not within mapped region at address 0xFFFFFFFFFFFFFF78 ==1904160== at 0x4832130: _vgnU_freeres (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_core-amd64-linux.so) ==1904160== If you believe this happened as a result of a stack ==1904160== overflow in your program's main thread (unlikely but ==1904160== possible), you can try to increase the size of the ==1904160== main thread stack using the --main-stacksize= flag. ==1904160== Segmentation fault (core dumped)