diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 22f94477a1..5fa3d43cc9 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -30,7 +30,7 @@ jobs: sdk_platform: linux-amd64 apt_packages: g++-i686-linux-gnu libc6:i386 scons_build_args: platform=x86-32 --no-clang werror=0 - scons_tests: small_tests medium_tests large_tests + scons_tests: small_tests{,_irt} medium_tests{,_irt} large_tests{,_irt} vpython: pyenv/bin/python - name: Linux armhf GCC @@ -39,14 +39,14 @@ jobs: sdk_platform: linux-amd64 apt_packages: g++-arm-linux-gnueabihf qemu-user scons_build_args: platform=arm --no-clang werror=0 - scons_tests: no_gdb_tests=1 small_tests medium_tests + scons_tests: no_gdb_tests=1 small_tests{,_irt} medium_tests{,_irt} vpython: pyenv/bin/python - name: Linux amd64 Clang vm_image: ubuntu-22.04 sdk_platform: linux-amd64 scons_build_args: platform=x86-64 --clang werror=1 - scons_tests: small_tests medium_tests large_tests + scons_tests: small_tests{,_irt} medium_tests{,_irt} large_tests{,_irt} vpython: pyenv/bin/python - name: macOS amd64 AppleClang @@ -61,7 +61,7 @@ jobs: vm_image: windows-2022 sdk_platform: windows-amd64 scons_build_args: platform=x86-64 --no-clang werror=1 mingw_dir=mingw/mingw - scons_tests: small_tests medium_tests large_tests disable_tests=run_toolchain_python_tests + scons_tests: small_tests{,_irt} medium_tests{,_irt} large_tests{,_irt} disable_tests=run_toolchain_python_tests vpython: pyenv/Scripts/python python_packages: pywin32 mingw_url: https://github.com/niXman/mingw-builds-binaries/releases/download/16.1.0-rt_v14-rev1/x86_64-16.1.0-release-posix-seh-msvcrt-rt_v14-rev1.7z @@ -79,7 +79,7 @@ jobs: vm_image: windows-2022 sdk_platform: windows-amd64 scons_build_args: platform=x86-64 --no-clang mingw=1 werror=1 mingw_dir=mingw/mingw - scons_tests: small_tests medium_tests large_tests disable_tests=run_toolchain_python_tests + scons_tests: small_tests{,_irt} medium_tests{,_irt} large_tests{,_irt} disable_tests=run_toolchain_python_tests vpython: pyenv/Scripts/python python_packages: pywin32 mingw_url: https://github.com/niXman/mingw-builds-binaries/releases/download/16.1.0-rt_v14-rev1/x86_64-16.1.0-release-posix-seh-msvcrt-rt_v14-rev1.7z @@ -93,7 +93,6 @@ jobs: NPROC_COMMAND: ${{ matrix.nproc_command }} PYTHON_PACKAGES: ${{ matrix.python_packages }} SCONS_BUILD_ARGS: ${{ matrix.scons_build_args }} - SCONS_TESTS: ${{ matrix.scons_tests }} SDK_PLATFORM: ${{ matrix.sdk_platform }} VPYTHON: ${{ matrix.vpython }} @@ -144,11 +143,11 @@ jobs: set -xue parallelism="$(${NPROC_COMMAND:-nproc})" echo "Build parallelism: ${parallelism}" - ${VPYTHON} -m SCons --mode=opt-host,nacl saigo=1 saigo_newlib_dir=sdk/sdk ${SCONS_BUILD_ARGS} all_programs -j${parallelism} --verbose + ${VPYTHON} -m SCons --mode=opt-host,nacl,nacl_irt_test saigo=1 saigo_newlib_dir=sdk/sdk ${SCONS_BUILD_ARGS} all_programs -j${parallelism} --verbose - name: Test if: success() && matrix.scons_tests != '' run: | set -xue parallelism="$(${NPROC_COMMAND:-nproc})" - ${VPYTHON} -m SCons --mode=opt-host,nacl saigo=1 saigo_newlib_dir=sdk/sdk ${SCONS_BUILD_ARGS} ${SCONS_TESTS} -j${parallelism} --verbose --keep-going disable_flaky_tests=1 + ${VPYTHON} -m SCons --mode=opt-host,nacl saigo=1 saigo_newlib_dir=sdk/sdk ${SCONS_BUILD_ARGS} ${{ matrix.scons_tests }} -j${parallelism} --verbose --keep-going disable_flaky_tests=1 diff --git a/README.md b/README.md index e24f101e81..658f8dc66b 100644 --- a/README.md +++ b/README.md @@ -91,11 +91,12 @@ used command line arguments for our build: - `opt-host`: trusted code toolchain using optimization flags for the current OS - `dbg-host`: trusted code toolchain with debugging flags for th ecurrent OS - `nacl`: NaCl toolchain to build the sandboxed code + - `nacl_irt`, `nacl_irt_test`: NaCl toolchains with IRT enabled. (This is used in production.) Note that adding `nacl` automatically enables `nacl_irt`. - `saigo=1` to use the Saigo NaCl toolchain. This is the only NaCl toolchain we support so you must always add this when using the `nacl` mode. - `--platform=x86`, `--platform=x86-64`, or `--platform=arm`: choose target architecture. - `--verbose`: show compiler and test command lines and other stuff - `-j` build parallelism -- Target names, e.g. `sel_ldr` (NaCl loader), `irt_core`, `small_tests`, `medium_tests`, `all_programs`, `large_tests`, `huge_tests`, `run__test` +- Target names, e.g. `sel_ldr` (NaCl loader), `irt_core`, `small_tests`, `small_tests_irt`, `medium_tests`, `all_programs`, `large_tests`, `huge_tests`, `run__test` There is also a toolchain for host-mode tools. Its configuration is based on the same arguments used for the trusted toolchain. diff --git a/tests/irt_ext/libc/thread_tests.c b/tests/irt_ext/libc/thread_tests.c index 6c60294770..c29d03f8fd 100644 --- a/tests/irt_ext/libc/thread_tests.c +++ b/tests/irt_ext/libc/thread_tests.c @@ -120,6 +120,14 @@ static int do_thread_creation_test(struct threading_environment *env) { return 1; } + /* + * The IRT thread exit hook is called near the end of pthread_exit, after + * the pthread implementation already marked the thread dead. So it can + * still be running after the thread was joined. Note: num_threads_exited + * is declared volatile. + */ + while (env->num_threads_exited == 0) {} + if (env->num_threads_exited != 1) { irt_ext_test_print("do_thread_creation_test: Thread Exit was not" " recorded in the environment.\n"); diff --git a/tests/mmap_prot_exec/nacl.scons b/tests/mmap_prot_exec/nacl.scons index c8946b464f..e85e3d55bf 100644 --- a/tests/mmap_prot_exec/nacl.scons +++ b/tests/mmap_prot_exec/nacl.scons @@ -89,9 +89,11 @@ if (env.Bit('tests_use_irt') and env.Bit('nacl_static_link') and datafile = asm_env.Command( 'exec_data', objfile, '${OBJCOPY} -j .text -O binary ${SOURCES} ${TARGET}') - env.Alias('all_programs', datafile) + # FIXME: needs objdump + # env.Alias('all_programs', datafile) node = env.CommandSelLdrTestNacl('mmap_code_data_alloc_test.out', nexe, [datafile], sel_ldr_flags=['-a']) env.AddNodeToTestSuite(node, ['small_tests'], - 'run_mmap_code_data_alloc_test') + 'run_mmap_code_data_alloc_test', + is_broken=True)