steinbergmedia / vst3_public_sdk

VST 3 Implementation Helper Classes And Examples
Other
140 stars 47 forks source link

undefined behavior - load of misaligned address #64

Closed 0ax1 closed 1 year ago

0ax1 commented 1 year ago

When running the VST3 validator with UBSan enabled, a load of a misaligned address address is flagged:

vst3sdk/public.sdk/source/vst/hosting/../utility/uid.h:177:10: runtime error: load of misaligned address 0x00016f3ced7e for type 'const uint64_t' (aka 'const unsigned long long'), which requires 8 byte alignment
0x00016f3ced7e: note: pointer points here
 30 03 00 60 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  68 65 6c 70 00 00 00 00  24 fe
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior vst3sdk/public.sdk/source/vst/hosting/../utility/uid.h:177:10 in
vst3sdk/public.sdk/source/vst/hosting/../utility/uid.h:178:10: runtime error: load of misaligned address 0x00016f3ced86 for type 'const uint64_t' (aka 'const unsigned long long'), which requires 8 byte alignment

This is the case for lines 177 and 178 in uid.h:

ygrabit commented 1 year ago

Thanks, we will evaluate this and propose a fix for the next update...