Hi Janneke, On Fri, 08 Jan 2021 07:25:52 +0100 Jan Nieuwenhuizen wrote: > > Alignment could be disabled on the CPU > > > > https://developer.arm.com/documentation/ddi0464/f/system-control/register-descriptions/system-control-register > > > > but I don't think EABI wants that. > > Hmm, what does this mean? We are not really using EABI, or are we? VFP is a floating point unit on ARM CPUs. It has been designed to either require aligned members and be fast, or not, depending on a CPU flag that for example the kernel can set. See also https://www.keil.com/support/man/docs/armcc/armcc_chr1359124231926.htm for much more detail. ARM is a famously mix-and-match CPU, so the client can choose whatever they want. If you choose aligned-only, you will get a bus error on misaligned access. A single program really shouldn't be choosing--it's more the entire platform doing the choosing. EABI has standardized on particular settings, among which is required alignment. > So alignment should be fixed, but that's more work and you propose a > workaround, right? No, I wanted to find out what's going on first. Now that grischka commented and I looked up the malloc docs, I suggest to fix mes libc's malloc to align what it gives back. That's all--that should fix everything. We should provide maxalign_t to make it known to the user what the malloc alignment we are using is.