mikekazakov/nimble-commander

[Code]: UBSAN warning: misaligned address

Opened this issue · 0 comments

Task Type

Technical Debt

Description

From unit-tests (UBSAN):


/Users/runner/work/nimble-commander/nimble-commander/Scripts/run_all_unit_tests.tmp/Release/UtilityUT

/Users/runner/work/nimble-commander/nimble-commander/Source/Utility/source/Tags.cpp:290:35: runtime error: reference binding to misaligned address 0x00016d2917d2 for type 'const Trailer', which requires 8 byte alignment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x00016d2917d2: note: pointer points here
UtilityUT is a Catch v2.13.3 host application.
 0a 36  08 0a 00 00 00 00 00 00  01 01 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00
Run with -? for options
              ^ 

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/runner/work/nimble-commander/nimble-commander/Source/Utility/source/Tags.cpp:290:35 in 
-------------------------------------------------------------------------------
/Applications/Xcode_15.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/string_view:379:81: runtime error: reference binding to misaligned address 0x6000007c810d for type 'const value_type' (aka 'const char16_t'), which requires 2 byte alignment
nc::utility::GetSystemOverview Extracts all data
0x6000007c810d: note: pointer points here
-------------------------------------------------------------------------------
 00 21 00 21 00 0a 00  34 08 0a 00 00 00 00 00  00 01 01 00 00 00 00 00  00 00 02 00 00 00 00 00  00
/Users/runner/work/nimble-commander/nimble-commander/Source/Utility/tests/SystemInformation_UT.mm:9
             ^ 
...............................................................................
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Applications/Xcode_15.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/string_view:379:81 in 

/Applications/Xcode_15.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/string_view:399:80: runtime error: reference binding to misaligned address 0x6000007c810f for type 'const value_type' (aka 'const char16_t'), which requires 2 byte alignment
/Users/runner/work/nimble-commander/nimble-commander/Source/Utility/tests/SystemInformation_UT.mm:18: FAILED:
0x6000007c810f: note: pointer points here
  CHECK( so.human_model != "N/A" )
 00 21 00 0a 00  34 08 0a 00 00 00 00 00  00 01 01 00 00 00 00 00  00 00 02 00 00 00 00 00  00 00 00
with expansion:
             ^ 
  "N/A" != "N/A"
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Applications/Xcode_15.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/string_view:399:80 in 

===============================================================================
test cases:  118 |  117 passed | 1 failed as expected
assertions: 1723 | 1722 passed | 1 failed as expected

/Users/runner/work/nimble-commander/nimble-commander/Scripts/run_all_unit_tests.tmp/Release/VFSUT
/Users/runner/work/nimble-commander/nimble-commander/Source/Utility/source/Tags.cpp:290:35: runtime error: reference binding to misaligned address 0x00016ee29903 for type 'const Trailer', which requires 8 byte alignment
0x00016ee29903: note: pointer points here
 0a  34 08 0a 00 00 00 00 00  00 01 01 00 00 00 00 00  00 00 02 00 00 00 00 00  00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/runner/work/nimble-commander/nimble-commander/Source/Utility/source/Tags.cpp:290:35 in 
===============================================================================
All tests passed (21598 assertions in 56 test cases)

Additional Information

No response