Newly introduced findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c: scope_hint: In function ‘grid_transform_coef_xzy_to_ikj’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c:240:32: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc((long unsigned int)(hmatgridp.size[1] * 3 * hmatgridp.size[0]) * 8)’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c:12: included_from: Included from here.
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_private_header.h:11: included_from: Included from here.
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_utils.h:21: included_from: Included from here.
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.h:14: included_from: Included from here.
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c:8: included_from: Included from here.
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c: scope_hint: In function ‘grid_transform_coef_xzy_to_ikj’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c: scope_hint: In function ‘grid_transform_coef_xzy_to_ikj’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c: scope_hint: In function ‘grid_transform_coef_xzy_to_ikj’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c:240:7: note: in expansion of macro ‘idx3’
#  238|     for (int i = 0; i < 3; i++) {
#  239|       for (int j = 0; j < 3; j++) {
#  240|->       idx3(hmatgridp, 0, j, i) = 1.0;
#  241|         for (int k = 1; k <= lp; k++) {
#  242|           idx3(hmatgridp, k, j, i) = idx3(hmatgridp, k - 1, j, i) * dh[j][i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c: scope_hint: In function ‘grid_transform_coef_jik_to_yxz’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c:331:32: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc((long unsigned int)(hmatgridp.size[1] * 3 * hmatgridp.size[0]) * 8)’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c: scope_hint: In function ‘grid_transform_coef_jik_to_yxz’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c: scope_hint: In function ‘grid_transform_coef_jik_to_yxz’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c: scope_hint: In function ‘grid_transform_coef_jik_to_yxz’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_coefficients.c:331:7: note: in expansion of macro ‘idx3’
#  329|     for (int i = 0; i < 3; i++) {
#  330|       for (int j = 0; j < 3; j++) {
#  331|->       idx3(hmatgridp, 0, j, i) = 1.0;
#  332|         for (int k = 1; k <= lp; k++) {
#  333|           idx3(hmatgridp, k, j, i) = idx3(hmatgridp, k - 1, j, i) * dh[j][i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def3]
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c: scope_hint: In function ‘exp_i’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c:49:10: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘res’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c: scope_hint: In function ‘exp_i’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.h:13: included_from: Included from here.
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c:8: included_from: Included from here.
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_tensor_local.h: scope_hint: In function ‘exp_i’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_tensor_local.h: scope_hint: In function ‘exp_i’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c: scope_hint: In function ‘exp_i’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c: scope_hint: In function ‘exp_i’
#   47|     const double c_exp_co = exp(alpha);
#   48|     /* const double c_exp_minus_1 = 1/ c_exp; */
#   49|->   res[0] = exp(imin * alpha);
#   50|     for (int i = 1; i < (imax - imin); i++) {
#   51|       res[i] = res[i - 1] *

Error: GCC_ANALYZER_WARNING (CWE-688): [#def4]
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c: scope_hint: In function ‘calculate_non_orthorombic_corrections_tensor_blocked’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c:219:7: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc((long unsigned int)max((upper_corner[2] - lower_corner[2]) * block_size[2], max((*upper_corner - *lower_corner) * *block_size, (upper_corner[1] - lower_corner[1]) * block_size[1])) * 8)’ where non-null expected
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_tensor_local.h: scope_hint: In function ‘calculate_non_orthorombic_corrections_tensor_blocked’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_tensor_local.h: scope_hint: In function ‘calculate_non_orthorombic_corrections_tensor_blocked’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c: scope_hint: In function ‘calculate_non_orthorombic_corrections_tensor_blocked’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c: scope_hint: In function ‘calculate_non_orthorombic_corrections_tensor_blocked’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c: scope_hint: In function ‘calculate_non_orthorombic_corrections_tensor_blocked’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_tensor_local.h:14: included_from: Included from here.
/usr/include/string.h:65:14: note: argument 1 of ‘memset’ must be non-null
#  217|       if (!plane[dir]) {
#  218|         const double c_exp_const = exp(c[dir] * r_ab[d1] * r_ab[d2]);
#  219|->       memset(x1, 0, sizeof(double) * max_elem);
#  220|         memset(x2, 0, sizeof(double) * max_elem);
#  221|         /* memset(exp_tmp.data, 0, sizeof(double) * exp_tmp.alloc_size_); */

Error: GCC_ANALYZER_WARNING (CWE-688): [#def5]
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c:220:7: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc((long unsigned int)max((upper_corner[2] - lower_corner[2]) * block_size[2], max((*upper_corner - *lower_corner) * *block_size, (upper_corner[1] - lower_corner[1]) * block_size[1])) * 8)’ where non-null expected
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_tensor_local.h: scope_hint: In function ‘calculate_non_orthorombic_corrections_tensor_blocked’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_tensor_local.h: scope_hint: In function ‘calculate_non_orthorombic_corrections_tensor_blocked’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c: scope_hint: In function ‘calculate_non_orthorombic_corrections_tensor_blocked’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c: scope_hint: In function ‘calculate_non_orthorombic_corrections_tensor_blocked’
cp2k-0.0.0/src/grid/dgemm/grid_dgemm_non_orthorombic_corrections.c: scope_hint: In function ‘calculate_non_orthorombic_corrections_tensor_blocked’
/usr/include/string.h:65:14: note: argument 1 of ‘memset’ must be non-null
#  218|         const double c_exp_const = exp(c[dir] * r_ab[d1] * r_ab[d2]);
#  219|         memset(x1, 0, sizeof(double) * max_elem);
#  220|->       memset(x2, 0, sizeof(double) * max_elem);
#  221|         /* memset(exp_tmp.data, 0, sizeof(double) * exp_tmp.alloc_size_); */
#  222|         exp_i(-r_ab[d2] * c[dir], xmin[d1], xmax[d1] + 1, x1 + offset[d1]);

Scan Properties

analyzer-version-clippy1.96.0
analyzer-version-cppcheck2.21.0
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.96.0
diffbase-analyzer-version-cppcheck2.21.0
diffbase-analyzer-version-gcc16.1.1
diffbase-analyzer-version-gcc-analyzer16.1.1
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-224.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namecp2k-0.0.0-1.20260605153758028202.master
diffbase-store-results-to/tmp/tmp7alep_65/cp2k-0.0.0-1.20260605153758028202.master.tar.xz
diffbase-time-created2026-06-07 14:36:41
diffbase-time-finished2026-06-07 15:44:31
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,shellcheck,gcc,clippy,cppcheck' '-o' '/tmp/tmp7alep_65/cp2k-0.0.0-1.20260605153758028202.master.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmp7alep_65/cp2k-0.0.0-1.20260605153758028202.master.src.rpm'
diffbase-tool-versioncsmock-3.8.6.20260603.095741.gbb48252-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-224.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namecp2k-0.0.0-1.20260607132530717417.pr5373
store-results-to/tmp/tmp7yannkv6/cp2k-0.0.0-1.20260607132530717417.pr5373.tar.xz
time-created2026-06-07 15:45:29
time-finished2026-06-07 16:54:44
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,shellcheck,gcc,clippy,cppcheck' '-o' '/tmp/tmp7yannkv6/cp2k-0.0.0-1.20260607132530717417.pr5373.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmp7yannkv6/cp2k-0.0.0-1.20260607132530717417.pr5373.src.rpm'
tool-versioncsmock-3.8.6.20260603.095741.gbb48252-1.el9