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

g++13: building with UBSan fails #101

Open
jcelerier opened this issue Aug 7, 2023 · 1 comment
Open

g++13: building with UBSan fails #101

jcelerier opened this issue Aug 7, 2023 · 1 comment

Comments

@jcelerier
Copy link
Collaborator

jcelerier commented Aug 7, 2023

$ g++ -fsanitize=undefined -c verdigris/tests/basic/tst_basic.cpp -I/usr/include/qt6 -I/usr/include/qt6/QtCore -I verdigris/src

In file included from verdigris/tests/basic/anothertu.h:24,
                 from verdigris/tests/basic/tst_basic.cpp:26:
verdigris/src/wobjectimpl.h: In instantiation of 'static void w_internal::FriendHelper::propertyOperation(T*, QMetaObject::Call, int, void**) [with T = BTestObj; int I = 0]':
verdigris/src/wobjectimpl.h:1258:40:   required from 'static void w_internal::FriendHelper::qt_static_metacall_impl2(QObject*, QMetaObject::Call, int, void**, std::index_sequence<__indices ...>, std::index_sequence<_Ind ...>, std::index_sequence<__indices ...>) [with T = BTestObj; long unsigned int ...MethI = {0, 1, 2, 3, 4, 5, 6}; long unsigned int ...ConsI = {0}; long unsigned int ...PropI = {0, 1, 2, 3, 4, 5}; std::index_sequence<__indices ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5, 6>; std::index_sequence<_Ind ...> = std::integer_sequence<long unsigned int, 0>; std::index_sequence<__indices ...> = std::integer_sequence<long unsigned int, 0, 1, 2, 3, 4, 5>]'
verdigris/src/wobjectimpl.h:1302:43:   required from 'static void w_internal::FriendHelper::qt_static_metacall_impl(Ts&& ...) [with T = BTestObj; Ts = {QObject*&, QMetaObject::Call&, int&, void**&}]'
verdigris/tests/basic/tst_basic.cpp:137:1:   required from here
verdigris/src/wobjectimpl.h:1183:41: error: '(BTestObj::getValue != 0)' is not a constant expression
 1183 |             if W_IF_CONSTEXPR (p.getter != nullptr) {
      |                                ~~~~~~~~~^~~~~~~~~~
verdigris/src/wobjectimpl.h:1190:41: error: '(BTestObj::setValue != 0)' is not a constant expression
 1190 |             if W_IF_CONSTEXPR (p.setter != nullptr) {
      |                                ~~~~~~~~~^~~~~~~~~~

@jcelerier
Copy link
Collaborator Author

jcelerier commented Aug 7, 2023

I'm assuming that for some reason with ubsan, g++13 turns function pointers into more complex objects which aren't constant expressions anymore.. will try to add a check to disable the W_IF_CONSTEXPR in ubsan mode.

Does not seem too easy though: https://stackoverflow.com/questions/76853255/how-to-detect-ubsan-presence-with-g

@jcelerier jcelerier changed the title g++13: building with ASan / UBSan fails g++13: building with UBSan fails Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant