diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90a3ae60..eefc1e83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,6 @@ env: ZSTD_CLEVEL: 9 # 2025-03-05 ZIG_DIST_VERSION: 0.14.0 - # 2025-04-10 - #ZIG_DIST_VERSION: 0.15.0-dev.286+ddcf6fcdf jobs: job-rebuild-and-verify-stubs: @@ -33,9 +31,9 @@ jobs: #container: debian:12-slim # also works; provides glibc-2.36 #container: debian:testing-slim # also works; currently provides glibc-2.38 steps: + - run: uname -a; pwd; id; umask - name: Install packages run: | - uname -a; pwd; id; umask dpkg --add-architecture i386 apt-get update && apt-get upgrade -y # install system packages @@ -90,6 +88,7 @@ jobs: name: ${{ format('{0}', matrix.os) }} runs-on: ${{ matrix.os }} steps: + - run: uname -a; pwd; id; umask - name: Install extra 32-bit and MinGW packages if: ${{ matrix.use_extra }} run: | @@ -220,6 +219,7 @@ jobs: name: ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} runs-on: ${{ matrix.os }} steps: + - run: uname -a; pwd; id; umask - uses: maxim-lobanov/setup-xcode@v1 if: ${{ matrix.xcode_version }} with: { xcode-version: '${{ matrix.xcode_version }}' } @@ -499,10 +499,10 @@ jobs: - { zig_target: mips-linux-musleabihf, qemu: qemu-mips } - { zig_target: mipsel-linux-musleabi, zig_flags: -msoft-float, qemu: qemu-mipsel } - { zig_target: mipsel-linux-musleabihf, qemu: qemu-mipsel } - - { zig_target: mips-linux-musleabi-mips32r2, zig_flags: -march=mips32r2, qemu: qemu-mips } - - { zig_target: mips-linux-musleabi-mips32r3, zig_flags: -march=mips32r3, qemu: qemu-mips } - - { zig_target: mips-linux-musleabi-mips32r5, zig_flags: -march=mips32r5, qemu: qemu-mips } - - { zig_target: mips-linux-musleabi-mips32r6, zig_flags: -march=mips32r6, qemu: qemu-mips } + # { zig_target: mips-linux-musleabi-mips32r2, zig_flags: -march=mips32r2, qemu: qemu-mips } + # { zig_target: mips-linux-musleabi-mips32r3, zig_flags: -march=mips32r3, qemu: qemu-mips } + # { zig_target: mips-linux-musleabi-mips32r5, zig_flags: -march=mips32r5, qemu: qemu-mips } + # { zig_target: mips-linux-musleabi-mips32r6, zig_flags: -march=mips32r6, qemu: qemu-mips } - { zig_target: powerpc-linux-musleabihf, qemu: qemu-ppc } - { zig_target: powerpc64-linux-musl, qemu: qemu-ppc64 } - { zig_target: powerpc64le-linux-musl, qemu: qemu-ppc64le } @@ -524,6 +524,7 @@ jobs: ZIG_PIC: ${{ matrix.zig_pic }} ZIG_TARGET: ${{ matrix.zig_target }} steps: + - run: uname -a; pwd; id; umask - name: Install Alpine Linux container packages if: ${{ job.container }} shell: sh @@ -593,7 +594,7 @@ jobs: echo "UPX_CONFIG_DISABLE_SANITIZE=ON" >> $GITHUB_ENV fi echo "ZIG_FLAGS=$ZIG_FLAGS" >> $GITHUB_ENV - #- run: set -x; zig version; zig-cc --version; zig-cxx --version + - run: set -x; zig version; zig-cc --version || true; zig-cxx --version || true - run: zig-cc -E -x c -dM /dev/null # list predefined macros for C - run: zig-cxx -E -x c++ -dM /dev/null # list predefined macros for C++ - name: ${{ format('Build Release with zig-cc -target {0} {1}', env.ZIG_TARGET, env.ZIG_PIC) }} diff --git a/misc/cmake/print_info.cmake b/misc/cmake/print_info.cmake index dcdc8728..68ddc1cd 100644 --- a/misc/cmake/print_info.cmake +++ b/misc/cmake/print_info.cmake @@ -56,7 +56,7 @@ function(upx_print_info) upx_print_var(UPX_CONFIG_SANITIZE_FLAGS_DEBUG UPX_CONFIG_SANITIZE_FLAGS_RELEASE) # shortcuts - upx_print_var(APPLE CLANG CYGWIN GNU_FRONTEND GNUC MINGW MSVC MSVC_FRONTEND MSVC_IDE MSVC_SIMULATE MSVC_TOOLSET_VERSION MSVC_VERSION MSYS UNIX WIN32 WIN64) + upx_print_var(AIX APPLE CLANG CYGWIN GNU_FRONTEND GNUC MINGW MSVC MSVC_FRONTEND MSVC_IDE MSVC_SIMULATE MSVC_TOOLSET_VERSION MSVC_VERSION MSYS UNIX WIN32 WIN64) endfunction() # vim:set ft=cmake ts=4 sw=4 tw=0 et: diff --git a/misc/testsuite/upx_testsuite_1.sh b/misc/testsuite/upx_testsuite_1.sh index f9dae1d8..6355153b 100755 --- a/misc/testsuite/upx_testsuite_1.sh +++ b/misc/testsuite/upx_testsuite_1.sh @@ -119,11 +119,12 @@ cd testsuite_1 || exit 1 #*********************************************************************** run_upx() { + local flags="--disable-random-id --fake-stub-version=5.01 --fake-stub-year=2025" local ec=0 if [[ $UPX_TESTSUITE_VERBOSE == 1 ]]; then echo "LOG: '${run_upx[*]}' $*" fi - "${run_upx[@]}" --fake-stub-version=5.01 --fake-stub-year=2025 "$@" || ec=$? + "${run_upx[@]}" $flags "$@" || ec=$? if [[ $ec != 0 ]]; then echo "FATAL: '${run_upx[*]}' $*" echo " (exit code was $ec)" diff --git a/src/file.cpp b/src/file.cpp index 05c30281..416b2e0c 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -129,7 +129,8 @@ void FileBase::closex() may_throw { upx_off_t FileBase::seek(upx_off_t off, int whence) { if (!isOpen()) throwIOException("bad seek 1"); - mem_size_assert(1, off >= 0 ? off : -off); // sanity check + if (!mem_size_valid_bytes(off >= 0 ? off : -off)) // sanity check + throwIOException("bad seek"); if (whence == SEEK_SET) { if (off < 0) throwIOException("bad seek 2"); @@ -318,7 +319,8 @@ void OutputFile::rewrite(SPAN_P(const void) buf, int len) { } upx_off_t OutputFile::seek(upx_off_t off, int whence) { - mem_size_assert(1, off >= 0 ? off : -off); // sanity check + if (!mem_size_valid_bytes(off >= 0 ? off : -off)) // sanity check + throwIOException("bad seek"); assert(!opt->to_stdout); switch (whence) { case SEEK_SET: diff --git a/src/help.cpp b/src/help.cpp index f5c49b79..88a828f5 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -220,7 +220,6 @@ void show_help(int verbose) { "%s" " -d decompress -l list compressed file\n" " -t test compressed file -V display version number\n" - " --fileinfo show parameters of already-compressed file\n" " -h give %s help -L display software license\n%s", verbose == 0 ? "" : " --best compress best (can be slow for big files)\n", verbose == 0 ? "more" : "this", verbose == 0 ? "" : "\n");