On 04/01/2018 17:51, Christer Solskogen wrote: > Probably because it's about amiberry, which is a uae4arm-rpi fork. > And because O3/Ofast probably does some magic. (IMO, -Ofast is an "unsafe" optimization level: "It enables optimizations that are not valid for all standard-compliant programs.") Could you run the crashing binary under valgrind? Do you get interesting results? I cloned the repo, and looked at src/memory.cpp read_kickstart() is static, and is never called through a function pointer. $ git grep -n read_kickstart src/memory.cpp:424:static int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksum, int noalias) src/memory.cpp:540: read_kickstart (f, extendedkickmem_bank.baseaddr, extendedkickmem_bank.allocated, 0, 1); src/memory.cpp:613: read_kickstart (f, extendedkickmem_bank.baseaddr, ROM_SIZE_512, 0, 1); src/memory.cpp:617: read_kickstart (f, kickmem_bank.baseaddr, ROM_SIZE_512, 1, 0); src/memory.cpp:679: size = read_kickstart (f, kickmem_bank.baseaddr, maxsize, 1, 0); src/memory.cpp:690: read_kickstart (f, extendedkickmem_bank.baseaddr, extendedkickmem_bank.allocated, 0, 1); src/memory.cpp:697: read_kickstart (f, extendedkickmem2_bank.baseaddr, ROM_SIZE_512, 0, 1); src/memory.cpp:699: read_kickstart (f, extendedkickmem2_bank.baseaddr + ROM_SIZE_512, ROM_SIZE_512, 0, 1); What is weird is that every call to read_kickstart() has the 'size' argument either ROM_SIZE_512, or ROM_SIZE_256, or ROM_SIZE_512 * 2. It's never 32 like in the sanitizer's stack dump... Regards.