Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubsan (undefined behaviour sanitizer) errors in GitHub CI #4908

Open
matejk opened this issue Mar 25, 2025 · 2 comments
Open

ubsan (undefined behaviour sanitizer) errors in GitHub CI #4908

matejk opened this issue Mar 25, 2025 · 2 comments
Assignees
Labels

Comments

@matejk
Copy link
Contributor

matejk commented Mar 25, 2025

Describe the bug

Reported in CI:

https://github.com/pocoproject/poco/actions/runs/14028210164/job/39270503936#step:5:727

testAnyCastToReference: /Users/runner/work/poco/poco/Foundation/include/Poco/Any.h:467:8: runtime error: downcast of address 0x7ff7bccd7570 which does not point to an object of type 'Any::Holder<volatile int>'
0x7ff7bccd7570: note: object is of type 'Poco::Any::Holder<int>'
 08 ea df 9d  68 c4 13 04 01 00 00 00  89 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'Poco::Any::Holder<int>'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/runner/work/poco/poco/Foundation/include/Poco/Any.h:467:8 in 
/Users/runner/work/poco/poco/Foundation/include/Poco/Any.h:467:66: runtime error: member access within address 0x7ff7bccd7570 which does not point to an object of type 'Any::Holder<volatile int>'
0x7ff7bccd7570: note: object is of type 'Poco::Any::Holder<int>'
 08 ea df 9d  68 c4 13 04 01 00 00 00  89 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'Poco::Any::Holder<int>'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/runner/work/poco/poco/Foundation/include/Poco/Any.h:467:66 in 

https://github.com/pocoproject/poco/actions/runs/14028210164/job/39270503936#step:5:727

testClassLoader2: TestLibrary initializing
src/ClassLoaderTest.cpp:110:2: runtime error: member call on address 0x600003cfc2f0 which does not point to an object of type 'TestPlugin'
0x600003cfc2f0: note: object is of type 'PluginA'
 00 00 00 00  60 16 5c 05 01 00 00 00  00 00 00 00 00 00 00 00  00 c3 f5 c6 24 65 00 00  32 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'PluginA'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/ClassLoaderTest.cpp:110:2 in 
src/ClassLoaderTest.cpp:112:2: runtime error: member call on address 0x600003cfc2f0 which does not point to an object of type 'TestPlugin'
0x600003cfc2f0: note: object is of type 'PluginA'
 00 00 00 00  60 16 5c 05 01 00 00 00  00 00 00 00 00 00 00 00  00 c3 f5 c6 24 65 00 00  32 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'PluginA'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/ClassLoaderTest.cpp:112:2 in 
src/ClassLoaderTest.cpp:115:2: runtime error: member call on address 0x600003cfc2f0 which does not point to an object of type 'TestPlugin'
0x600003cfc2f0: note: object is of type 'PluginB'
 00 00 00 00  10 17 5c 05 01 00 00 00  00 00 00 00 00 00 00 00  00 c3 f5 c6 24 65 00 00  32 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'PluginB'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/ClassLoaderTest.cpp:115:2 in 
src/ClassLoaderTest.cpp:116:2: runtime error: member call on address 0x600003cfc2f0 which does not point to an object of type 'TestPlugin'
0x600003cfc2f0: note: object is of type 'PluginB'
 00 00 00 00  10 17 5c 05 01 00 00 00  00 00 00 00 00 00 00 00  00 c3 f5 c6 24 65 00 00  32 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'PluginB'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/ClassLoaderTest.cpp:116:2 in 
src/ClassLoaderTest.cpp:119:2: runtime error: member call on address 0x600003cfc2f0 which does not point to an object of type 'TestPlugin'
0x600003cfc2f0: note: object is of type 'PluginB'
 00 00 00 00  10 17 5c 05 01 00 00 00  00 00 00 00 00 00 00 00  00 c3 f5 c6 24 65 00 00  32 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'PluginB'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/ClassLoaderTest.cpp:119:2 in 
src/ClassLoaderTest.cpp:120:2: runtime error: member call on address 0x600003cfc2f0 which does not point to an object of type 'TestPlugin'
0x600003cfc2f0: note: object is of type 'PluginB'
 00 00 00 00  10 17 5c 05 01 00 00 00  00 00 00 00 00 00 00 00  00 c3 f5 c6 24 65 00 00  32 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'PluginB'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/ClassLoaderTest.cpp:120:2 in 
src/ClassLoaderTest.cpp:127:2: runtime error: member call on address 0x600003cfc2f0 which does not point to an object of type 'TestPlugin'
0x600003cfc2f0: note: object is of type 'PluginC'
 00 00 00 00  c8 17 5c 05 01 00 00 00  00 00 00 00 00 00 00 00  00 c3 f5 c6 24 65 00 00  32 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'PluginC'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/ClassLoaderTest.cpp:127:2 in 
TestLibrary uninitializing

https://github.com/pocoproject/poco/actions/runs/14028210164/job/39270503909#step:5:190

testAnyCastToReference: /home/runner/work/poco/poco/Foundation/include/Poco/Any.h:467:8: runtime error: downcast of address 0x7ffca0cae130 which does not point to an object of type 'Holder'
0x7ffca0cae130: note: object is of type 'Poco::Any::Holder<int>'
 98 55 00 00  20 10 30 07 98 55 00 00  89 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'Poco::Any::Holder<int>'

Expected behavior

ubsan reports no errors.

Please add relevant environment information:

  • OS Type and Version: macOS 13.7.4, Ubuntu Linux 24.04
  • POCO Version: 1.14.2
@matejk matejk added the bug label Mar 25, 2025
@matejk matejk added this to the Release 1.14.2 milestone Mar 25, 2025
@matejk matejk self-assigned this Mar 25, 2025
@matejk matejk added this to 1.14 Mar 25, 2025
@aleks-f aleks-f changed the title ubsan (undefined behaviour sanitizer) errors in GitLab CI ubsan (undefined behaviour sanitizer) errors in GitHub CI Mar 25, 2025
@matejk
Copy link
Contributor Author

matejk commented Mar 25, 2025

  • Case 1: Holder contains Any::Holder<int> but cast to Any::Holder<volatile int> is attempted.
  • Case 2: Object is of type PluginA, PluginB, PluginB but pointer is TestPlugin
  • Case 3: same as Case 1, reported on Linux

@matejk
Copy link
Contributor Author

matejk commented Mar 25, 2025

It seems that ubsan errors are expected in these situations and shall be added to ignore list in a similar way as tsan has a suppress list.

@matejk matejk modified the milestones: Release 1.14.2, Release 1.15.0 Mar 25, 2025
@matejk matejk removed this from 1.14 Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant