darktable icon indicating copy to clipboard operation
darktable copied to clipboard

module order change causes misaligned acces

Open maruncz opened this issue 2 years ago • 4 comments

current master release-4.1.0-109-g4ea7e5d5c

if i switch from legacy to modern raw order (or backwards) in darkroom dt crashes: /home/martin/c/darktable/src/common/iop_order.c:2184:23: runtime error: load of misaligned address 0x61b000079396 for type 'int32_t', which requires 4 byte alignment 0x61b000079396: note: pointer points here 70 61 72 65 00 00 00 00 06 00 00 00 69 6e 76 65 72 74 00 00 00 00 0b 00 00 00 74 65 6d 70 65 72

maruncz avatar Jul 30 '22 13:07 maruncz

Tried on current master and couldn't reproduce. Perhaps steps to reproduce would be helpful as well as the rest of the information in the template.

wpferguson avatar Jul 30 '22 16:07 wpferguson

Did you build with sanitizers enabled? that is from asan i believe

maruncz avatar Jul 30 '22 17:07 maruncz

Looking at the code, I see that the serialized IOP order list consists of repetitions of (32-bit int)(ASCIZ string)(32-bit int). And since the string length including NUL is not usually not a multiple of 4, you'll get the misaligned accesses any time dt_ioppr_deserialize_iop_order_list is called. The fix would involve a function that reads four individual bytes and builds the int from them.

ralfbrown avatar Jul 30 '22 19:07 ralfbrown

This issue did not get any activity in the past 60 days and will be closed in 365 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] avatar Sep 29 '22 00:09 github-actions[bot]

This issue was closed because it has been inactive for 300 days since being marked as stale. Please check if the newest release or nightly build has it fixed. Please, create a new issue if the issue is not fixed.

github-actions[bot] avatar Jul 27 '23 00:07 github-actions[bot]