The arm64 Linux kernel of the Debian distribution is configured to no longer handle unaligned memory accesses. An unalinged double word access can occur in line 375 within the generate_uninstall_icon_data function of the Source/icon.cpp file.
The size of the icon group is calculated as the following:
line 341-343:
// calculate size
size_t group_size = sizeof(IconGroupHeader) // header
+ order.size() * SIZEOF_RSRC_ICON_GROUP_ENTRY; // entries
sizeof(IconGroupHeader) = 6
SIZEOF_RSRC_ICON_GROUP_ENTRY = 14
group_size is a multiple of a double word for uneven numbers of order.size() but not if order.size() is an even number.
For illustration group_size for the order.size() values of 1 and 2:
group_size = 6 + 1 * 14 = 20 (double word aligned)
group_size = 6 + 2 * 14 = 34 (not double word aligned)
If group_size is not double world aligned then seeker will no longer be double word aligned from line 367 onwards.
line 366 and 367:
memcpy(seeker, group, group_size);
seeker += group_size;
The bug was originally submitted via the Debian Bug Tracking system as bug number #918376.
Instead of the proposed patch included in the e-mail thread of the Debian bug report I would rather go with the attached patch.
In the attached patch I use memcpy and memset to avoid the unaligned double word memory access. In addition the endian conversion for size is done only once in the for loop (line 370).
Does this not affect the uninstaller code in build.cpp? There is a duplicate there for icons too.