The "opaque but sized" structures (dill_*_storage) may cause data (in particular pointers) not to be aligned. This is not a problem in x86_64, but in ARM it causes loads and stores to be unpredictable (i.e. store wrong data). Then the code will try to invoke a function from a wrong pointer and jumps to nowhere, causing a segfault.
Longer description
The struct dill_suffix_storage suffix_mem; member in dill_http_sock is not aligned. Thus, the dill_hvfs in the suffix socket is not aligned either. dill_suffix_attach_mem will try to set self->hvfs.query and close but because these words are not aligned, the pointers have garbage written (and read). Then dill_hquery will try to invoke this pointers and jump to nowhere.
The size increase caused by alignment is compensated by the smaller pointer sizes in ARM, so the DILL_CHECK_STORAGE() still pass without modifying the sizes.
Testing
Please tell me if you need a short test program that shows the crash.
Description
The "opaque but sized" structures (dill_*_storage) may cause data (in particular pointers) not to be aligned. This is not a problem in x86_64, but in ARM it causes loads and stores to be unpredictable (i.e. store wrong data). Then the code will try to invoke a function from a wrong pointer and jumps to nowhere, causing a segfault.
Longer description
The
struct dill_suffix_storage suffix_mem;
member in dill_http_sock is not aligned. Thus, thedill_hvfs
in the suffix socket is not aligned either.dill_suffix_attach_mem
will try to setself->hvfs.query
andclose
but because these words are not aligned, the pointers have garbage written (and read). Thendill_hquery
will try to invoke this pointers and jump to nowhere.The size increase caused by alignment is compensated by the smaller pointer sizes in ARM, so the DILL_CHECK_STORAGE() still pass without modifying the sizes.
Testing
Please tell me if you need a short test program that shows the crash.