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

ci: an attempt to run the tests under ASan/UBsan on GHActions #320

Closed
wants to merge 1 commit into from

Conversation

evverx
Copy link
Contributor

@evverx evverx commented Oct 12, 2021

No description provided.

@evverx evverx force-pushed the sanitizers branch 3 times, most recently from ff925a5 to f0149fa Compare October 12, 2021 12:41
sanitizers='-fsanitize=address,undefined'
EXPLICIT_MAKE_VARS="CFLAGS='-g -I$DESTDIR/usr/include $sanitizers' LDFLAGS='-L$DESTDIR/usr/lib $sanitizers' LDLIBS= CPPFLAGS= OPT_SUBDIRS="
echo "ASAN_OPTIONS=detect_leaks=0:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1" >> $GITHUB_ENV
echo "UBSAN_OPTIONS=print_stacktrace=1:print_summary=1" >> $GITHUB_ENV
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

halt_on_error=1 should be passed here once the following issues found by UBSan are fixed:

2021-10-12T12:53:34.4098638Z Suite: cond
2021-10-12T12:53:34.4678881Z link.c:193:3: runtime error: null pointer passed as argument 2, which is declared to never be null
2021-10-12T12:53:34.5602482Z     #0 0x55667b89b87c in permission_copy_callback /home/runner/work/selinux/selinux/libsepol/src/link.c:193
2021-10-12T12:53:34.5603316Z     #1 0x55667b88cac7 in hashtab_map /home/runner/work/selinux/selinux/libsepol/src/hashtab.c:234
2021-10-12T12:53:34.5604101Z     #2 0x55667b89f060 in class_copy_callback /home/runner/work/selinux/selinux/libsepol/src/link.c:333
2021-10-12T12:53:34.5604868Z     #3 0x55667b88cac7 in hashtab_map /home/runner/work/selinux/selinux/libsepol/src/hashtab.c:234
2021-10-12T12:53:34.5605627Z     #4 0x55667b8b9a12 in copy_identifiers /home/runner/work/selinux/selinux/libsepol/src/link.c:1617
2021-10-12T12:53:34.5606386Z     #5 0x55667b8bf21a in copy_module /home/runner/work/selinux/selinux/libsepol/src/link.c:1918
2021-10-12T12:53:34.5607151Z     #6 0x55667b8cdcb8 in link_modules /home/runner/work/selinux/selinux/libsepol/src/link.c:2579
2021-10-12T12:53:34.5608612Z     #7 0x55667b7df339 in linker_test_init /home/runner/work/selinux/selinux/libsepol/tests/test-linker.c:82
2021-10-12T12:53:34.5609551Z     #8 0x7f668ceffe0d  (/lib/x86_64-linux-gnu/libcunit.so.1+0x3e0d)
2021-10-12T12:53:34.5610413Z     #9 0x7f668cf0036d in CU_run_all_tests (/lib/x86_64-linux-gnu/libcunit.so.1+0x436d)
2021-10-12T12:53:34.5611396Z     #10 0x55667b7cde0e in do_tests /home/runner/work/selinux/selinux/libsepol/tests/libsepol-tests.c:81
2021-10-12T12:53:34.5612428Z     #11 0x55667b7ce29c in main /home/runner/work/selinux/selinux/libsepol/tests/libsepol-tests.c:116
2021-10-12T12:53:34.5613337Z     #12 0x7f668c3c40b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
2021-10-12T12:53:34.5614338Z     #13 0x55667b7ccc8d in _start (/home/runner/work/selinux/selinux/libsepol/tests/libsepol-tests+0x283c8d)
2021-10-12T12:53:34.5614867Z 
2021-10-12T12:53:34.5615627Z SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior link.c:193:3 in 
2021-10-12T12:54:32.2118312Z Suite: user
2021-10-12T12:54:32.2123368Z database_join.c:82:2: runtime error: null pointer passed as argument 1, which is declared to never be null
2021-10-12T12:54:32.2295203Z     #0 0x562f3f826513 in dbase_join_cache /home/runner/work/selinux/selinux/libsemanage/src/database_join.c:82
2021-10-12T12:54:32.2296288Z     #1 0x562f3f76301f in enter_ro /home/runner/work/selinux/selinux/libsemanage/src/database.c:39
2021-10-12T12:54:32.2298197Z     #2 0x562f3f76484e in dbase_list /home/runner/work/selinux/selinux/libsemanage/src/database.c:192
2021-10-12T12:54:32.2299157Z     #3 0x562f3f7afbfd in semanage_user_list /home/runner/work/selinux/selinux/libsemanage/src/users_policy.c:53
2021-10-12T12:54:32.2300205Z     #4 0x562f3f75952c in get_user_nth /home/runner/work/selinux/selinux/libsemanage/tests/test_user.c:122
2021-10-12T12:54:32.2301070Z     #5 0x562f3f759ddf in test_user_compare /home/runner/work/selinux/selinux/libsemanage/tests/test_user.c:191
2021-10-12T12:54:32.2302614Z     #6 0x7f5cd5aebcc6  (/lib/x86_64-linux-gnu/libcunit.so.1+0x3cc6)
2021-10-12T12:54:32.2304516Z     #7 0x7f5cd5aebefc  (/lib/x86_64-linux-gnu/libcunit.so.1+0x3efc)
2021-10-12T12:54:32.2306449Z     #8 0x7f5cd5aec36d in CU_run_all_tests (/lib/x86_64-linux-gnu/libcunit.so.1+0x436d)
2021-10-12T12:54:32.2308007Z     #9 0x562f3f731252 in do_tests /home/runner/work/selinux/selinux/libsemanage/tests/libsemanage-tests.c:93
2021-10-12T12:54:32.2309407Z     #10 0x562f3f7316d6 in main /home/runner/work/selinux/selinux/libsemanage/tests/libsemanage-tests.c:129
2021-10-12T12:54:32.2311686Z     #11 0x7f5cd3d690b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
2021-10-12T12:54:32.2315619Z     #12 0x562f3f730cad in _start (/home/runner/work/selinux/selinux/libsemanage/tests/libsemanage-tests+0x158cad)
2021-10-12T12:54:32.2317318Z 
2021-10-12T12:54:32.2320072Z SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior database_join.c:82:2 in
2021-10-12T12:54:32.2352217Z   Test: user_list ...passed
2021-10-12T12:54:32.2363178Z database_join.c:80:2: runtime error: null pointer passed as argument 1, which is declared to never be null
2021-10-12T12:54:32.2364110Z     #0 0x562f3f8263ef in dbase_join_cache /home/runner/work/selinux/selinux/libsemanage/src/database_join.c:80
2021-10-12T12:54:32.2364984Z     #1 0x562f3f763a12 in enter_rw /home/runner/work/selinux/selinux/libsemanage/src/database.c:72
2021-10-12T12:54:32.2365831Z     #2 0x562f3f763d38 in dbase_modify /home/runner/work/selinux/selinux/libsemanage/src/database.c:87
2021-10-12T12:54:32.2366753Z     #3 0x562f3f7aeef1 in semanage_user_modify_local /home/runner/work/selinux/selinux/libsemanage/src/users_local.c:24
2021-10-12T12:54:32.2367714Z     #4 0x562f3f75d54c in test_user_modify_del_query_local /home/runner/work/selinux/selinux/libsemanage/tests/test_user.c:568
2021-10-12T12:54:32.2368910Z     #5 0x7f5cd5aebcc6  (/lib/x86_64-linux-gnu/libcunit.so.1+0x3cc6)
2021-10-12T12:54:32.2369806Z     #6 0x7f5cd5aebefc  (/lib/x86_64-linux-gnu/libcunit.so.1+0x3efc)
2021-10-12T12:54:32.2370733Z     #7 0x7f5cd5aec36d in CU_run_all_tests (/lib/x86_64-linux-gnu/libcunit.so.1+0x436d)
2021-10-12T12:54:32.2371820Z     #8 0x562f3f731252 in do_tests /home/runner/work/selinux/selinux/libsemanage/tests/libsemanage-tests.c:93
2021-10-12T12:54:32.2372972Z     #9 0x562f3f7316d6 in main /home/runner/work/selinux/selinux/libsemanage/tests/libsemanage-tests.c:129
2021-10-12T12:54:32.2374006Z     #10 0x7f5cd3d690b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
2021-10-12T12:54:32.2376702Z     #11 0x562f3f730cad in _start (/home/runner/work/selinux/selinux/libsemanage/tests/libsemanage-tests+0x158cad)
2021-10-12T12:54:32.2377736Z 
2021-10-12T12:54:32.2378708Z SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior database_join.c:80:2 in

