-
Notifications
You must be signed in to change notification settings - Fork 8
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
[???] Add UBSAN #369
base: main
Are you sure you want to change the base?
[???] Add UBSAN #369
Conversation
There are more options that can be used (e.g., for unsigned integer overflow and implicit conversions), but they were left out as the logs became very noisy. Docs for clang 13: https://releases.llvm.org/13.0.0/tools/clang/docs/UndefinedBehaviorSanitizer.html |
Is noisy... bad? Are they real UB? Isn't that what we want to see? All the noise, aka 'signal'? |
Yes. If it found things, we need to open issues for them and address them. We should review the results together first though. |
Here's what I have saved. Context for the first part, running non OIDC tests. Context for second part, stopping a server with ctrl^c after a successful start. $ cat /tmp/run.txt.4174
/opt/irods-externals/boost-libcxx1.81.0-1/include/boost/beast/http/impl/field.ipp:70:19: runtime error: unsigned integer overflow: 1701012321 * 5 cannot be represented in type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /opt/irods-externals/boost-libcxx1.81.0-1/include/boost/beast/http/impl/field.ipp:70:19 in
/opt/irods-externals/boost-libcxx1.81.0-1/include/boost/beast/http/impl/field.ipp:62:20: runtime error: unsigned integer overflow: 1701012321 * 5 cannot be represented in type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /opt/irods-externals/boost-libcxx1.81.0-1/include/boost/beast/http/impl/field.ipp:62:20 in
/opt/irods-externals/boost-libcxx1.81.0-1/include/boost/beast/http/impl/field.ipp:62:24: runtime error: unsigned integer overflow: 4210094309 + 1630368880 cannot be represented in type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /opt/irods-externals/boost-libcxx1.81.0-1/include/boost/beast/http/impl/field.ipp:62:24 in
/opt/irods-externals/boost-libcxx1.81.0-1/include/boost/beast/core/impl/string.ipp:33:12: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /opt/irods-externals/boost-libcxx1.81.0-1/include/boost/beast/core/impl/string.ipp:33:12 in
/opt/irods-externals/boost-libcxx1.81.0-1/include/boost/beast/core/detail/string.hpp:37:39: runtime error: unsigned integer overflow: 45 - 65 cannot be represented in type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /opt/irods-externals/boost-libcxx1.81.0-1/include/boost/beast/core/detail/string.hpp:37:39 in
/opt/irods-externals/boost-libcxx1.81.0-1/include/boost/asio/detail/impl/signal_set_service.ipp:142:12: runtime error: implicit conversion from type 'ssize_t' (aka 'long') of value -1 (64-bit, signed) to type 'unsigned long' changed the value to 18446744073709551615 (64-bit, unsigned)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /opt/irods-externals/boost-libcxx1.81.0-1/include/boost/asio/detail/impl/signal_set_service.ipp:142:12 in
$ cat /tmp/run.txt.4368
/opt/irods-externals/boost-libcxx1.81.0-1/include/boost/asio/detail/impl/signal_set_service.ipp:142:12: runtime error: implicit conversion from type 'ssize_t' (aka 'long') of value -1 (64-bit, signed) to type 'unsigned long' changed the value to 18446744073709551615 (64-bit, unsigned)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /opt/irods-externals/boost-libcxx1.81.0-1/include/boost/asio/detail/impl/signal_set_service.ipp:142:12 in |
Looks like it's complaining about Boost.Beast, not our code. Can it be configured to ignore Boost.Beast code? |
Add UBSan to CMake options.