From 3d20032377414fcb4ee8e0d19fdafaf355090fc4 Mon Sep 17 00:00:00 2001 From: David Declerck Date: Mon, 16 Sep 2024 11:31:41 +0200 Subject: [PATCH] FIX WIP --- .github/workflows/.windows-msys2-visam.yml | 111 +++++++++++++++++++++ .github/workflows/macos.yml | 2 +- cobc/cobc.c | 9 +- 3 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/.windows-msys2-visam.yml diff --git a/.github/workflows/.windows-msys2-visam.yml b/.github/workflows/.windows-msys2-visam.yml new file mode 100644 index 000000000..363e8719e --- /dev/null +++ b/.github/workflows/.windows-msys2-visam.yml @@ -0,0 +1,111 @@ +name: Windows Workflow + +on: + pull_request: + branches: [ gc4 ] + push: + branches: [ gc3_to_gc4 ] + # manual run in actions tab - for all branches + workflow_dispatch: + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - windows-latest + + runs-on: ${{ matrix.os }} + + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install packages + uses: msys2/setup-msys2@v2 + with: + update: true + install: autoconf automake libtool make mingw-w64-x86_64-libxml2 mingw-w64-x86_64-cjson mingw-w64-x86_64-db mingw-w64-x86_64-gmp libdb-devel mingw-w64-x86_64-gcc flex bison gmp-devel help2man texinfo gettext-devel + + - name: Set git user + run: | + git config --global user.name github-actions + git config --global user.email github-actions-bot@users.noreply.github.com + + - name: Installing VISAM prerequisite + run: | + wget http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z + tar -xvzf visam-2.2.tar.Z + cd visam-2.2 + ./configure --prefix=/usr/local/visam-2.2 --enable-vbisamdefault + sed -i -e "s/\(allow_undefined=\)yes/\1no/" libtool + make + make install + echo "/usr/local/visam-2.2/bin" >> $GITHUB_PATH + echo "CPATH=/usr/local/visam-2.2/include" >> $GITHUB_ENV + echo "LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV + shell: msys2 {0} + + - name: bootstrap + run: | + ./autogen.sh + autoconf + autoreconf --install --force + shell: msys2 {0} + + - name: Build environment setup + run: | + mkdir _build + shell: msys2 {0} + + - name: configure + run: | + cd _build + ../configure --with-visam --with-indexed=visam --enable-cobc-internal-checks --enable-hardening --prefix /opt/cobol/gnucobol --exec-prefix /opt/cobol/gnucobol + shell: msys2 {0} + + - name: Upload config.log + uses: actions/upload-artifact@v3 + if: failure() + with: + name: config.log + path: _build/config.log + + - name: make + run: | + cd _build + make --jobs=$(($(nproc)+1)) + shell: msys2 {0} + + - name: install + run: | + cd _build + make install + find /opt/cobol > install.log + shell: msys2 {0} + + - name: Upload install.log + uses: actions/upload-artifact@v3 + with: + name: install.log + path: _build/install.log + + - name: check + run: | + export PATH=/opt/cobol/gnucobol/bin:$PATH + cd _build/tests + make check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" + shell: msys2 {0} + +# make check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || (echo "not all tests passed") +# make test + + - name: Upload testsuite.log + uses: actions/upload-artifact@v3 + if: failure() + with: + name: testsuite.log + path: _build/tests/testsuite.log diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index dd65c1592..0b0ad0ad2 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -77,7 +77,7 @@ jobs: ../configure --with-${{ matrix.isam }} \ --with-indexed=${{ matrix.isam }} \ --enable-cobc-internal-checks \ - --enable-hardening \ + --enable-hardening --enable-debug \ --prefix /opt/cobol/gnucobol - name: Upload config-${{ matrix.os }}-${{ matrix.isam }}.log diff --git a/cobc/cobc.c b/cobc/cobc.c index 98ec55391..4fdad673b 100644 --- a/cobc/cobc.c +++ b/cobc/cobc.c @@ -1145,7 +1145,7 @@ cobc_parse_realloc (void *prevptr, const size_t size) return m->memptr; } - +#include void cobc_parse_free (void *prevptr) { @@ -1162,9 +1162,10 @@ cobc_parse_free (void *prevptr) /* LCOV_EXCL_START */ if (!curr) { #ifdef COB_TREE_DEBUG - cobc_err_msg (_("call to %s with invalid pointer, as it is missing in list"), - "cobc_parse_free"); - cobc_abort_terminate (1); + cobc_err_msg (_("call to %s with invalid pointer %p, as it is missing in list"), + "cobc_parse_free", prevptr); +/* cobc_abort_terminate (1);*/ + assert (0); #else return; #endif