primesearch / Mlucas

Ⓜ️ Ernst Mayer's Mlucas and Mfactor programs for GIMPS
https://mersenneforum.org/mayer/README.html
GNU General Public License v3.0
8 stars 2 forks source link

Undefined behavior when compiled with Clang: "applying non-zero offset X to null pointer" #9

Open tdulcet opened 8 months ago

tdulcet commented 8 months ago

Undefined behavior detected when Mlucas is compiled with Clang with UBSan enabled:

../src/dft_macro.c:3856:14: runtime error: applying non-zero offset 512 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:3856:14 in 
../src/dft_macro.c:3856:30: runtime error: applying non-zero offset 1024 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:3856:30 in 
../src/dft_macro.c:3856:46: runtime error: applying non-zero offset 1536 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:3856:46 in 
../src/dft_macro.c:3856:62: runtime error: applying non-zero offset 2048 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:3856:62 in 
../src/dft_macro.c:3856:78: runtime error: applying non-zero offset 2560 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:3856:78 in 
../src/dft_macro.c:3856:94: runtime error: applying non-zero offset 3072 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:3856:94 in 
../src/dft_macro.c:3856:110: runtime error: applying non-zero offset 3584 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:3856:110 in 
../src/dft_macro.c:4271:14: runtime error: applying non-zero offset 512 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:4271:14 in 
../src/dft_macro.c:4271:30: runtime error: applying non-zero offset 1024 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:4271:30 in 
../src/dft_macro.c:4271:46: runtime error: applying non-zero offset 1536 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:4271:46 in 
../src/dft_macro.c:4271:62: runtime error: applying non-zero offset 2048 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:4271:62 in 
../src/dft_macro.c:4271:78: runtime error: applying non-zero offset 2560 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:4271:78 in 
../src/dft_macro.c:4271:94: runtime error: applying non-zero offset 3072 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:4271:94 in 
../src/dft_macro.c:4271:110: runtime error: applying non-zero offset 3584 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/dft_macro.c:4271:110 in