criu-3.19-5.fc41

List of Defects

Error: CPPCHECK_WARNING: [#def1]
criu-3.19-build/criu-3.19/compel/arch/x86/src/lib/cpu.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def2]
criu-3.19-build/criu-3.19/compel/plugins/std/fds.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-476): [#def3]
criu-3.19-build/criu-3.19/compel/plugins/std/infect.c:101: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#   99|   	fini_sigreturn(new_sp);
#  100|   
#  101|-> 	BUG();
#  102|   
#  103|   	return -1;

Error: CPPCHECK_WARNING (CWE-476): [#def4]
criu-3.19-build/criu-3.19/compel/plugins/std/infect.c:186: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  184|   	futex_set_and_wake(&args->daemon_connected, ret);
#  185|   	fini();
#  186|-> 	BUG();
#  187|   
#  188|   	return -1;

Error: CPPCHECK_WARNING: [#def5]
criu-3.19-build/criu-3.19/compel/plugins/std/log.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def6]
criu-3.19-build/criu-3.19/compel/src/lib/handle-elf.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def7]
criu-3.19-build/criu-3.19/compel/src/lib/infect.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-476): [#def8]
criu-3.19-build/criu-3.19/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): [#def9]
criu-3.19-build/criu-3.19/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): [#def10]
criu-3.19-build/criu-3.19/compel/src/lib/infect.c:923: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  921|   			*where = elf_relocs[i].value + elf_relocs[i].addend + (unsigned long)vbase;
#  922|   		} else
#  923|-> 			BUG();
#  924|   	}
#  925|   #endif

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

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

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

Error: CPPCHECK_WARNING (CWE-476): [#def14]
criu-3.19-build/criu-3.19/compel/src/lib/infect.c:1521: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
# 1519|   void *compel_parasite_args_s(struct parasite_ctl *ctl, unsigned long args_size)
# 1520|   {
# 1521|-> 	BUG_ON(args_size > ctl->args_size);
# 1522|   	return compel_parasite_args_p(ctl);
# 1523|   }

Error: CLANG_WARNING: [#def15]
criu-3.19-build/criu-3.19/compel/src/lib/ptrace.c:72:7: warning[core.CallAndMessage]: 4th function call argument is an uninitialized value
#   70|   		unsigned long *s = src, *a = addr;
#   71|   
#   72|-> 		if (ptrace(PTRACE_POKEDATA, pid, a + w, s[w])) {
#   73|   			pr_perror("POKEDATA failed");
#   74|   			goto err;

Error: CPPCHECK_WARNING: [#def16]
criu-3.19-build/criu-3.19/compel/src/main.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def17]
criu-3.19-build/criu-3.19/compel/src/main.c:77:7: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#   75|   	int fd, ret = -1;
#   76|   
#   77|-> 	fd = open(opts.input_filename, O_RDONLY);
#   78|   	if (fd < 0) {
#   79|   		pr_perror("Can't open file %s", opts.input_filename);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def18]
criu-3.19-build/criu-3.19/compel/src/main.c: scope_hint: In function ‘gen_prefix’
criu-3.19-build/criu-3.19/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-126): [#def19]
criu-3.19-build/criu-3.19/criu/cr-dump.c: scope_hint: In function ‘free_mappings’
criu-3.19-build/criu-3.19/criu/cr-dump.c:111:30: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
criu-3.19-build/criu-3.19/criu/cr-dump.c: scope_hint: In function ‘free_mappings’
criu-3.19-build/criu-3.19/criu/cr-dump.c:53: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/cr-dump.c:2210:9: note: in expansion of macro ‘for_each_pstree_item’
criu-3.19-build/criu-3.19/criu/cr-dump.c:2210:9: note: in expansion of macro ‘for_each_pstree_item’
criu-3.19-build/criu-3.19/criu/include/xmalloc.h:1: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/util.h:19: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/cr-dump.c:1556:9: note: in expansion of macro ‘pr_info’
criu-3.19-build/criu-3.19/criu/cr-dump.c:32: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/cr-dump.c:110:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/criu/cr-dump.c:111:30: note: read of 1 bit from after the end of ‘vmas’
#                                                 └───────────────────────┘
#                                                             ^
#  109|   
#  110|   	list_for_each_entry_safe(vma_area, p, &vma_area_list->h, list) {
#  111|-> 		if (!vma_area->file_borrowed)
#  112|   			free(vma_area->vmst);
#  113|   		free(vma_area);

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

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

Error: GCC_ANALYZER_WARNING (CWE-416): [#def22]
criu-3.19-build/criu-3.19/criu/eventpoll.c: scope_hint: In function ‘dequeue_dinfo’
criu-3.19-build/criu-3.19/criu/eventpoll.c:112:30: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘dinfo’
criu-3.19-build/criu-3.19/criu/include/crtools.h:6: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/eventpoll.c:15: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/include/imgset.h:20:9: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/criu/include/xmalloc.h:2: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/util.h:19: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/eventpoll.c:22: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/eventpoll.c:122:9: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/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): [#def23]
criu-3.19-build/criu-3.19/criu/eventpoll.c:112:33: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘*dinfo.e’
criu-3.19-build/criu-3.19/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/include/imgset.h:20:9: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/criu/eventpoll.c:117:9: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/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): [#def24]
criu-3.19-build/criu-3.19/criu/files-reg.c: scope_hint: In function ‘validate_with_build_id’
criu-3.19-build/criu-3.19/criu/files-reg.c:2135:24: warning[-Wanalyzer-malloc-leak]: leak of ‘build_id’
criu-3.19-build/criu-3.19/criu/include/xmalloc.h:2: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/pstree.h:7: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/files-reg.c:50: included_from: Included from here.
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/files-reg.c:1547:38: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/files-reg.c:1547:38: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/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): [#def25]
criu-3.19-build/criu-3.19/criu/files.c:1067:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd,  dfd)’
criu-3.19-build/criu-3.19/include/common/bug.h:23:22: note: in definition of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/files.c:1064:9: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/files.c:1064:9: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/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): [#def26]
criu-3.19-build/criu-3.19/criu/fsnotify.c: scope_hint: In function ‘check_open_handle’
criu-3.19-build/criu-3.19/criu/fsnotify.c:94:27: warning[-Wanalyzer-malloc-leak]: leak of ‘alloc_openable(s_dev,  i_ino,  f_handle)’
criu-3.19-build/criu-3.19/include/common/bug.h:23:22: note: in definition of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/fsnotify.c:384:17: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/fsnotify.c:384:17: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/criu/include/imgset.h:5: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/fsnotify.c:386:17: note: in expansion of macro ‘pr_info’
criu-3.19-build/criu-3.19/criu/include/xmalloc.h:2: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/util.h:19: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/protobuf.h:8: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/fsnotify.h:6: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/fsnotify.c:24: included_from: Included from here.
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/fsnotify.c:176:40: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/fsnotify.c:176:40: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/fsnotify.c:176:40: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/criu/fsnotify.c: scope_hint: In function ‘check_open_handle’
criu-3.19-build/criu-3.19/include/common/compiler.h:51:41: note: in definition of macro ‘unlikely’
criu-3.19-build/criu-3.19/include/common/err.h:31:16: note: in expansion of macro ‘IS_ERR_VALUE’
criu-3.19-build/criu-3.19/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): [#def27]
criu-3.19-build/criu-3.19/criu/fsnotify.c:130:22: warning[-Wanalyzer-malloc-leak]: leak of ‘alloc_openable(s_dev,  i_ino,  f_handle)’
criu-3.19-build/criu-3.19/include/common/bug.h:23:22: note: in definition of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/fsnotify.c:384:17: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/fsnotify.c:384:17: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/criu/fsnotify.c:386:17: note: in expansion of macro ‘pr_info’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/fsnotify.c:176:40: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/fsnotify.c:176:40: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/fsnotify.c:176:40: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/criu/fsnotify.c: scope_hint: In function ‘check_open_handle’
criu-3.19-build/criu-3.19/include/common/compiler.h:51:41: note: in definition of macro ‘unlikely’
criu-3.19-build/criu-3.19/include/common/err.h:31:16: note: in expansion of macro ‘IS_ERR_VALUE’
criu-3.19-build/criu-3.19/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): [#def28]
criu-3.19-build/criu-3.19/criu/img-streamer.c: scope_hint: In function ‘establish_streamer_file_pipe’
criu-3.19-build/criu-3.19/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): [#def29]
criu-3.19-build/criu-3.19/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): [#def30]
criu-3.19-build/criu-3.19/criu/include/image.h:143: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)NULL
#  141|   		return -1;
#  142|   
#  143|-> 	BUG_ON(bfd_buffered(&img->_x));
#  144|   	return img->_x.fd;
#  145|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def31]
criu-3.19-build/criu-3.19/criu/include/log.h:49:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(kdat_file, 0)’
criu-3.19-build/criu-3.19/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-3.19-build/criu-3.19/criu/kerndat.c:1195:17: note: in expansion of macro ‘pr_perror’
criu-3.19-build/criu-3.19/criu/kerndat.c:10: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-3.19-build/criu-3.19/criu/kerndat.c:1195:17: note: in expansion of macro ‘pr_perror’
criu-3.19-build/criu-3.19/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-3.19-build/criu-3.19/criu/kerndat.c:1195: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): [#def32]
criu-3.19-build/criu-3.19/criu/mem.c: scope_hint: In function ‘premap_private_vma’
criu-3.19-build/criu-3.19/criu/include/log.h:49:26: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-3.19-build/criu-3.19/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-3.19-build/criu-3.19/criu/mem.c:883:25: note: in expansion of macro ‘pr_perror’
criu-3.19-build/criu-3.19/criu/include/cr_options.h:7: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/mem.c:975:9: note: in expansion of macro ‘list_for_each_entry’
criu-3.19-build/criu-3.19/criu/include/xmalloc.h:2: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/pstree.h:7: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/mem.c:23: included_from: Included from here.
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/mem.c:839:28: note: in expansion of macro ‘xzalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/mem.c:839:28: note: in expansion of macro ‘xzalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/mem.c:839:28: note: in expansion of macro ‘xzalloc’
criu-3.19-build/criu-3.19/criu/mem.c: scope_hint: In function ‘premap_private_vma’
criu-3.19-build/criu-3.19/criu/mem.c:4: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-3.19-build/criu-3.19/criu/mem.c:883:25: note: in expansion of macro ‘pr_perror’
criu-3.19-build/criu-3.19/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-3.19-build/criu-3.19/criu/mem.c:883: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): [#def33]
criu-3.19-build/criu-3.19/criu/kerndat.c: scope_hint: In function ‘kerndat_try_load_cache’
criu-3.19-build/criu-3.19/criu/kerndat.c:1184:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(kdat_file, 0)’
# 1182|   		return ret;
# 1183|   
# 1184|-> 	fd = open(kdat_file, O_RDONLY);
# 1185|   	if (fd < 0) {
# 1186|   		if (ENOENT == errno)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def34]
criu-3.19-build/criu-3.19/criu/kerndat.c:1193:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(kdat_file, 0)’
# 1191|   	}
# 1192|   
# 1193|-> 	ret = read(fd, &kdat, sizeof(kdat));
# 1194|   	if (ret < 0) {
# 1195|   		pr_perror("Can't read kdat cache");

Error: COMPILER_WARNING: [#def35]
criu-3.19-build/criu-3.19/criu/net.c: scope_hint: In function ‘unix_conf_op’
criu-3.19-build/criu-3.19/criu/net.c:236:32: warning[-Wformat-truncation=]: ‘net/unix/’ directive output truncated writing 9 bytes into a region of size 0
#  236 | #define CONF_UNIX_BASE         "net/unix"
#      |                                ^~~~~~~~~~
criu-3.19-build/criu-3.19/criu/net.c:237:32: note: in expansion of macro ‘CONF_UNIX_BASE’
#  237 | #define CONF_UNIX_FMT          CONF_UNIX_BASE "/%s"
#      |                                ^~~~~~~~~~~~~~
criu-3.19-build/criu-3.19/criu/net.c:378:55: note: in expansion of macro ‘CONF_UNIX_FMT’
#  378 |                 snprintf(path[i], MAX_CONF_UNIX_PATH, CONF_UNIX_FMT, unix_conf_entries[i]);
#      |                                                       ^~~~~~~~~~~~~
criu-3.19-build/criu-3.19/criu/net.c:236:33: note: format string is defined here
#  236 | #define CONF_UNIX_BASE         "net/unix"
#      |                                 ^~~~~~~~~
#  237 | #define CONF_UNIX_FMT          CONF_UNIX_BASE "/%s"
#      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/bits/stdio2.h:68:10: note: ‘__builtin___snprintf_chk’ output 24 bytes into a destination of size 0
#   68 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
#      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   69 |                                    __glibc_objsize (__s), __fmt,
#      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   70 |                                    __va_arg_pack ());
#      |                                    ~~~~~~~~~~~~~~~~~
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
#  234|    * 					  + MAX_CONF_UNIX_OPT_PATH
#  235|    */
#  236|-> #define CONF_UNIX_BASE	       "net/unix"
#  237|   #define CONF_UNIX_FMT	       CONF_UNIX_BASE "/%s"
#  238|   #define MAX_CONF_UNIX_OPT_PATH 32

Error: GCC_ANALYZER_WARNING (CWE-775): [#def36]
criu-3.19-build/criu-3.19/criu/net.c: scope_hint: In function ‘prep_ns_sockets’
criu-3.19-build/criu-3.19/criu/net.c:3351: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
# 3349|   #endif
# 3350|   
# 3351|-> 	ret = ns->net.seqsk = socket(PF_UNIX, SOCK_SEQPACKET | SOCK_NONBLOCK, 0);
# 3352|   	if (ret < 0) {
# 3353|   		pr_perror("Can't create seqsk for parasite");

Error: CPPCHECK_WARNING (CWE-476): [#def37]
criu-3.19-build/criu-3.19/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): [#def38]
criu-3.19-build/criu-3.19/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): [#def39]
criu-3.19-build/criu-3.19/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): [#def40]
criu-3.19-build/criu-3.19/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): [#def41]
criu-3.19-build/criu-3.19/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): [#def42]
criu-3.19-build/criu-3.19/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): [#def43]
criu-3.19-build/criu-3.19/criu/pie/restorer.c: scope_hint: In function ‘timerfd_arm’
criu-3.19-build/criu-3.19/criu/pie/restorer.c:1197:61: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ts.tv_sec’
# 1195|   			}
# 1196|   
# 1197|-> 			t->val.it_value.tv_sec += (time_t)ts.tv_sec;
# 1198|   
# 1199|   			pr_debug("Adjust id %x it_value(%llu, %llu) -> it_value(%llu, %llu)\n", t->id,

Error: GCC_ANALYZER_WARNING (CWE-465): [#def44]
criu-3.19-build/criu-3.19/criu/pie/util-vdso.c: scope_hint: In function ‘parse_elf_phdr’
criu-3.19-build/criu-3.19/criu/pie/util-vdso.c:125:28: warning[-Wanalyzer-deref-before-check]: check of ‘addr’ for NULL after already dereferencing it
criu-3.19-build/criu-3.19/criu/pie/util-vdso.c: scope_hint: In function ‘parse_elf_phdr’
criu-3.19-build/criu-3.19/criu/pie/util-vdso.c: scope_hint: In function ‘parse_elf_phdr’
criu-3.19-build/criu-3.19/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): [#def45]
criu-3.19-build/criu-3.19/criu/pie/util-vdso.c:132:28: warning[-Wanalyzer-deref-before-check]: check of ‘addr’ for NULL after already dereferencing it
criu-3.19-build/criu-3.19/criu/pie/util-vdso.c: scope_hint: In function ‘parse_elf_phdr’
criu-3.19-build/criu-3.19/criu/pie/util-vdso.c: scope_hint: In function ‘parse_elf_phdr’
criu-3.19-build/criu-3.19/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): [#def46]
criu-3.19-build/criu-3.19/criu/pipes.c:294:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’
criu-3.19-build/criu-3.19/criu/pipes.c:157:17: note: in expansion of macro ‘pr_info’
criu-3.19-build/criu-3.19/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): [#def47]
criu-3.19-build/criu-3.19/criu/pipes.c: scope_hint: In function ‘open_pipe’
criu-3.19-build/criu-3.19/criu/pipes.c:294:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
criu-3.19-build/criu-3.19/criu/pipes.c:157:17: note: in expansion of macro ‘pr_info’
criu-3.19-build/criu-3.19/criu/include/crtools.h:6: included_from: Included from here.
criu-3.19-build/criu-3.19/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): [#def48]
criu-3.19-build/criu-3.19/criu/proc_parse.c: scope_hint: In function ‘parse_posix_timers’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2405:35: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘tidpid[0]’
criu-3.19-build/criu-3.19/include/common/compiler.h:51:41: note: in definition of macro ‘unlikely’
criu-3.19-build/criu-3.19/include/common/err.h:31:16: note: in expansion of macro ‘IS_ERR_VALUE’
criu-3.19-build/criu-3.19/criu/proc_parse.c: scope_hint: In function ‘parse_posix_timers’
criu-3.19-build/criu-3.19/criu/include/xmalloc.h:2: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/util.h:19: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/proc_parse.c:16: included_from: Included from here.
criu-3.19-build/criu-3.19/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2380:33: note: in expansion of macro ‘xzalloc’
criu-3.19-build/criu-3.19/include/common/compiler.h:51:41: note: in definition of macro ‘unlikely’
criu-3.19-build/criu-3.19/include/common/err.h:31:16: note: in expansion of macro ‘IS_ERR_VALUE’
criu-3.19-build/criu-3.19/criu/proc_parse.c: scope_hint: In function ‘parse_posix_timers’
criu-3.19-build/criu-3.19/include/common/compiler.h:51:41: note: in definition of macro ‘unlikely’
criu-3.19-build/criu-3.19/include/common/err.h:31:16: note: in expansion of macro ‘IS_ERR_VALUE’
criu-3.19-build/criu-3.19/criu/proc_parse.c: scope_hint: In function ‘parse_posix_timers’
# 2403|   			}
# 2404|   
# 2405|-> 			if (tidpid[0] == 't') {
# 2406|   				timer->spt.it_sigev_notify = SIGEV_THREAD_ID;
# 2407|   				timer->spt.notify_thread_id = pid_t;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
criu-3.19-build/criu-3.19/criu/proc_parse.c: scope_hint: In function ‘parse_cgroup_file’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2490:16: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-3.19-build/criu-3.19/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-3.19-build/criu-3.19/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2568:13: note: in expansion of macro ‘fopen_proc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2534:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2535:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-3.19-build/criu-3.19/include/common/list.h:211:20: note: in expansion of macro ‘list_entry’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2544:17: note: in expansion of macro ‘list_for_each_entry’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2544:17: note: in expansion of macro ‘list_for_each_entry’
# 2488|   int parse_cgroup_file(FILE *f, struct list_head *retl, unsigned int *n)
# 2489|   {
# 2490|-> 	while (fgets(buf, BUF_SIZE, f)) {
# 2491|   		struct cg_ctl *ncc, *cc;
# 2492|   		char *name, *path = NULL, *e;

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

Error: GCC_ANALYZER_WARNING (CWE-126): [#def51]
criu-3.19-build/criu-3.19/criu/proc_parse.c:2647:24: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/include/common/list.h:23:42: note: in definition of macro ‘LIST_HEAD’
criu-3.19-build/criu-3.19/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-3.19-build/criu-3.19/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2568:13: note: in expansion of macro ‘fopen_proc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2538:25: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2647:24: note: read of 8 bytes from after the end of ‘internal’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
#                                              └──────────────────────────┘
#                                                           ^
# 2645|   
# 2646|   	list_for_each_entry_safe(c, n, l, l) {
# 2647|-> 		xfree(c->name);
# 2648|   		xfree(c->path);
# 2649|   		xfree(c);

Error: GCC_ANALYZER_WARNING (CWE-416): [#def52]
criu-3.19-build/criu-3.19/criu/proc_parse.c:2647:24: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘c’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-3.19-build/criu-3.19/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2568:13: note: in expansion of macro ‘fopen_proc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2534:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2535:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-3.19-build/criu-3.19/include/common/list.h:211:20: note: in expansion of macro ‘list_entry’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2544:17: note: in expansion of macro ‘list_for_each_entry’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2544:17: note: in expansion of macro ‘list_for_each_entry’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2649:17: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
# 2645|   
# 2646|   	list_for_each_entry_safe(c, n, l, l) {
# 2647|-> 		xfree(c->name);
# 2648|   		xfree(c->path);
# 2649|   		xfree(c);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def53]
criu-3.19-build/criu-3.19/criu/proc_parse.c:2648:24: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/include/common/list.h:23:42: note: in definition of macro ‘LIST_HEAD’
criu-3.19-build/criu-3.19/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-3.19-build/criu-3.19/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2568:13: note: in expansion of macro ‘fopen_proc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2538:25: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2648:24: note: read of 8 bytes from after the end of ‘internal’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
#                                              └──────────────────────────┘
#                                                           ^
# 2646|   	list_for_each_entry_safe(c, n, l, l) {
# 2647|   		xfree(c->name);
# 2648|-> 		xfree(c->path);
# 2649|   		xfree(c);
# 2650|   	}

Error: CPPCHECK_WARNING: [#def54]
criu-3.19-build/criu-3.19/criu/rbtree.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def55]
criu-3.19-build/criu-3.19/criu/rbtree.c:118:8: warning[core.NullDereference]: Access to field 'rb_parent_color' results in a dereference of a null pointer (loaded from variable 'other')
#  116|   		if (parent->rb_left == node) {
#  117|   			other = parent->rb_right;
#  118|-> 			if (rb_is_red(other)) {
#  119|   				rb_set_black(other);
#  120|   				rb_set_red(parent);

Error: CLANG_WARNING: [#def56]
criu-3.19-build/criu-3.19/criu/rbtree.c:138:5: warning[core.NullDereference]: Access to field 'rb_parent_color' results in a dereference of a null pointer (loaded from field 'rb_right')
#  136|   				rb_set_color(other, rb_color(parent));
#  137|   				rb_set_black(parent);
#  138|-> 				rb_set_black(other->rb_right);
#  139|   				__rb_rotate_left(parent, root);
#  140|   				node = root->rb_node;

Error: CLANG_WARNING: [#def57]
criu-3.19-build/criu-3.19/criu/rbtree.c:165:5: warning[core.NullDereference]: Access to field 'rb_parent_color' results in a dereference of a null pointer (loaded from field 'rb_left')
#  163|   				rb_set_color(other, rb_color(parent));
#  164|   				rb_set_black(parent);
#  165|-> 				rb_set_black(other->rb_left);
#  166|   				__rb_rotate_right(parent, root);
#  167|   				node = root->rb_node;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
criu-3.19-build/criu-3.19/criu/servicefd.c:186:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/servicefd.c:158:9: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/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): [#def59]
criu-3.19-build/criu-3.19/criu/servicefd.c: scope_hint: In function ‘move_service_fd’
criu-3.19-build/criu-3.19/criu/servicefd.c:236:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/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): [#def60]
criu-3.19-build/criu-3.19/criu/servicefd.c:237:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/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): [#def61]
criu-3.19-build/criu-3.19/criu/include/xmalloc.h:2: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/util.h:19: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/protobuf.h:8: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/sk-packet.c:19: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/sk-packet.c:213:33: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/sk-packet.c: scope_hint: In function ‘dump_one_packet_fd’
criu-3.19-build/criu-3.19/criu/sk-packet.c:164:9: note: in expansion of macro ‘pr_info’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/sk-packet.c:165:9: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/criu/sk-packet.c:61:9: note: in expansion of macro ‘pr_debug’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/sk-packet.c:62:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/sk-packet.c:62:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/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): [#def62]
criu-3.19-build/criu-3.19/criu/sk-packet.c: scope_hint: In function ‘open_socket_map’
criu-3.19-build/criu-3.19/criu/sk-packet.c:343:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
criu-3.19-build/criu-3.19/include/common/bug.h:7: included_from: Included from here.
criu-3.19-build/criu-3.19/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-3.19-build/criu-3.19/include/common/list.h:211:20: note: in expansion of macro ‘list_entry’
criu-3.19-build/criu-3.19/criu/sk-packet.c:329:9: note: in expansion of macro ‘list_for_each_entry’
criu-3.19-build/criu-3.19/criu/include/files.h:10: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/sk-packet.c:11: included_from: Included from here.
criu-3.19-build/criu-3.19/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): [#def63]
criu-3.19-build/criu-3.19/criu/sk-unix.c: scope_hint: In function ‘open_unixsk_standalone’
criu-3.19-build/criu-3.19/criu/sk-unix.c:1931:21: warning[-Wanalyzer-fd-phase-mismatch]: ‘listen’ on file descriptor ‘sk’ in wrong phase
criu-3.19-build/criu-3.19/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): [#def64]
criu-3.19-build/criu-3.19/criu/sk-unix.c: scope_hint: In function ‘collect_one_unixsk’
criu-3.19-build/criu-3.19/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: CPPCHECK_WARNING: [#def65]
criu-3.19-build/criu-3.19/criu/tls.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-457): [#def66]
criu-3.19-build/criu-3.19/criu/tls.c: scope_hint: In function ‘tls_recv_data_to_fd’
criu-3.19-build/criu-3.19/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): [#def67]
criu-3.19-build/criu-3.19/criu/util.c: scope_hint: In function ‘reopen_fd_as_safe’
criu-3.19-build/criu-3.19/criu/util.c:229:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tmp’
criu-3.19-build/criu-3.19/criu/util.c: scope_hint: In function ‘reopen_fd_as_safe’
criu-3.19-build/criu-3.19/criu/util.c:591:31: note: in expansion of macro ‘DUP_SAFE’
criu-3.19-build/criu-3.19/criu/util.c:591:31: note: in expansion of macro ‘DUP_SAFE’
criu-3.19-build/criu-3.19/criu/util.c:36: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/util.c:616:21: note: in expansion of macro ‘reopen_fd_as_nocheck’
criu-3.19-build/criu-3.19/criu/util.c:616:21: note: in expansion of macro ‘reopen_fd_as_nocheck’
criu-3.19-build/criu-3.19/criu/util.c:6: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/log.h:61:29: note: in expansion of macro ‘pr_err’
criu-3.19-build/criu-3.19/criu/util.c:226:25: note: in expansion of macro ‘pr_perror’
#  227|   	}
#  228|   
#  229|-> 	return ret;
#  230|   }
#  231|   

Error: GCC_ANALYZER_WARNING: [#def68]
criu-3.19-build/criu-3.19/criu/util.c:240:31: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘new_fd’
criu-3.19-build/criu-3.19/criu/util.c: scope_hint: In function ‘reopen_fd_as_safe’
criu-3.19-build/criu-3.19/criu/util.c:591:31: note: in expansion of macro ‘DUP_SAFE’
criu-3.19-build/criu-3.19/criu/util.c:591:31: note: in expansion of macro ‘DUP_SAFE’
criu-3.19-build/criu-3.19/criu/util.c:616:21: note: in expansion of macro ‘reopen_fd_as_nocheck’
criu-3.19-build/criu-3.19/criu/util.c:616: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): [#def69]
criu-3.19-build/criu-3.19/criu/util.c: scope_hint: In function ‘cr_system_userns’
criu-3.19-build/criu-3.19/criu/util.c:607:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘0’
criu-3.19-build/criu-3.19/criu/util.c: scope_hint: In function ‘cr_system_userns’
criu-3.19-build/criu-3.19/criu/util.c:591:31: note: in expansion of macro ‘DUP_SAFE’
criu-3.19-build/criu-3.19/criu/util.c:591:31: note: in expansion of macro ‘DUP_SAFE’
#  605|   
#  606|   		if (in < 0) {
#  607|-> 			close(STDIN_FILENO);
#  608|   		} else {
#  609|   			if (reopen_fd_as_nocheck(STDIN_FILENO, in))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def70]
criu-3.19-build/criu-3.19/criu/util.c:1676: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
# 1674|   	close_safe(&pfd[1]);
# 1675|   	close_safe(&pfd[0]);
# 1676|-> 	return ret;
# 1677|   }
# 1678|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def71]
criu-3.19-build/criu-3.19/criu/util.c: scope_hint: In function ‘is_iptables_nft’
criu-3.19-build/criu-3.19/criu/util.c:1676:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’
# 1674|   	close_safe(&pfd[1]);
# 1675|   	close_safe(&pfd[0]);
# 1676|-> 	return ret;
# 1677|   }
# 1678|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
criu-3.19-build/criu-3.19/criu/include/util.h:20: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/proc_parse.c: scope_hint: In function ‘parse_threads’
criu-3.19-build/criu-3.19/include/common/bug.h:23:20: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2483:17: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-3.19-build/criu-3.19/criu/include/util.h:102:28: note: in expansion of macro ‘open_proc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2451:15: note: in expansion of macro ‘opendir_proc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2463:31: note: in expansion of macro ‘xrealloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2463:31: note: in expansion of macro ‘xrealloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2463:31: note: in expansion of macro ‘xrealloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:22:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2463:31: note: in expansion of macro ‘xrealloc’
criu-3.19-build/criu-3.19/include/common/bug.h:23:22: note: in definition of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2483:17: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2483:17: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2483: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): [#def73]
criu-3.19-build/criu-3.19/compel/plugins/std/fds.c:11: included_from: Included from here.
criu-3.19-build/criu-3.19/include/common/scm-code.c: scope_hint: In function ‘__recv_fds’
criu-3.19-build/criu-3.19/include/common/bug.h:26:57: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/include/common/scm-code.c:106:17: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/include/common/compiler.h:96:36: note: in definition of macro ‘min’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/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): [#def74]
criu-3.19-build/criu-3.19/criu/proc_parse.c: scope_hint: In function ‘put_ctls’
criu-3.19-build/criu-3.19/include/common/compiler.h:79:52: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*n.l.next’
criu-3.19-build/criu-3.19/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-3.19-build/criu-3.19/include/common/list.h:234:51: note: in expansion of macro ‘list_entry’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/list.h:23:42: note: in definition of macro ‘LIST_HEAD’
criu-3.19-build/criu-3.19/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-3.19-build/criu-3.19/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2568:13: note: in expansion of macro ‘fopen_proc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2538:25: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-3.19-build/criu-3.19/include/common/list.h:234:51: note: in expansion of macro ‘list_entry’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646: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): [#def75]
criu-3.19-build/criu-3.19/compel/plugins/std/infect.c:5: included_from: Included from here.
criu-3.19-build/criu-3.19/include/common/lock.h: scope_hint: In function ‘futex_set_and_wake’
criu-3.19-build/criu-3.19/include/common/lock.h:16:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-3.19-build/criu-3.19/include/common/lock.h:81:9: note: in expansion of macro ‘LOCK_BUG_ON’
criu-3.19-build/criu-3.19/include/common/lock.h:81:9: note: in expansion of macro ‘LOCK_BUG_ON’
criu-3.19-build/criu-3.19/include/common/lock.h:81:9: note: in expansion of macro ‘LOCK_BUG_ON’
criu-3.19-build/criu-3.19/include/common/lock.h:81:9: note: in expansion of macro ‘LOCK_BUG_ON’
#   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): [#def76]
criu-3.19-build/criu-3.19/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): [#def77]
criu-3.19-build/criu-3.19/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): [#def78]
criu-3.19-build/criu-3.19/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): [#def79]
criu-3.19-build/criu-3.19/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): [#def80]
criu-3.19-build/criu-3.19/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): [#def81]
criu-3.19-build/criu-3.19/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): [#def82]
criu-3.19-build/criu-3.19/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): [#def83]
criu-3.19-build/criu-3.19/include/common/scm-code.c:13:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-3.19-build/criu-3.19/include/common/scm-code.c: scope_hint: In function ‘send_fds’
criu-3.19-build/criu-3.19/compel/plugins/include/uapi/std/infect.h:4: included_from: Included from here.
criu-3.19-build/criu-3.19/compel/plugins/include/uapi/std.h:7: included_from: Included from here.
criu-3.19-build/criu-3.19/compel/plugins/std/fds.c:4: included_from: Included from here.
criu-3.19-build/criu-3.19/include/common/compiler.h:96: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): [#def84]
criu-3.19-build/criu-3.19/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): [#def85]
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:36: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-3.19-build/criu-3.19/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2568:13: note: in expansion of macro ‘fopen_proc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2534:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2535:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-3.19-build/criu-3.19/include/common/list.h:211:20: note: in expansion of macro ‘list_entry’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2544:17: note: in expansion of macro ‘list_for_each_entry’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2544:17: note: in expansion of macro ‘list_for_each_entry’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494: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): [#def86]
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:18: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*c.name’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2647:17: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-3.19-build/criu-3.19/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2568:13: note: in expansion of macro ‘fopen_proc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2534:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2534:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2534:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2535:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-3.19-build/criu-3.19/include/common/list.h:211:20: note: in expansion of macro ‘list_entry’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2544:17: note: in expansion of macro ‘list_for_each_entry’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2544:17: note: in expansion of macro ‘list_for_each_entry’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2647:17: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2647: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): [#def87]
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:18: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*c.path’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2648:17: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-3.19-build/criu-3.19/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2568:13: note: in expansion of macro ‘fopen_proc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2534:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2535:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2535:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2535:29: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/list.h:197:39: note: in expansion of macro ‘container_of’
criu-3.19-build/criu-3.19/include/common/list.h:211:20: note: in expansion of macro ‘list_entry’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2544:17: note: in expansion of macro ‘list_for_each_entry’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2544:17: note: in expansion of macro ‘list_for_each_entry’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2648:17: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2648: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): [#def88]
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:18: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*dinfo.fe’
criu-3.19-build/criu-3.19/criu/eventpoll.c:115:9: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/include/imgset.h:20:9: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/criu/eventpoll.c:115:9: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/criu/eventpoll.c:178:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/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): [#def89]
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:18: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*dinfo.toff’
criu-3.19-build/criu-3.19/criu/eventpoll.c:118:9: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/include/imgset.h:20:9: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/criu/eventpoll.c:118:9: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/criu/eventpoll.c:178:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/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): [#def90]
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:18: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*dinfo_16(D)->e.tfd’
criu-3.19-build/criu-3.19/criu/eventpoll.c:116:9: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/bug.h:39:27: note: in expansion of macro ‘BUG_ON_HANDLER’
criu-3.19-build/criu-3.19/criu/include/imgset.h:20:9: note: in expansion of macro ‘BUG_ON’
criu-3.19-build/criu-3.19/criu/eventpoll.c:116:9: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/eventpoll.c:130:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/criu/eventpoll.c:178:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/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-775): [#def91]
criu-3.19-build/criu-3.19/criu/include/xmalloc.h:2: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/page-pipe.c: scope_hint: In function ‘ppb_alloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor
criu-3.19-build/criu-3.19/criu/page-pipe.c:126:25: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/page-pipe.c:104:15: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/criu/page-pipe.c:126:25: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/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): [#def92]
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:18: warning[-Wanalyzer-free-of-non-heap]: ‘free’ of ‘c’ which points to memory on the stack
criu-3.19-build/criu-3.19/criu/proc_parse.c:2649:17: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/include/common/list.h:23:42: note: in definition of macro ‘LIST_HEAD’
criu-3.19-build/criu-3.19/include/common/list.h:23:42: note: in definition of macro ‘LIST_HEAD’
criu-3.19-build/criu-3.19/criu/include/util.h:92:34: note: in expansion of macro ‘__open_proc’
criu-3.19-build/criu-3.19/criu/include/util.h:118:28: note: in expansion of macro ‘open_proc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2568:13: note: in expansion of macro ‘fopen_proc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2494:23: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2538:25: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2646:9: note: in expansion of macro ‘list_for_each_entry_safe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:23: note: in definition of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/proc_parse.c:2649: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): [#def93]
criu-3.19-build/criu-3.19/criu/include/xmalloc.h:2: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/plugin.c:11: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/plugin.c: scope_hint: In function ‘cr_lib_load’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:18: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
criu-3.19-build/criu-3.19/criu/plugin.c:173:17: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/plugin.c:29:13: note: in expansion of macro ‘xzalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/plugin.c:33:19: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/plugin.c:33:19: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/plugin.c:33:19: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:19:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/plugin.c:33:19: note: in expansion of macro ‘xstrdup’
criu-3.19-build/criu-3.19/criu/plugin.c:50:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:51:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:51:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:52:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:52:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:53:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:53:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:54:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:54:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:55:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:55:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:56:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:56:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:57:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:57:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:58:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:58:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:59:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/criu/plugin.c:59:9: note: in expansion of macro ‘__assign_hook’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/plugin.c:131:16: note: in expansion of macro ‘xzalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/plugin.c:131:16: note: in expansion of macro ‘xzalloc’
criu-3.19-build/criu-3.19/criu/include/criu-log.h:23: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/servicefd.h:10: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/image.h:7: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/include/cr_options.h:9: included_from: Included from here.
criu-3.19-build/criu-3.19/criu/plugin.c:9: included_from: Included from here.
criu-3.19-build/criu-3.19/include/common/xmalloc.h:15:25: note: in expansion of macro ‘pr_err’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/plugin.c:131:16: note: in expansion of macro ‘xzalloc’
criu-3.19-build/criu-3.19/criu/plugin.c:173:17: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/criu/plugin.c:173: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): [#def94]
criu-3.19-build/criu-3.19/criu/page-pipe.c: scope_hint: In function ‘create_page_pipe’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:24:18: warning[-Wanalyzer-malloc-leak]: leak of ‘___p’
criu-3.19-build/criu-3.19/criu/page-pipe.c:219:9: note: in expansion of macro ‘xfree’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:21:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/page-pipe.c:193:14: note: in expansion of macro ‘xzalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/page-pipe.c:203:24: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:13:30: note: in definition of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/page-pipe.c:203:24: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/page-pipe.c:203:24: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/include/common/xmalloc.h:20:27: note: in expansion of macro ‘__xalloc’
criu-3.19-build/criu-3.19/criu/page-pipe.c:203:24: note: in expansion of macro ‘xmalloc’
criu-3.19-build/criu-3.19/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)                  \

Error: CPPCHECK_WARNING: [#def95]
criu-3.19-build/criu-3.19/soccr/soccr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-111.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namecriu-3.19-5.fc41
store-results-to/tmp/tmpfqr2d6wa/criu-3.19-5.fc41.tar.xz
time-created2024-07-03 12:20:09
time-finished2024-07-03 12:24:12
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpfqr2d6wa/criu-3.19-5.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpfqr2d6wa/criu-3.19-5.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9