@evverx
Copy link
Contributor Author

evverx commented Oct 12, 2021

Closing in favor of #321

@evverx evverx closed this Oct 12, 2021
It was tested in SELinuxProject#321 and
SELinuxProject#320. In the process
it discovered a few issues all of which were fixed in
SELinuxProject@b98d3c4
SELinuxProject@ea53901
SELinuxProject@fe01a91
SELinuxProject@f95dbf2

Now that all the issues are gone it should be safe to turn it on
to make it easier to automatically catch bugs like that almost as soon as
they end up in the repository.

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
@evverx evverx reopened this Nov 16, 2021
@evverx evverx mentioned this pull request Nov 16, 2021
@evverx evverx force-pushed the sanitizers branch 5 times, most recently from 0e61033 to 5dbde4b Compare November 16, 2021 11:48
@evverx
Copy link
Contributor Author

evverx commented Nov 16, 2021

It was sent to the mailing list: https://lore.kernel.org/selinux/20211115185829.85614-1-evvers@ya.ru/T/#u . Closing

@evverx evverx closed this Nov 16, 2021
jwcart2 pushed a commit to jwcart2/selinux that referenced this pull request Jan 6, 2022
It was tested in SELinuxProject#321 and
SELinuxProject#320. In the process
it discovered a few issues all of which were fixed in
SELinuxProject@b98d3c4
SELinuxProject@ea53901
SELinuxProject@fe01a91
SELinuxProject@f95dbf2

Now that all the issues are gone it should be safe to turn it on
to make it easier to automatically catch bugs like that almost as soon as
they end up in the repository.

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
jwcart2 pushed a commit that referenced this pull request Jan 12, 2022
It was tested in #321 and
#320. In the process
it discovered a few issues all of which were fixed in
b98d3c4
ea53901
fe01a91
f95dbf2

Now that all the issues are gone it should be safe to turn it on
to make it easier to automatically catch bugs like that almost as soon as
they end up in the repository.

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
chenyt9 pushed a commit to MotorolaMobilityLLC/external-selinux that referenced this pull request Mar 6, 2023
It was tested in SELinuxProject/selinux#321 and
SELinuxProject/selinux#320. In the process
it discovered a few issues all of which were fixed in
SELinuxProject/selinux@b98d3c4
SELinuxProject/selinux@ea53901
SELinuxProject/selinux@fe01a91
SELinuxProject/selinux@f95dbf2

Now that all the issues are gone it should be safe to turn it on
to make it easier to automatically catch bugs like that almost as soon as
they end up in the repository.

Signed-off-by: Evgeny VereshchaGin <evvers@ya.ru>
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

Successfully merging this pull request may close these issues.

1 participant