numad-0.5-49.20251104git.fc44

List of Findings

Error: COMPILER_WARNING: [#def1]
numad-0.5git/numad.c: scope_hint: In function ‘numad_log’
numad-0.5git/numad.c:155:5: warning[-Wstringop-truncation]: ‘strncpy’ specified bound 4096 equals destination size
#  155 |     strncpy(buf, ctime(&ts), sizeof(buf));
#      |     ^
#  153|       char buf[BIG_BUF_SIZE];
#  154|       time_t ts = time(NULL);
#  155|->     strncpy(buf, ctime(&ts), sizeof(buf));
#  156|       char *p = &buf[strlen(buf) - 1];
#  157|       *p++ = ':';

Error: COMPILER_WARNING (CWE-252): [#def2]
numad-0.5git/numad.c: scope_hint: In function ‘set_thp_scan_sleep_ms’
numad-0.5git/numad.c:805:17: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  805 |                 write(fd, buf, strlen(buf));
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  803|                   numad_log(LOG_NOTICE, "Changing THP scan time in %s from %d to %d ms.\n", thp_scan_fname, cur_ms, new_ms);
#  804|                   snprintf(buf, BUF_SIZE, "%d\n", new_ms);
#  805|->                 write(fd, buf, strlen(buf));
#  806|               }
#  807|           }

Error: COMPILER_WARNING (CWE-252): [#def3]
numad-0.5git/numad.c: scope_hint: In function ‘register_numad_pid’
numad-0.5git/numad.c:855:9: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  855 |         write(fd, buf, strlen(buf));
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  853|           pid = getpid();
#  854|           snprintf(buf, BUF_SIZE, "%d\n", pid);
#  855|->         write(fd, buf, strlen(buf));
#  856|           close(fd);
#  857|           numad_log(LOG_NOTICE, "Registering numad version %s PID %d\n", VERSION_STRING, pid);

Error: CPPCHECK_WARNING (CWE-401): [#def4]
numad-0.5git/numad.c:1733: error[memleakOnRealloc]: Common realloc mistake: 'dest_mask' nulled but not freed upon failure
# 1731|           if (allocated_bytes_in_masks < num_bytes_in_masks) {
# 1732|               allocated_bytes_in_masks = num_bytes_in_masks;
# 1733|->             dest_mask = realloc(dest_mask, num_bytes_in_masks);
# 1734|               from_mask = realloc(from_mask, num_bytes_in_masks);
# 1735|               if ((dest_mask == NULL) || (from_mask == NULL)) {

Error: CPPCHECK_WARNING (CWE-401): [#def5]
numad-0.5git/numad.c:1734: error[memleakOnRealloc]: Common realloc mistake: 'from_mask' nulled but not freed upon failure
# 1732|               allocated_bytes_in_masks = num_bytes_in_masks;
# 1733|               dest_mask = realloc(dest_mask, num_bytes_in_masks);
# 1734|->             from_mask = realloc(from_mask, num_bytes_in_masks);
# 1735|               if ((dest_mask == NULL) || (from_mask == NULL)) {
# 1736|                   numad_log(LOG_CRIT, "bit mask malloc failed\n");

Error: COMPILER_WARNING: [#def6]
numad-0.5git/numad.c: scope_hint: In function ‘pick_numa_nodes’
numad-0.5git/numad.c:1923:14: warning[-Wunused-but-set-variable=]: variable ‘sum_of_node_CPUs_free’ set but not used
# 1923 |     uint64_t sum_of_node_CPUs_free = 0;
#      |              ^~~~~~~~~~~~~~~~~~~~~
# 1921|       memcpy(tmp_node, node, num_nodes * sizeof(node_data_t) );
# 1922|       // Adjust how many MBs and CPUs are available per node and calculate the node magnitude
# 1923|->     uint64_t sum_of_node_CPUs_free = 0;
# 1924|       for (int ix = 0;  (ix < num_nodes);  ix++) {
# 1925|           if (pid > 0) {

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-18.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namenumad-0.5-49.20251104git.fc44
store-results-to/tmp/tmp6hmnczyy/numad-0.5-49.20251104git.fc44.tar.xz
time-created2026-01-08 19:41:49
time-finished2026-01-08 19:43:07
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp6hmnczyy/numad-0.5-49.20251104git.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp6hmnczyy/numad-0.5-49.20251104git.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9