criu-4.0-2.fc42

List of Findings

Error: CPPCHECK_WARNING (CWE-476): [#def1]
criu-4.0-build/criu-4.0/compel/plugins/std/infect.c:106: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  104|   	return fini_sigreturn(new_sp);
#  105|   
#  106|-> 	BUG();
#  107|   
#  108|   	return -1;

Error: CPPCHECK_WARNING (CWE-476): [#def2]
criu-4.0-build/criu-4.0/compel/src/lib/infect.c:430: error[nullPointer]: Null pointer dereference: (struct sockaddr_un*)0
#  428|   
#  429|   	saddr->sun_family = AF_UNIX;
#  430|-> 	snprintf(saddr->sun_path, UNIX_PATH_MAX, "X/crtools-pr-%d-%" PRIx64, key, compel_run_id);
#  431|   
#  432|   	sun_len = SUN_LEN(saddr);

Error: CPPCHECK_WARNING (CWE-476): [#def3]
criu-4.0-build/criu-4.0/compel/src/lib/infect.c:710: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  708|   		goto err;
#  709|   
#  710|-> 	futex_wait_while_eq(&args->daemon_connected, 0);
#  711|   	if (futex_get(&args->daemon_connected) != 1) {
#  712|   		errno = -(int)futex_get(&args->daemon_connected);

Error: CPPCHECK_WARNING (CWE-476): [#def4]
criu-4.0-build/criu-4.0/compel/src/lib/infect.c:931: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  929|   			*where = elf_relocs[i].value + elf_relocs[i].addend + (unsigned long)vbase;
#  930|   		} else
#  931|-> 			BUG();
#  932|   	}
#  933|   #endif

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
criu-4.0-build/criu-4.0/compel/src/lib/infect.c: scope_hint: In function ‘find_executable_area’
criu-4.0-build/criu-4.0/compel/src/lib/infect.c:1202:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&aux, "r")’
# 1200|   
# 1201|   		/* f now points at " rwx" (yes, with space) part */
# 1202|-> 		if (f[3] == 'x') {
# 1203|   			BUG_ON(end - start < PARASITE_START_AREA_MIN);
# 1204|   			ret = start;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
criu-4.0-build/criu-4.0/compel/src/lib/infect.c:1202:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&aux, "r")’
# 1200|   
# 1201|   		/* f now points at " rwx" (yes, with space) part */
# 1202|-> 		if (f[3] == 'x') {
# 1203|   			BUG_ON(end - start < PARASITE_START_AREA_MIN);
# 1204|   			ret = start;

Error: CPPCHECK_WARNING (CWE-476): [#def7]
criu-4.0-build/criu-4.0/compel/src/lib/infect.c:1203: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
# 1201|   		/* f now points at " rwx" (yes, with space) part */
# 1202|   		if (f[3] == 'x') {
# 1203|-> 			BUG_ON(end - start < PARASITE_START_AREA_MIN);
# 1204|   			ret = start;
# 1205|   			break;

Error: CPPCHECK_WARNING (CWE-476): [#def8]
criu-4.0-build/criu-4.0/compel/src/lib/infect.c:1529: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
# 1527|   void *compel_parasite_args_s(struct parasite_ctl *ctl, unsigned long args_size)
# 1528|   {
# 1529|-> 	BUG_ON(args_size > ctl->args_size);
# 1530|   	return compel_parasite_args_p(ctl);
# 1531|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def9]
criu-4.0-build/criu-4.0/compel/src/main.c: scope_hint: In function ‘gen_prefix’
criu-4.0-build/criu-4.0/compel/src/main.c:277:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
#  275|   	// Now, check if we got a valid C identifier. We don't need to care
#  276|   	// about C reserved keywords, as this is only used as a prefix.
#  277|-> 	for (p = ret; *p != '\0'; p++) {
#  278|   		if (isalpha(*p))
#  279|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def10]
criu-4.0-build/criu-4.0/criu/cr-check.c: scope_hint: In function ‘get_file_dev_and_inode’
criu-4.0-build/criu-4.0/criu/cr-check.c:1413:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/self/maps", "r")’
# 1411|   	}
# 1412|   
# 1413|-> 	while (fgets(buf, sizeof(buf), mapf)) {
# 1414|   		unsigned long start, end;
# 1415|   		uint32_t maj, min;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
criu-4.0-build/criu-4.0/criu/cr-check.c:1413:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/self/maps", "r")’
# 1411|   	}
# 1412|   
# 1413|-> 	while (fgets(buf, sizeof(buf), mapf)) {
# 1414|   		unsigned long start, end;
# 1415|   		uint32_t maj, min;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def12]
criu-4.0-build/criu-4.0/criu/cr-check.c:1418:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/self/maps", "r")’
# 1416|   		__u64 ino;
# 1417|   
# 1418|-> 		if (sscanf(buf, "%lx-%lx %*s %*s %x:%x %llu",
# 1419|   			   &start, &end, &maj, &min, &ino) != 5) {
# 1420|   			pr_perror("Unable to parse: %s", buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
criu-4.0-build/criu-4.0/criu/cr-check.c:1418:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/self/maps", "r")’
# 1416|   		__u64 ino;
# 1417|   
# 1418|-> 		if (sscanf(buf, "%lx-%lx %*s %*s %x:%x %llu",
# 1419|   			   &start, &end, &maj, &min, &ino) != 5) {
# 1420|   			pr_perror("Unable to parse: %s", buf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
criu-4.0-build/criu-4.0/criu/cr-check.c:1423:27: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/self/maps", "r")’
# 1421|   			return -1;
# 1422|   		}
# 1423|-> 		if (start == (unsigned long)addr) {
# 1424|   			stx->stx_dev_major = maj;
# 1425|   			stx->stx_dev_minor = min;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
criu-4.0-build/criu-4.0/criu/cr-check.c:1423:27: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/self/maps", "r")’
# 1421|   			return -1;
# 1422|   		}
# 1423|-> 		if (start == (unsigned long)addr) {
# 1424|   			stx->stx_dev_major = maj;
# 1425|   			stx->stx_dev_minor = min;

Error: GCC_ANALYZER_WARNING (CWE-126): [#def16]
criu-4.0-build/criu-4.0/criu/cr-dump.c: scope_hint: In function ‘free_mappings’
criu-4.0-build/criu-4.0/criu/cr-dump.c:113:30: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
criu-4.0-build/criu-4.0/criu/cr-dump.c: scope_hint: In function ‘free_mappings’
criu-4.0-build/criu-4.0/criu/cr-dump.c:53: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/cr-dump.c:2223:9: note: in expansion of macro ‘for_each_pstree_item’
criu-4.0-build/criu-4.0/criu/cr-dump.c:2223:9: note: in expansion of macro ‘for_each_pstree_item’
criu-4.0-build/criu-4.0/criu/include/xmalloc.h:1: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/util.h:19: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/cr-dump.c:1563:9: note: in expansion of macro ‘pr_info’
criu-4.0-build/criu-4.0/criu/cr-dump.c:32: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/cr-dump.c:112:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/criu/cr-dump.c:113:30: note: read of 1 bit from after the end of ‘vmas’
#  111|   
#  112|   	list_for_each_entry_safe(vma_area, p, &vma_area_list->h, list) {
#  113|-> 		if (!vma_area->file_borrowed)
#  114|   			free(vma_area->vmst);
#  115|   		free(vma_area);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def17]
criu-4.0-build/criu-4.0/criu/cr-dump.c:114:38: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
criu-4.0-build/criu-4.0/criu/cr-dump.c: scope_hint: In function ‘free_mappings’
criu-4.0-build/criu-4.0/criu/cr-dump.c:2223:9: note: in expansion of macro ‘for_each_pstree_item’
criu-4.0-build/criu-4.0/criu/cr-dump.c:2223:9: note: in expansion of macro ‘for_each_pstree_item’
criu-4.0-build/criu-4.0/criu/cr-dump.c:1563:9: note: in expansion of macro ‘pr_info’
criu-4.0-build/criu-4.0/criu/cr-dump.c:112:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/criu/cr-dump.c:114:38: note: read of 8 bytes from after the end of ‘vmas’
#  112|   	list_for_each_entry_safe(vma_area, p, &vma_area_list->h, list) {
#  113|   		if (!vma_area->file_borrowed)
#  114|-> 			free(vma_area->vmst);
#  115|   		free(vma_area);
#  116|   	}

Error: GCC_ANALYZER_WARNING (CWE-590): [#def18]
criu-4.0-build/criu-4.0/criu/cr-dump.c:115:17: warning[-Wanalyzer-free-of-non-heap]: ‘free’ of ‘vma_area’ which points to memory on the stack
criu-4.0-build/criu-4.0/criu/cr-dump.c: scope_hint: In function ‘free_mappings’
criu-4.0-build/criu-4.0/criu/cr-dump.c:2223:9: note: in expansion of macro ‘for_each_pstree_item’
criu-4.0-build/criu-4.0/criu/cr-dump.c:2223:9: note: in expansion of macro ‘for_each_pstree_item’
criu-4.0-build/criu-4.0/criu/cr-dump.c:1563:9: note: in expansion of macro ‘pr_info’
criu-4.0-build/criu-4.0/criu/cr-dump.c:112:9: note: in expansion of macro ‘list_for_each_entry_safe’
#  113|   		if (!vma_area->file_borrowed)
#  114|   			free(vma_area->vmst);
#  115|-> 		free(vma_area);
#  116|   	}
#  117|   

Error: GCC_ANALYZER_WARNING (CWE-416): [#def19]
criu-4.0-build/criu-4.0/criu/eventpoll.c: scope_hint: In function ‘dequeue_dinfo’
criu-4.0-build/criu-4.0/criu/eventpoll.c:112:30: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘dinfo’
criu-4.0-build/criu-4.0/criu/include/crtools.h:6: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/eventpoll.c:15: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/include/imgset.h:20:9: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/criu/include/xmalloc.h:2: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/util.h:19: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/eventpoll.c:22: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/eventpoll.c:122:9: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/criu/eventpoll.c:178:9: note: in expansion of macro ‘list_for_each_entry_safe’
#  110|   	ssize_t i;
#  111|   
#  112|-> 	for (i = 0; i < dinfo->e->n_tfd; i++)
#  113|   		eventpoll_tfd_entry__free_unpacked(dinfo->e->tfd[i], NULL);
#  114|   

Error: GCC_ANALYZER_WARNING (CWE-416): [#def20]
criu-4.0-build/criu-4.0/criu/eventpoll.c:112:33: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘((struct eventpoll_dinfo)*((struct list_head *)dinfo)).e’
criu-4.0-build/criu-4.0/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/include/imgset.h:20:9: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/criu/eventpoll.c:117:9: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/criu/eventpoll.c:178:9: note: in expansion of macro ‘list_for_each_entry_safe’
#  110|   	ssize_t i;
#  111|   
#  112|-> 	for (i = 0; i < dinfo->e->n_tfd; i++)
#  113|   		eventpoll_tfd_entry__free_unpacked(dinfo->e->tfd[i], NULL);
#  114|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
criu-4.0-build/criu-4.0/criu/files-reg.c: scope_hint: In function ‘validate_with_build_id’
criu-4.0-build/criu-4.0/criu/files-reg.c:2135:24: warning[-Wanalyzer-malloc-leak]: leak of ‘build_id’
criu-4.0-build/criu-4.0/criu/include/xmalloc.h:2: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/pstree.h:7: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/files-reg.c:50: included_from: Included from here.
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/files-reg.c:1547:38: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/files-reg.c:1547:38: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/files-reg.c:1547:38: note: in expansion of macro ‘xmalloc’
# 2133|   
# 2134|   	if (!rfi->rfe->has_size)
# 2135|-> 		return 1;
# 2136|   
# 2137|   	if (!rfi->rfe->n_build_id)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
criu-4.0-build/criu-4.0/criu/files.c:1067:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd,  dfd)’
criu-4.0-build/criu-4.0/include/common/bug.h:23:22: note: in definition of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/files.c:1064:9: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/files.c:1064:9: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/criu/files.c:1066:9: note: in expansion of macro ‘pr_info’
# 1065|   
# 1066|   	pr_info("\t\t\tGoing to dup %d into %d\n", fd, dfd);
# 1067|-> 	if (dup2(fd, dfd) != dfd) {
# 1068|   		pr_perror("Can't dup local fd %d -> %d", fd, dfd);
# 1069|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
criu-4.0-build/criu-4.0/criu/fsnotify.c: scope_hint: In function ‘check_open_handle’
criu-4.0-build/criu-4.0/criu/fsnotify.c:94:27: warning[-Wanalyzer-malloc-leak]: leak of ‘alloc_openable(s_dev,  i_ino,  f_handle)’
criu-4.0-build/criu-4.0/include/common/bug.h:23:22: note: in definition of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/fsnotify.c:384:17: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/fsnotify.c:384:17: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/criu/include/imgset.h:5: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/fsnotify.c:386:17: note: in expansion of macro ‘pr_info’
criu-4.0-build/criu-4.0/criu/include/xmalloc.h:2: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/util.h:19: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/protobuf.h:8: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/fsnotify.h:6: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/fsnotify.c:24: included_from: Included from here.
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/fsnotify.c:176:40: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/fsnotify.c:176:40: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/fsnotify.c:176:40: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/criu/fsnotify.c: scope_hint: In function ‘check_open_handle’
criu-4.0-build/criu-4.0/include/common/compiler.h:51:41: note: in definition of macro ‘unlikely’
criu-4.0-build/criu-4.0/include/common/err.h:31:16: note: in expansion of macro ‘IS_ERR_VALUE’
criu-4.0-build/criu-4.0/criu/fsnotify.c: scope_hint: In function ‘check_open_handle’
#   92|   	memzero(handle, sizeof(*handle));
#   93|   
#   94|-> 	handle->type = img->type;
#   95|   	handle->bytes = img->bytes;
#   96|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
criu-4.0-build/criu-4.0/criu/fsnotify.c:130:22: warning[-Wanalyzer-malloc-leak]: leak of ‘alloc_openable(s_dev,  i_ino,  f_handle)’
criu-4.0-build/criu-4.0/include/common/bug.h:23:22: note: in definition of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/fsnotify.c:384:17: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/fsnotify.c:384:17: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/criu/fsnotify.c:386:17: note: in expansion of macro ‘pr_info’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/fsnotify.c:176:40: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/fsnotify.c:176:40: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/fsnotify.c:176:40: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/criu/fsnotify.c: scope_hint: In function ‘check_open_handle’
criu-4.0-build/criu-4.0/include/common/compiler.h:51:41: note: in definition of macro ‘unlikely’
criu-4.0-build/criu-4.0/include/common/err.h:31:16: note: in expansion of macro ‘IS_ERR_VALUE’
criu-4.0-build/criu-4.0/criu/fsnotify.c: scope_hint: In function ‘check_open_handle’
#  128|   		struct stat st;
#  129|   
#  130|-> 		if (m->s_dev != s_dev)
#  131|   			continue;
#  132|   		if (!mnt_is_dir(m))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def25]
criu-4.0-build/criu-4.0/criu/img-streamer.c: scope_hint: In function ‘establish_streamer_file_pipe’
criu-4.0-build/criu-4.0/criu/img-streamer.c:183:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
#  181|   	if (pipe(fds) < 0) {
#  182|   		pr_perror("Unable to create pipe");
#  183|-> 		return -1;
#  184|   	}
#  185|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def26]
criu-4.0-build/criu-4.0/criu/img-streamer.c:183:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
#  181|   	if (pipe(fds) < 0) {
#  182|   		pr_perror("Unable to create pipe");
#  183|-> 		return -1;
#  184|   	}
#  185|   

Error: CPPCHECK_WARNING (CWE-476): [#def27]
criu-4.0-build/criu-4.0/criu/include/image.h:146: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  144|   		return -1;
#  145|   
#  146|-> 	BUG_ON(bfd_buffered(&img->_x));
#  147|   	return img->_x.fd;
#  148|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def28]
criu-4.0-build/criu-4.0/criu/include/log.h:49:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(kdat_file, 0)’
criu-4.0-build/criu-4.0/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-4.0-build/criu-4.0/criu/kerndat.c:1237:17: note: in expansion of macro ‘pr_perror’
criu-4.0-build/criu-4.0/criu/kerndat.c:10: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-4.0-build/criu-4.0/criu/kerndat.c:1237:17: note: in expansion of macro ‘pr_perror’
criu-4.0-build/criu-4.0/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-4.0-build/criu-4.0/criu/kerndat.c:1237:17: note: in expansion of macro ‘pr_perror’
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
#   47|   #define pr_info(fmt, ...) print_on_level(LOG_INFO, LOG_PREFIX fmt, ##__VA_ARGS__)
#   48|   
#   49|-> #define pr_err(fmt, ...) print_on_level(LOG_ERROR, "Error (%s:%d): " LOG_PREFIX fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#   50|   
#   51|   #define pr_err_once(fmt, ...) print_once(LOG_ERROR, fmt, ##__VA_ARGS__)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
criu-4.0-build/criu-4.0/criu/mem.c: scope_hint: In function ‘premap_private_vma’
criu-4.0-build/criu-4.0/criu/include/log.h:49:26: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.0-build/criu-4.0/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-4.0-build/criu-4.0/criu/mem.c:927:25: note: in expansion of macro ‘pr_perror’
criu-4.0-build/criu-4.0/criu/include/cr_options.h:7: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/mem.c:1028:9: note: in expansion of macro ‘list_for_each_entry’
criu-4.0-build/criu-4.0/criu/include/xmalloc.h:2: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/pstree.h:7: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/mem.c:23: included_from: Included from here.
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/mem.c:875:28: note: in expansion of macro ‘xzalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/mem.c:875:28: note: in expansion of macro ‘xzalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/mem.c:875:28: note: in expansion of macro ‘xzalloc’
criu-4.0-build/criu-4.0/criu/mem.c: scope_hint: In function ‘premap_private_vma’
criu-4.0-build/criu-4.0/criu/mem.c:4: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-4.0-build/criu-4.0/criu/mem.c:927:25: note: in expansion of macro ‘pr_perror’
criu-4.0-build/criu-4.0/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-4.0-build/criu-4.0/criu/mem.c:927:25: note: in expansion of macro ‘pr_perror’
#   47|   #define pr_info(fmt, ...) print_on_level(LOG_INFO, LOG_PREFIX fmt, ##__VA_ARGS__)
#   48|   
#   49|-> #define pr_err(fmt, ...) print_on_level(LOG_ERROR, "Error (%s:%d): " LOG_PREFIX fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#   50|   
#   51|   #define pr_err_once(fmt, ...) print_once(LOG_ERROR, fmt, ##__VA_ARGS__)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def30]
criu-4.0-build/criu-4.0/criu/kerndat.c: scope_hint: In function ‘kerndat_try_load_cache’
criu-4.0-build/criu-4.0/criu/kerndat.c:1226:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(kdat_file, 0)’
# 1224|   		return ret;
# 1225|   
# 1226|-> 	fd = open(kdat_file, O_RDONLY);
# 1227|   	if (fd < 0) {
# 1228|   		if (ENOENT == errno)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def31]
criu-4.0-build/criu-4.0/criu/kerndat.c:1235:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(kdat_file, 0)’
# 1233|   	}
# 1234|   
# 1235|-> 	ret = read(fd, &kdat, sizeof(kdat));
# 1236|   	if (ret < 0) {
# 1237|   		pr_perror("Can't read kdat cache");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def32]
criu-4.0-build/criu-4.0/criu/net.c: scope_hint: In function ‘prep_ns_sockets’
criu-4.0-build/criu-4.0/criu/net.c:3398:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
# 3396|   #endif
# 3397|   
# 3398|-> 	ret = ns->net.seqsk = socket(PF_UNIX, SOCK_SEQPACKET | SOCK_NONBLOCK, 0);
# 3399|   	if (ret < 0) {
# 3400|   		pr_perror("Can't create seqsk for parasite");

Error: CPPCHECK_WARNING (CWE-476): [#def33]
criu-4.0-build/criu-4.0/criu/page-pipe.c:41: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#   39|   
#   40|   	ret /= PAGE_SIZE;
#   41|-> 	BUG_ON(ret < ppb->pipe_size);
#   42|   
#   43|   	pr_debug("Grow pipe %x -> %x\n", ppb->pipe_size, ret);

Error: CPPCHECK_WARNING (CWE-476): [#def34]
criu-4.0-build/criu-4.0/criu/page-pipe.c:242: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  240|   	struct page_pipe_buf *ppb, *n;
#  241|   
#  242|-> 	BUG_ON(!(pp->flags & PP_CHUNK_MODE));
#  243|   
#  244|   	pr_debug("Clean up page pipe\n");

Error: CPPCHECK_WARNING (CWE-476): [#def35]
criu-4.0-build/criu-4.0/criu/page-pipe.c:252: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  250|   
#  251|   	if (page_pipe_grow(pp, 0))
#  252|-> 		BUG(); /* It can't fail, because ppb is in free_bufs */
#  253|   }
#  254|   

Error: CPPCHECK_WARNING (CWE-476): [#def36]
criu-4.0-build/criu-4.0/criu/page-pipe.c:270: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  268|   	iov_init(&ppb->iov[ppb->nr_segs++], addr);
#  269|   	pp->free_iov++;
#  270|-> 	BUG_ON(pp->free_iov > pp->nr_iovs);
#  271|   out:
#  272|   	ppb->pages_in++;

Error: CPPCHECK_WARNING (CWE-476): [#def37]
criu-4.0-build/criu-4.0/criu/page-pipe.c:278: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  276|   static inline int try_add_page(struct page_pipe *pp, unsigned long addr, unsigned int flags)
#  277|   {
#  278|-> 	BUG_ON(list_empty(&pp->bufs));
#  279|   	return try_add_page_to(pp, list_entry(pp->bufs.prev, struct page_pipe_buf, l), addr, flags);
#  280|   }

Error: CPPCHECK_WARNING (CWE-476): [#def38]
criu-4.0-build/criu-4.0/criu/page-pipe.c:295: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  293|   
#  294|   	ret = try_add_page(pp, addr, flags);
#  295|-> 	BUG_ON(ret > 0);
#  296|   	return ret;
#  297|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def39]
criu-4.0-build/criu-4.0/criu/pie/restorer.c: scope_hint: In function ‘timerfd_arm’
criu-4.0-build/criu-4.0/criu/pie/restorer.c:1204:61: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ts.tv_sec’
# 1202|   			}
# 1203|   
# 1204|-> 			t->val.it_value.tv_sec += (time_t)ts.tv_sec;
# 1205|   
# 1206|   			pr_debug("Adjust id %x it_value(%llu, %llu) -> it_value(%llu, %llu)\n", t->id,

Error: GCC_ANALYZER_WARNING (CWE-465): [#def40]
criu-4.0-build/criu-4.0/criu/pie/util-vdso.c: scope_hint: In function ‘parse_elf_phdr’
criu-4.0-build/criu-4.0/criu/pie/util-vdso.c:125:28: warning[-Wanalyzer-deref-before-check]: check of ‘addr’ for NULL after already dereferencing it
criu-4.0-build/criu-4.0/criu/pie/util-vdso.c: scope_hint: In function ‘parse_elf_phdr’
criu-4.0-build/criu-4.0/criu/pie/util-vdso.c: scope_hint: In function ‘parse_elf_phdr’
criu-4.0-build/criu-4.0/criu/pie/util-vdso.c: scope_hint: In function ‘parse_elf_phdr’
#  123|   		switch (phdr->p_type) {
#  124|   		case PT_DYNAMIC:
#  125|-> 			if (*dynamic) {
#  126|   				pr_err("Second PT_DYNAMIC header\n");
#  127|   				return -EINVAL;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def41]
criu-4.0-build/criu-4.0/criu/pie/util-vdso.c:132:28: warning[-Wanalyzer-deref-before-check]: check of ‘addr’ for NULL after already dereferencing it
criu-4.0-build/criu-4.0/criu/pie/util-vdso.c: scope_hint: In function ‘parse_elf_phdr’
criu-4.0-build/criu-4.0/criu/pie/util-vdso.c: scope_hint: In function ‘parse_elf_phdr’
criu-4.0-build/criu-4.0/criu/pie/util-vdso.c: scope_hint: In function ‘parse_elf_phdr’
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
#  130|   			break;
#  131|   		case PT_LOAD:
#  132|-> 			if (*load) {
#  133|   				pr_err("Second PT_LOAD header\n");
#  134|   				return -EINVAL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def42]
criu-4.0-build/criu-4.0/criu/pipes.c:294:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-4.0-build/criu-4.0/criu/pipes.c:157:17: note: in expansion of macro ‘pr_info’
criu-4.0-build/criu-4.0/criu/pipes.c:312:9: note: in expansion of macro ‘list_for_each_entry’
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
#  292|   	if (inherited_fd(d, &tmp)) {
#  293|   		if (tmp < 0)
#  294|-> 			return tmp;
#  295|   
#  296|   		pi->reopen = 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def43]
criu-4.0-build/criu-4.0/criu/pipes.c: scope_hint: In function ‘open_pipe’
criu-4.0-build/criu-4.0/criu/pipes.c:294:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-4.0-build/criu-4.0/criu/pipes.c:157:17: note: in expansion of macro ‘pr_info’
criu-4.0-build/criu-4.0/criu/include/crtools.h:6: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/pipes.c:312:9: note: in expansion of macro ‘list_for_each_entry’
#  292|   	if (inherited_fd(d, &tmp)) {
#  293|   		if (tmp < 0)
#  294|-> 			return tmp;
#  295|   
#  296|   		pi->reopen = 1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def44]
criu-4.0-build/criu-4.0/criu/proc_parse.c: scope_hint: In function ‘parse_posix_timers’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2416:35: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘tidpid[0]’
criu-4.0-build/criu-4.0/include/common/compiler.h:51:41: note: in definition of macro ‘unlikely’
criu-4.0-build/criu-4.0/include/common/err.h:31:16: note: in expansion of macro ‘IS_ERR_VALUE’
criu-4.0-build/criu-4.0/criu/proc_parse.c: scope_hint: In function ‘parse_posix_timers’
criu-4.0-build/criu-4.0/criu/include/xmalloc.h:2: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/util.h:19: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/proc_parse.c:16: included_from: Included from here.
criu-4.0-build/criu-4.0/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2391:33: note: in expansion of macro ‘xzalloc’
criu-4.0-build/criu-4.0/include/common/compiler.h:51:41: note: in definition of macro ‘unlikely’
criu-4.0-build/criu-4.0/include/common/err.h:31:16: note: in expansion of macro ‘IS_ERR_VALUE’
criu-4.0-build/criu-4.0/criu/proc_parse.c: scope_hint: In function ‘parse_posix_timers’
criu-4.0-build/criu-4.0/include/common/compiler.h:51:41: note: in definition of macro ‘unlikely’
criu-4.0-build/criu-4.0/include/common/err.h:31:16: note: in expansion of macro ‘IS_ERR_VALUE’
criu-4.0-build/criu-4.0/criu/proc_parse.c: scope_hint: In function ‘parse_posix_timers’
# 2414|   			}
# 2415|   
# 2416|-> 			if (tidpid[0] == 't') {
# 2417|   				timer->spt.it_sigev_notify = SIGEV_THREAD_ID;
# 2418|   				timer->spt.notify_thread_id = pid_t;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
criu-4.0-build/criu-4.0/criu/proc_parse.c: scope_hint: In function ‘parse_cgroup_file’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2501:16: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.0-build/criu-4.0/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-4.0-build/criu-4.0/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2579:13: note: in expansion of macro ‘fopen_proc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2545:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2546:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-4.0-build/criu-4.0/include/common/list.h:211:20: note: in expansion of macro ‘list_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2555:17: note: in expansion of macro ‘list_for_each_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2555:17: note: in expansion of macro ‘list_for_each_entry’
# 2499|   int parse_cgroup_file(FILE *f, struct list_head *retl, unsigned int *n)
# 2500|   {
# 2501|-> 	while (fgets(buf, BUF_SIZE, f)) {
# 2502|   		struct cg_ctl *ncc, *cc;
# 2503|   		char *name, *path = NULL, *e;

Error: GCC_ANALYZER_WARNING (CWE-126): [#def46]
criu-4.0-build/criu-4.0/criu/proc_parse.c:2556:38: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
criu-4.0-build/criu-4.0/include/common/list.h:23:42: note: in definition of macro ‘LIST_HEAD’
criu-4.0-build/criu-4.0/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-4.0-build/criu-4.0/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2579:13: note: in expansion of macro ‘fopen_proc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2545:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2546:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-4.0-build/criu-4.0/include/common/list.h:211:20: note: in expansion of macro ‘list_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2555:17: note: in expansion of macro ‘list_for_each_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2555:17: note: in expansion of macro ‘list_for_each_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2556:38: note: read of 8 bytes from after the end of ‘internal’
# 2554|   
# 2555|   		list_for_each_entry(cc, retl, l)
# 2556|-> 			if (strcmp(cc->name, name) >= 0)
# 2557|   				break;
# 2558|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def47]
criu-4.0-build/criu-4.0/criu/proc_parse.c:2658:24: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/include/common/list.h:23:42: note: in definition of macro ‘LIST_HEAD’
criu-4.0-build/criu-4.0/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-4.0-build/criu-4.0/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2579:13: note: in expansion of macro ‘fopen_proc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2549:25: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2658:24: note: read of 8 bytes from after the end of ‘internal’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
# 2656|   
# 2657|   	list_for_each_entry_safe(c, n, l, l) {
# 2658|-> 		xfree(c->name);
# 2659|   		xfree(c->path);
# 2660|   		xfree(c);

Error: GCC_ANALYZER_WARNING (CWE-416): [#def48]
criu-4.0-build/criu-4.0/criu/proc_parse.c:2658:24: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘c’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-4.0-build/criu-4.0/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2579:13: note: in expansion of macro ‘fopen_proc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2545:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2546:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-4.0-build/criu-4.0/include/common/list.h:211:20: note: in expansion of macro ‘list_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2555:17: note: in expansion of macro ‘list_for_each_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2555:17: note: in expansion of macro ‘list_for_each_entry’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2660:17: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
# 2656|   
# 2657|   	list_for_each_entry_safe(c, n, l, l) {
# 2658|-> 		xfree(c->name);
# 2659|   		xfree(c->path);
# 2660|   		xfree(c);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def49]
criu-4.0-build/criu-4.0/criu/proc_parse.c:2659:24: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/include/common/list.h:23:42: note: in definition of macro ‘LIST_HEAD’
criu-4.0-build/criu-4.0/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-4.0-build/criu-4.0/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2579:13: note: in expansion of macro ‘fopen_proc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2549:25: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2659:24: note: read of 8 bytes from after the end of ‘internal’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
# 2657|   	list_for_each_entry_safe(c, n, l, l) {
# 2658|   		xfree(c->name);
# 2659|-> 		xfree(c->path);
# 2660|   		xfree(c);
# 2661|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def50]
criu-4.0-build/criu-4.0/criu/servicefd.c:186:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/servicefd.c:158:9: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/criu/servicefd.c: scope_hint: In function ‘install_service_fd’
#  184|   
#  185|   	set_bit(type, sfd_map);
#  186|-> 	close(fd);
#  187|   	return sfd;
#  188|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def51]
criu-4.0-build/criu-4.0/criu/servicefd.c: scope_hint: In function ‘move_service_fd’
criu-4.0-build/criu-4.0/criu/servicefd.c:236:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/servicefd.c:106:9: note: in expansion of macro ‘BUG_ON’
#  234|   		pr_err("%s busy target %d -> %d\n", sfd_type_name(type), old, new);
#  235|   		return -1;
#  236|-> 	} else if (!(rsti(me)->clone_flags & CLONE_FILES))
#  237|   		close(old);
#  238|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def52]
criu-4.0-build/criu-4.0/criu/servicefd.c:237:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/servicefd.c:106:9: note: in expansion of macro ‘BUG_ON’
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
#  235|   		return -1;
#  236|   	} else if (!(rsti(me)->clone_flags & CLONE_FILES))
#  237|-> 		close(old);
#  238|   
#  239|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def53]
criu-4.0-build/criu-4.0/criu/include/xmalloc.h:2: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/util.h:19: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/protobuf.h:8: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/sk-packet.c:19: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/sk-packet.c:213:33: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/sk-packet.c: scope_hint: In function ‘dump_one_packet_fd’
criu-4.0-build/criu-4.0/criu/sk-packet.c:164:9: note: in expansion of macro ‘pr_info’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/sk-packet.c:165:9: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/criu/sk-packet.c:61:9: note: in expansion of macro ‘pr_debug’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/sk-packet.c:62:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/sk-packet.c:62:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
#  211|   	xfree(psk.tx_ring);
#  212|   	for (i = 0; i < psk.n_mclist; i++)
#  213|-> 		xfree(psk.mclist[i]->addr.data);
#  214|   	xfree(psk.mclist);
#  215|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def54]
criu-4.0-build/criu-4.0/criu/sk-packet.c: scope_hint: In function ‘open_socket_map’
criu-4.0-build/criu-4.0/criu/sk-packet.c:343:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
criu-4.0-build/criu-4.0/include/common/bug.h:7: included_from: Included from here.
criu-4.0-build/criu-4.0/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-4.0-build/criu-4.0/include/common/list.h:211:20: note: in expansion of macro ‘list_entry’
criu-4.0-build/criu-4.0/criu/sk-packet.c:329:9: note: in expansion of macro ‘list_for_each_entry’
criu-4.0-build/criu-4.0/criu/include/files.h:10: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/sk-packet.c:11: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/sk-packet.c:329:9: note: in expansion of macro ‘list_for_each_entry’
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
#  341|   			}
#  342|   
#  343|-> 			vma->fd = fd;
#  344|   			return 0;
#  345|   		}

Error: GCC_ANALYZER_WARNING (CWE-666): [#def55]
criu-4.0-build/criu-4.0/criu/sk-unix.c: scope_hint: In function ‘open_unixsk_standalone’
criu-4.0-build/criu-4.0/criu/sk-unix.c:1931:21: warning[-Wanalyzer-fd-phase-mismatch]: ‘listen’ on file descriptor ‘sk’ in wrong phase
criu-4.0-build/criu-4.0/criu/sk-unix.c:1930:17: note: in expansion of macro ‘pr_info’
# 1929|   	if (ui->ue->state == TCP_LISTEN) {
# 1930|   		pr_info("\tPutting %u into listen state\n", ui->ue->ino);
# 1931|-> 		if (listen(sk, ui->ue->backlog) < 0) {
# 1932|   			pr_perror("Can't make usk listen");
# 1933|   			close(sk);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def56]
criu-4.0-build/criu-4.0/criu/sk-unix.c: scope_hint: In function ‘collect_one_unixsk’
criu-4.0-build/criu-4.0/criu/sk-unix.c:2135:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘uname’
# 2133|   	uname = ui->name;
# 2134|   	ulen = ui->ue->name.len;
# 2135|-> 	if (ulen > 0 && uname[0] == 0) {
# 2136|   		prefix = "@";
# 2137|   		uname++;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def57]
criu-4.0-build/criu-4.0/criu/tls.c: scope_hint: In function ‘tls_recv_data_to_fd’
criu-4.0-build/criu-4.0/criu/tls.c:195:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘packet’
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
#  193|   	}
#  194|   err:
#  195|-> 	gnutls_packet_deinit(packet);
#  196|   	return (len > 0);
#  197|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
criu-4.0-build/criu-4.0/criu/util.c: scope_hint: In function ‘reopen_fd_as_safe’
criu-4.0-build/criu-4.0/criu/util.c:229:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-4.0-build/criu-4.0/criu/util.c: scope_hint: In function ‘reopen_fd_as_safe’
criu-4.0-build/criu-4.0/criu/util.c:604:31: note: in expansion of macro ‘DUP_SAFE’
criu-4.0-build/criu-4.0/criu/util.c:604:31: note: in expansion of macro ‘DUP_SAFE’
criu-4.0-build/criu-4.0/criu/util.c:36: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/util.c:629:21: note: in expansion of macro ‘reopen_fd_as_nocheck’
criu-4.0-build/criu-4.0/criu/util.c:629:21: note: in expansion of macro ‘reopen_fd_as_nocheck’
criu-4.0-build/criu-4.0/criu/util.c:6: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-4.0-build/criu-4.0/criu/util.c:226:25: note: in expansion of macro ‘pr_perror’
#  227|   	}
#  228|   
#  229|-> 	return ret;
#  230|   }
#  231|   

Error: GCC_ANALYZER_WARNING: [#def59]
criu-4.0-build/criu-4.0/criu/util.c:240:31: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘new_fd’
criu-4.0-build/criu-4.0/criu/util.c: scope_hint: In function ‘reopen_fd_as_safe’
criu-4.0-build/criu-4.0/criu/util.c:604:31: note: in expansion of macro ‘DUP_SAFE’
criu-4.0-build/criu-4.0/criu/util.c:604:31: note: in expansion of macro ‘DUP_SAFE’
criu-4.0-build/criu-4.0/criu/util.c:629:21: note: in expansion of macro ‘reopen_fd_as_nocheck’
criu-4.0-build/criu-4.0/criu/util.c:629:21: note: in expansion of macro ‘reopen_fd_as_nocheck’
#  238|   			tmp = fcntl(old_fd, F_DUPFD, new_fd);
#  239|   		else
#  240|-> 			tmp = dup2(old_fd, new_fd);
#  241|   		if (tmp < 0) {
#  242|   			pr_perror("Dup %d -> %d failed (called at %s:%d)", old_fd, new_fd, file, line);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def60]
criu-4.0-build/criu-4.0/criu/util.c: scope_hint: In function ‘cr_system_userns’
criu-4.0-build/criu-4.0/criu/util.c:620:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘0’
criu-4.0-build/criu-4.0/criu/util.c: scope_hint: In function ‘cr_system_userns’
criu-4.0-build/criu-4.0/criu/util.c:604:31: note: in expansion of macro ‘DUP_SAFE’
criu-4.0-build/criu-4.0/criu/util.c:604:31: note: in expansion of macro ‘DUP_SAFE’
#  618|   
#  619|   		if (in < 0) {
#  620|-> 			close(STDIN_FILENO);
#  621|   		} else {
#  622|   			if (reopen_fd_as_nocheck(STDIN_FILENO, in))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def61]
criu-4.0-build/criu-4.0/criu/util.c:1744:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
# 1742|   	close_safe(&pfd[1]);
# 1743|   	close_safe(&pfd[0]);
# 1744|-> 	return ret;
# 1745|   }
# 1746|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def62]
criu-4.0-build/criu-4.0/criu/util.c: scope_hint: In function ‘is_iptables_nft’
criu-4.0-build/criu-4.0/criu/util.c:1744:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
# 1742|   	close_safe(&pfd[1]);
# 1743|   	close_safe(&pfd[0]);
# 1744|-> 	return ret;
# 1745|   }
# 1746|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
criu-4.0-build/criu-4.0/criu/include/util.h:20: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/proc_parse.c: scope_hint: In function ‘parse_threads’
criu-4.0-build/criu-4.0/include/common/bug.h:23:20: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2494:17: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-4.0-build/criu-4.0/criu/include/util.h:102:28: note: in expansion of macro ‘open_proc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2462:15: note: in expansion of macro ‘opendir_proc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2474:31: note: in expansion of macro ‘xrealloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2474:31: note: in expansion of macro ‘xrealloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2474:31: note: in expansion of macro ‘xrealloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:22:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2474:31: note: in expansion of macro ‘xrealloc’
criu-4.0-build/criu-4.0/include/common/bug.h:23:22: note: in definition of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2494:17: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2494:17: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2494:17: note: in expansion of macro ‘BUG_ON’
#   21|   #define BUG_ON_HANDLER(condition)                                                \
#   22|   	do {                                                                     \
#   23|-> 		if ((condition)) {                                               \
#   24|   			pr_err("BUG at %s:%d\n", __FILE__, __LINE__);            \
#   25|   			__raise();                                               \

Error: GCC_ANALYZER_WARNING (CWE-476): [#def64]
criu-4.0-build/criu-4.0/compel/plugins/std/fds.c:11: included_from: Included from here.
criu-4.0-build/criu-4.0/include/common/scm-code.c: scope_hint: In function ‘__recv_fds’
criu-4.0-build/criu-4.0/include/common/bug.h:26:57: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/include/common/scm-code.c:106:17: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/include/common/compiler.h:97:36: note: in definition of macro ‘min’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/include/common/scm-code.c:106:17: note: in expansion of macro ‘BUG_ON’
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
#   24|   			pr_err("BUG at %s:%d\n", __FILE__, __LINE__);            \
#   25|   			__raise();                                               \
#   26|-> 			*(volatile unsigned long *)NULL = 0xdead0000 + __LINE__; \
#   27|   			__builtin_unreachable();                                 \
#   28|   		}                                                                \

Error: GCC_ANALYZER_WARNING (CWE-457): [#def65]
criu-4.0-build/criu-4.0/criu/proc_parse.c: scope_hint: In function ‘put_ctls’
criu-4.0-build/criu-4.0/include/common/compiler.h:79:52: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*n.l.next’
criu-4.0-build/criu-4.0/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-4.0-build/criu-4.0/include/common/list.h:234:51: note: in expansion of macro ‘list_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/list.h:23:42: note: in definition of macro ‘LIST_HEAD’
criu-4.0-build/criu-4.0/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-4.0-build/criu-4.0/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2579:13: note: in expansion of macro ‘fopen_proc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2549:25: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-4.0-build/criu-4.0/include/common/list.h:234:51: note: in expansion of macro ‘list_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
#   77|   #define container_of(ptr, type, member)                            \
#   78|   	({                                                         \
#   79|-> 		const typeof(((type *)0)->member) *__mptr = (ptr); \
#   80|   		(type *)((char *)__mptr - offsetof(type, member)); \
#   81|   	})

Error: GCC_ANALYZER_WARNING (CWE-476): [#def66]
criu-4.0-build/criu-4.0/compel/plugins/std/infect.c:5: included_from: Included from here.
criu-4.0-build/criu-4.0/include/common/lock.h: scope_hint: In function ‘futex_set_and_wake’
criu-4.0-build/criu-4.0/include/common/lock.h:16:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.0-build/criu-4.0/include/common/lock.h:81:9: note: in expansion of macro ‘LOCK_BUG_ON’
criu-4.0-build/criu-4.0/include/common/lock.h:81:9: note: in expansion of macro ‘LOCK_BUG_ON’
criu-4.0-build/criu-4.0/include/common/lock.h:81:9: note: in expansion of macro ‘LOCK_BUG_ON’
criu-4.0-build/criu-4.0/include/common/lock.h:81:9: note: in expansion of macro ‘LOCK_BUG_ON’
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
#   14|   #define LOCK_BUG_ON(condition) \
#   15|   	if ((condition))       \
#   16|-> 	*(volatile unsigned long *)NULL = 0xdead0000 + __LINE__
#   17|   #define LOCK_BUG() LOCK_BUG_ON(1)
#   18|   #endif /* __clang_analyzer__ */

Error: CPPCHECK_WARNING (CWE-476): [#def67]
criu-4.0-build/criu-4.0/include/common/lock.h:81: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#   79|   {
#   80|   	atomic_set(&f->raw, (int)v);
#   81|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAKE, INT_MAX, NULL, NULL, 0) < 0);
#   82|   }
#   83|   

Error: CPPCHECK_WARNING (CWE-476): [#def68]
criu-4.0-build/criu-4.0/include/common/lock.h:87: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#   85|   static inline void futex_wake(futex_t *f)
#   86|   {
#   87|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAKE, INT_MAX, NULL, NULL, 0) < 0);
#   88|   }
#   89|   

Error: CPPCHECK_WARNING (CWE-476): [#def69]
criu-4.0-build/criu-4.0/include/common/lock.h:101: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#   99|   {
#  100|   	atomic_dec(&f->raw);
#  101|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAKE, INT_MAX, NULL, NULL, 0) < 0);
#  102|   }
#  103|   

Error: CPPCHECK_WARNING (CWE-476): [#def70]
criu-4.0-build/criu-4.0/include/common/lock.h:108: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  106|   {
#  107|   	atomic_inc(&f->raw);
#  108|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAKE, INT_MAX, NULL, NULL, 0) < 0);
#  109|   }
#  110|   

Error: CPPCHECK_WARNING (CWE-476): [#def71]
criu-4.0-build/criu-4.0/include/common/lock.h:140: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  138|   	while ((uint32_t)atomic_read(&f->raw) == v) {
#  139|   		int ret = sys_futex((uint32_t *)&f->raw.counter, FUTEX_WAIT, v, NULL, NULL, 0);
#  140|-> 		LOCK_BUG_ON(ret < 0 && ret != -EWOULDBLOCK);
#  141|   	}
#  142|   }

Error: CPPCHECK_WARNING (CWE-476): [#def72]
criu-4.0-build/criu-4.0/include/common/lock.h:161: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  159|   	while ((c = (uint32_t)atomic_inc_return(&m->raw)) != 1) {
#  160|   		ret = sys_futex((uint32_t *)&m->raw.counter, FUTEX_WAIT, c, NULL, NULL, 0);
#  161|-> 		LOCK_BUG_ON(ret < 0 && ret != -EWOULDBLOCK);
#  162|   	}
#  163|   }

Error: CPPCHECK_WARNING (CWE-476): [#def73]
criu-4.0-build/criu-4.0/include/common/lock.h:169: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  167|   	uint32_t c = 0;
#  168|   	atomic_set(&m->raw, (int)c);
#  169|-> 	LOCK_BUG_ON(sys_futex((uint32_t *)&m->raw.counter, FUTEX_WAKE, 1, NULL, NULL, 0) < 0);
#  170|   }
#  171|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def74]
criu-4.0-build/criu-4.0/include/common/scm-code.c:13:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cmsg’
criu-4.0-build/criu-4.0/include/common/scm-code.c: scope_hint: In function ‘send_fds’
criu-4.0-build/criu-4.0/compel/plugins/include/uapi/std/infect.h:4: included_from: Included from here.
criu-4.0-build/criu-4.0/compel/plugins/include/uapi/std.h:7: included_from: Included from here.
criu-4.0-build/criu-4.0/compel/plugins/std/fds.c:4: included_from: Included from here.
criu-4.0-build/criu-4.0/include/common/compiler.h:97:36: note: in definition of macro ‘min’
#   11|   
#   12|   	cmsg = CMSG_FIRSTHDR(&fdset->hdr);
#   13|-> 	cmsg->cmsg_len = fdset->hdr.msg_controllen;
#   14|   
#   15|   	if (data) {

Error: CPPCHECK_WARNING (CWE-476): [#def75]
criu-4.0-build/criu-4.0/include/common/scm-code.c:106: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  104|   		 * sys_write_ helpers. Meawhile opencoded BUG_ON here.
#  105|   		 */
#  106|-> 		BUG_ON(min_fd > CR_SCM_MAX_FD);
#  107|   
#  108|   		if (unlikely(min_fd <= 0))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:36: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-4.0-build/criu-4.0/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2579:13: note: in expansion of macro ‘fopen_proc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2545:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2546:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-4.0-build/criu-4.0/include/common/list.h:211:20: note: in expansion of macro ‘list_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2555:17: note: in expansion of macro ‘list_for_each_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2555:17: note: in expansion of macro ‘list_for_each_entry’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
#   18|   
#   19|   #define xstrdup(str)	  __xalloc(strdup, strlen(str) + 1, str)
#   20|-> #define xmalloc(size)	  __xalloc(malloc, size, size)
#   21|   #define xzalloc(size)	  __xalloc(calloc, size, 1, size)
#   22|   #define xrealloc(p, size) __xalloc(realloc, size, p, size)

Error: GCC_ANALYZER_WARNING (CWE-415): [#def77]
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:18: warning[-Wanalyzer-double-free]: double-‘free’ of ‘((struct eventpoll_dinfo)*((struct list_head *)dinfo)).fe’
criu-4.0-build/criu-4.0/criu/eventpoll.c:115:9: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/include/imgset.h:20:9: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/criu/eventpoll.c:115:9: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/criu/eventpoll.c:178:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/eventpoll.c:115:9: note: in expansion of macro ‘xfree’
#   22|   #define xrealloc(p, size) __xalloc(realloc, size, p, size)
#   23|   
#   24|-> #define xfree(p) free(p)
#   25|   
#   26|   #define xrealloc_safe(pptr, size)                  \

Error: GCC_ANALYZER_WARNING (CWE-415): [#def78]
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:18: warning[-Wanalyzer-double-free]: double-‘free’ of ‘((struct eventpoll_dinfo)*((struct list_head *)dinfo)).toff’
criu-4.0-build/criu-4.0/criu/eventpoll.c:118:9: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/include/imgset.h:20:9: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/criu/eventpoll.c:118:9: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/criu/eventpoll.c:178:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/eventpoll.c:118:9: note: in expansion of macro ‘xfree’
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
#   22|   #define xrealloc(p, size) __xalloc(realloc, size, p, size)
#   23|   
#   24|-> #define xfree(p) free(p)
#   25|   
#   26|   #define xrealloc_safe(pptr, size)                  \

Error: GCC_ANALYZER_WARNING (CWE-415): [#def79]
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:18: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*((struct eventpoll_dinfo)*((struct list_head *)dinfo)).e.tfd’
criu-4.0-build/criu-4.0/criu/eventpoll.c:116:9: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-4.0-build/criu-4.0/criu/include/imgset.h:20:9: note: in expansion of macro ‘BUG_ON’
criu-4.0-build/criu-4.0/criu/eventpoll.c:116:9: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/criu/eventpoll.c:178:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/eventpoll.c:116:9: note: in expansion of macro ‘xfree’
#   22|   #define xrealloc(p, size) __xalloc(realloc, size, p, size)
#   23|   
#   24|-> #define xfree(p) free(p)
#   25|   
#   26|   #define xrealloc_safe(pptr, size)                  \

Error: GCC_ANALYZER_WARNING (CWE-415): [#def80]
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:18: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*c.name’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2658:17: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-4.0-build/criu-4.0/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2579:13: note: in expansion of macro ‘fopen_proc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2545:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2545:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2545:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2546:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-4.0-build/criu-4.0/include/common/list.h:211:20: note: in expansion of macro ‘list_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2555:17: note: in expansion of macro ‘list_for_each_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2555:17: note: in expansion of macro ‘list_for_each_entry’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2658:17: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2658:17: note: in expansion of macro ‘xfree’
#   22|   #define xrealloc(p, size) __xalloc(realloc, size, p, size)
#   23|   
#   24|-> #define xfree(p) free(p)
#   25|   
#   26|   #define xrealloc_safe(pptr, size)                  \

Error: GCC_ANALYZER_WARNING (CWE-415): [#def81]
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:18: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*c.path’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2659:17: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-4.0-build/criu-4.0/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2579:13: note: in expansion of macro ‘fopen_proc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2545:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2546:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2546:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2546:29: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-4.0-build/criu-4.0/include/common/list.h:211:20: note: in expansion of macro ‘list_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2555:17: note: in expansion of macro ‘list_for_each_entry’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2555:17: note: in expansion of macro ‘list_for_each_entry’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2659:17: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2659:17: note: in expansion of macro ‘xfree’
#   22|   #define xrealloc(p, size) __xalloc(realloc, size, p, size)
#   23|   
#   24|-> #define xfree(p) free(p)
#   25|   
#   26|   #define xrealloc_safe(pptr, size)                  \

Error: GCC_ANALYZER_WARNING (CWE-775): [#def82]
criu-4.0-build/criu-4.0/criu/include/xmalloc.h:2: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/page-pipe.c: scope_hint: In function ‘ppb_alloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor
criu-4.0-build/criu-4.0/criu/page-pipe.c:126:25: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/page-pipe.c:104:15: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/criu/page-pipe.c:126:25: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/page-pipe.c:126:25: note: in expansion of macro ‘xfree’
#   22|   #define xrealloc(p, size) __xalloc(realloc, size, p, size)
#   23|   
#   24|-> #define xfree(p) free(p)
#   25|   
#   26|   #define xrealloc_safe(pptr, size)                  \

Error: GCC_ANALYZER_WARNING (CWE-590): [#def83]
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:18: warning[-Wanalyzer-free-of-non-heap]: ‘free’ of ‘c’ which points to memory on the stack
criu-4.0-build/criu-4.0/criu/proc_parse.c:2660:17: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/include/common/list.h:23:42: note: in definition of macro ‘LIST_HEAD’
criu-4.0-build/criu-4.0/include/common/list.h:23:42: note: in definition of macro ‘LIST_HEAD’
criu-4.0-build/criu-4.0/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-4.0-build/criu-4.0/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2579:13: note: in expansion of macro ‘fopen_proc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2505:23: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2549:25: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2657:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/proc_parse.c:2660:17: note: in expansion of macro ‘xfree’
#   22|   #define xrealloc(p, size) __xalloc(realloc, size, p, size)
#   23|   
#   24|-> #define xfree(p) free(p)
#   25|   
#   26|   #define xrealloc_safe(pptr, size)                  \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
criu-4.0-build/criu-4.0/criu/include/xmalloc.h:2: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/plugin.c:11: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/plugin.c: scope_hint: In function ‘cr_lib_load’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:18: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-4.0-build/criu-4.0/criu/plugin.c:175:17: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/plugin.c:29:13: note: in expansion of macro ‘xzalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/plugin.c:33:19: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/plugin.c:33:19: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/plugin.c:33:19: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/plugin.c:33:19: note: in expansion of macro ‘xstrdup’
criu-4.0-build/criu-4.0/criu/plugin.c:50:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:51:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:51:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:52:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:52:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:53:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:53:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:54:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:54:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:55:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:55:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:56:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:56:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:57:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:57:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:58:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:58:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:59:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:59:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:60:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:60:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:61:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/criu/plugin.c:61:9: note: in expansion of macro ‘__assign_hook’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/plugin.c:133:16: note: in expansion of macro ‘xzalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/plugin.c:133:16: note: in expansion of macro ‘xzalloc’
criu-4.0-build/criu-4.0/criu/include/criu-log.h:23: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/servicefd.h:10: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/image.h:7: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/include/cr_options.h:9: included_from: Included from here.
criu-4.0-build/criu-4.0/criu/plugin.c:9: included_from: Included from here.
criu-4.0-build/criu-4.0/include/common/xmalloc.h:15:25: note: in expansion of macro ‘pr_err’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/plugin.c:133:16: note: in expansion of macro ‘xzalloc’
criu-4.0-build/criu-4.0/criu/plugin.c:175:17: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/criu/plugin.c:175:17: note: in expansion of macro ‘xfree’
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
#   22|   #define xrealloc(p, size) __xalloc(realloc, size, p, size)
#   23|   
#   24|-> #define xfree(p) free(p)
#   25|   
#   26|   #define xrealloc_safe(pptr, size)                  \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
criu-4.0-build/criu-4.0/criu/page-pipe.c: scope_hint: In function ‘create_page_pipe’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:24:18: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-4.0-build/criu-4.0/criu/page-pipe.c:219:9: note: in expansion of macro ‘xfree’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/page-pipe.c:193:14: note: in expansion of macro ‘xzalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/page-pipe.c:203:24: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/page-pipe.c:203:24: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/page-pipe.c:203:24: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-4.0-build/criu-4.0/criu/page-pipe.c:203:24: note: in expansion of macro ‘xmalloc’
criu-4.0-build/criu-4.0/criu/page-pipe.c:219:9: note: in expansion of macro ‘xfree’
#   22|   #define xrealloc(p, size) __xalloc(realloc, size, p, size)
#   23|   
#   24|-> #define xfree(p) free(p)
#   25|   
#   26|   #define xrealloc_safe(pptr, size)                  \

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-194.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namecriu-4.0-2.fc42
store-results-to/tmp/tmpgilw1dzl/criu-4.0-2.fc42.tar.xz
time-created2024-11-12 23:26:13
time-finished2024-11-12 23:30:45
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpgilw1dzl/criu-4.0-2.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpgilw1dzl/criu-4.0-2.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9