QA warnings in 7.5.3

Hello,

I'm maintainer of the opencascade package for the Gentoo Linux distribution. While preparing a package for 7.5.3 I get some warnings from our internal QA framework about null pointers in three different occasions, of which I'd like to inform you.

The output is

 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * /var/tmp/portage/sci-libs/opencascade-7.5.3/work/occt-V7_5_3/src/GeomliteTest/GeomliteTest_API2dCommands.cxx:451:33: warning: ‘this’ pointer is null [-Wnonnull]
 * /var/tmp/portage/sci-libs/opencascade-7.5.3/work/occt-V7_5_3/src/GeomliteTest/GeomliteTest_API2dCommands.cxx:455:33: warning: ‘this’ pointer is null [-Wnonnull]
 * /var/tmp/portage/sci-libs/opencascade-7.5.3/work/occt-V7_5_3/src/ViewerTest/ViewerTest_ViewerCommands.cxx:8282:34: warning: ‘this’ pointer is null [-Wnonnull]

The first two occasions are constructs like if (var.IsNull() && var.some_func()), where the conditional after the logical and seems redundant, the third occasion is in a construct if (var.IsNull()) do_something(); else do_otherthings(); where the else clause seems to be redundant.

The cmake command for the build is

cmake -C /var/tmp/portage/sci-libs/opencascade-7.5.3/work/occt-V7_5_3_build/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_DOC_Overview=yes -DBUILD_Inspector=yes -DBUILD_WITH_DEBUG=no -DINSTALL_DIR_BIN=lib64/opencascade-7.5.3/bin -DINSTALL_DIR_CMAKE=lib64/cmake/opencascade-7.5.3 -DINSTALL_DIR_DOC=share/doc/opencascade-7.5.3 -DINSTALL_DIR_LIB=lib64/opencascade-7.5.3 -DINSTALL_DIR_SCRIPT=lib64/opencascade-7.5.3/bin -DINSTALL_DIR_WITH_VERSION=ON -DINSTALL_SAMPLES=yes -DINSTALL_TEST_CASES=NO -DUSE_D3D=NO -DUSE_FFMPEG=yes -DUSE_FREEIMAGE=no -DUSE_FREETYPE=ON -DUSE_GLES2=no -DUSE_RAPIDJSON=yes -DUSE_TBB=yes -DUSE_VTK=yes -DINSTALL_DOC_Overview=ON -D3RDPARTY_QT_DIR=/usr -DBUILD_SAMPLES_QT=ON -D3RDPARTY_VTK_DIR=/usr -D3RDPARTY_VTK_INCLUDE_DIR=/usr/include/vtk-9.0 -D3RDPARTY_VTK_LIBRARY_DIR=/usr/lib64 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/sci-libs/opencascade-7.5.3/work/occt-V7_5_3_build/gentoo_toolchain.cmake  /var/tmp/portage/sci-libs/opencascade-7.5.3/work/occt-V7_5_3

The package builds and installs without errors. However, I haven't done any testing, or real world applications running against the built libraries. I can provide a full build log if desired.

Kirill Gavrilov's picture

Thanks for sharing your information. It would be more productive reporting such issues directly on Bugtracker (see introduction). You may choose "Coding" category for such kind of issues.

I've taken a look onto a couple of lines and indeed they look clearly as misprints in the code. Is it the whole log or you have more such errors detected by QA framework? By the way, is it sort of static code analyzer or something else?

Please comment if you are going to report a bug on Mantis.

Bernd Waibel's picture

Thanks for your reply and sorry for the delay. Forgot to configure appropriate subscriptions for the forum to get informed upon replies.

The output above is the whole output, there are no additional errors from QA. I'm not much into our QA approach, so not sure how this is handled in detail. To my knowledge it's by passing the -frecord-gcc-switches to gcc and passing a linker flag -Wl,--defsym with a certain value and then parsing the log files before the package get's stripped. What other QA magic is happening in the background is beyond my knowledge.

I'm going to report this on Mantis.