Menu ▾ ▴

#359 newly placed assert can be triggered with old fuzzing test

1.0
open
nobody
None
2026-10-05
2026-10-02
Andre Maute
No

Hi there,

this is a finding which I saw in July and which I would like to report now.
The test is one of many posted originally for ticket #300.
It now chokes for 'Debug' builds.

Looks like the newly introduced 'assert' is the problem here.
A transcript follows below.

Kind regards
Andre


user@fedora:~/tmp$ git clone https://github.com/a3emdot/zintzxingcppdemo.git
user@fedora:~/tmp$ cd zintzxingcppdemo/
user@fedora:~/tmp/zintzxingcppdemo$ export CMAKE_BUILD_TYPE=Debug
user@fedora:~/tmp/zintzxingcppdemo$ ./ZintZXingCppDemoUpstream.sh 
...
[100%] Built target zint-crash-20231208-1

+ cmake -E chdir /home/user/tmp/zintzxingcppdemo/build/local/src ctest -C Debug
Test project /home/user/tmp/zintzxingcppdemo/build/local/src
      Start  1: zintzxingcppdemo-test
 1/17 Test  #1: zintzxingcppdemo-test ............   Passed   22.13 sec
      Start  2: zint-crash-20231120-1
 2/17 Test  #2: zint-crash-20231120-1 ............   Passed    0.00 sec
      Start  3: zint-crash-20231122-1
 3/17 Test  #3: zint-crash-20231122-1 ............   Passed    0.00 sec
      Start  4: zint-crash-20231124-1
 4/17 Test  #4: zint-crash-20231124-1 ............   Passed    0.00 sec
      Start  5: zint-crash-20231125-1
 5/17 Test  #5: zint-crash-20231125-1 ............   Passed    0.00 sec
      Start  6: zint-crash-20231126-1
 6/17 Test  #6: zint-crash-20231126-1 ............   Passed    0.00 sec
      Start  7: zint-crash-20231126-2
 7/17 Test  #7: zint-crash-20231126-2 ............Subprocess aborted***Exception:   0.12 sec
...
      Start 17: zint-crash-20231208-1
17/17 Test #17: zint-crash-20231208-1 ............   Passed    0.00 sec

94% tests passed, 1 tests failed out of 17

Total Test time (real) =  22.31 sec

The following tests FAILED:
      7 - zint-crash-20231126-2 (Subprocess aborted)
Errors while running CTest
Output from these tests are in: /home/user/tmp/zintzxingcppdemo/build/local/src/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.

user@fedora:~/tmp/zintzxingcppdemo$ pushd build/local/src/
~/tmp/zintzxingcppdemo/build/local/src ~/tmp/zintzxingcppdemo
user@fedora:~/tmp/zintzxingcppdemo/build/local/src$ ./zint-crash-20231126-2
zint-crash-20231126-2: /home/user/tmp/zintzxingcppdemo/build/local/deps/third-party/zint/backend/composite.c:950: zint_composite: Assertion `warn_number < ZINT_ERROR' failed.
Aborted                    (core dumped) ./zint-crash-20231126-2
user@fedora:~/tmp/zintzxingcppdemo/build/local/src$ popd

user@fedora:~/tmp/zintzxingcppdemo$ pushd ./build/local/deps/third-party/zint/
~/tmp/zintzxingcppdemo/build/local/deps/third-party/zint ~/tmp/zintzxingcppdemo
user@fedora:~/tmp/zintzxingcppdemo/build/local/deps/third-party/zint$ git rev-parse HEAD
b7c864e59c1e22b2bd7214df20798eaa8a291997
user@fedora:~/tmp/zintzxingcppdemo/build/local/deps/third-party/zint$ git blame backend/composite.c | grep -C2 -e "950)"
a81c9d925 (gitlost         2026-06-23 23:25:23 +0100  948)     warn_number = symbol->warn_level >> 8;
a81c9d925 (gitlost         2026-06-23 23:25:23 +0100  949)     symbol->warn_level &= 0xFF;
a81c9d925 (gitlost         2026-06-23 23:25:23 +0100  950)     assert(warn_number < ZINT_ERROR);
a81c9d925 (gitlost         2026-06-23 23:25:23 +0100  951) 
f8b56002c (Robin Stuart    2016-09-25 11:09:20 +0100  952)     /* Perform sanity checks on input options first */

Discussion

  • Git Lost

    Git Lost - 2026-10-02

    Thanks Andre, that should be fixed with commits [edaa21] & [4aec8d] (no validation was being done on warn_level - it now resets it silently to WARN_DEFAULT if invalid), best regards, Martin

     

    Related

    Commit: [4aec8d]
    Commit: [edaa21]

    • Andre Maute

      Andre Maute - 2026-10-05

      Hi Martin,

      Thank you very much for that quick fix.
      Our linux build jobs are all working again.
      But it looks like the windows build jobs still have problems.
      I'll have to debug this further.

      Regards Andre

       

Log in to post a comment.