libunwind-1.8.0-3.fc41

List of Defects

Error: CLANG_WARNING: [#def1]
libunwind-1.8.0-build/libunwind-1.8.0/src/x86_64/Gstep.c:28: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/include/libunwind_i.h:422: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/include/tdep/libunwind_i.h:25: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/include/tdep-x86_64/libunwind_i.h:167:16: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
#  165|   dwarf_is_null_loc(dwarf_loc_t l)
#  166|   {
#  167|->   return l.val == 0 && l.type == 0;
#  168|   }
#  169|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2]
libunwind-1.8.0-build/libunwind-1.8.0/src/coredump/_UCD_create.c: scope_hint: In function '_UCD_create'
libunwind-1.8.0-build/libunwind-1.8.0/src/coredump/_UCD_create.c:59:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'ui' where non-null expected
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
#   57|     mi_init ();
#   58|   
#   59|->   struct UCD_info *ui = memset(malloc(sizeof(*ui)), 0, sizeof(*ui));
#   60|     ui->edi.di_cache.format = -1;
#   61|     ui->edi.di_debug.format = -1;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def3]
libunwind-1.8.0-build/libunwind-1.8.0/src/coredump/_UCD_create.c:125:40: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'malloc((long unsigned int)(unsigned int)<unknown> * 56)' where non-null expected
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
#  123|       }
#  124|     unsigned size = ui->phdrs_count = (_64bits ? elf_header64.e_phnum : elf_header32.e_phnum);
#  125|->   coredump_phdr_t *phdrs = ui->phdrs = memset(malloc(size * sizeof(phdrs[0])), 0, size * sizeof(phdrs[0]));
#  126|     if (_64bits)
#  127|       {

Error: COMPILER_WARNING: [#def4]
libunwind-1.8.0-build/libunwind-1.8.0/src/coredump/_UPT_get_dyn_info_list_addr.c: scope_hint: In function 'get_list_addr'
libunwind-1.8.0-build/libunwind-1.8.0/src/coredump/_UPT_get_dyn_info_list_addr.c:87:3: warning[-Wcpp]: #warning Implement get_list_addr(), please.
#   85|                  int              *countp)
#   86|   {
#   87|-> # warning Implement get_list_addr(), please.
#   88|     *countp = 0;
#   89|     return 0;

Error: CLANG_WARNING: [#def5]
libunwind-1.8.0-build/libunwind-1.8.0/src/dwarf/Lfind_unwind_table.c:4: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/src/dwarf/Gfind_unwind_table.c:159:12: warning[deadcode.DeadStores]: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret'
#  157|   
#  158|         /* (Optionally) read eh_frame_ptr: */
#  159|->       if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
#  160|                                                &addr, hdr->eh_frame_ptr_enc, &pi,
#  161|                                                &eh_frame_start, NULL)) < 0)

Error: CLANG_WARNING: [#def6]
libunwind-1.8.0-build/libunwind-1.8.0/src/dwarf/Gfind_unwind_table.c:165:12: warning[deadcode.DeadStores]: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret'
#  163|   
#  164|         /* (Optionally) read fde_count: */
#  165|->       if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
#  166|                                                &addr, hdr->fde_count_enc, &pi,
#  167|                                                &fde_count, NULL)) < 0)

Error: CLANG_WARNING: [#def7]
libunwind-1.8.0-build/libunwind-1.8.0/src/os-linux.c:33: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/include/libunwind_i.h:422: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/include/tdep/libunwind_i.h:25: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/include/tdep-x86_64/libunwind_i.h:39: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/src/elf64.h:7: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/src/elfxx.h:98:12: warning[core.NullDereference]: Access to field 'size' results in a dereference of a null pointer (loaded from variable 'ei')
#   96|       }
#   97|   
#   98|->   ei->size = stat.st_size;
#   99|     ei->image = mi_mmap (NULL, ei->size, PROT_READ, MAP_PRIVATE, fd, 0);
#  100|     close (fd);

Error: GCC_ANALYZER_WARNING (CWE-835): [#def8]
libunwind-1.8.0-build/libunwind-1.8.0/src/mi/Laddress_validator.c:4: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/src/mi/Gaddress_validator.c: scope_hint: In function '_write_validate'
libunwind-1.8.0-build/libunwind-1.8.0/src/mi/Gaddress_validator.c:117:15: warning[-Wanalyzer-infinite-loop]: infinite loop
#  115|       {
#  116|         char buf;
#  117|->       bytes = read (_mem_validate_pipe[0], &buf, 1);
#  118|       }
#  119|     while ( errno == EINTR );

Error: CLANG_WARNING: [#def9]
libunwind-1.8.0-build/libunwind-1.8.0/src/mi/Gdyn-remote.c:80:22: warning[unix.Malloc]: Use of memory allocated with size zero
#   78|       }
#   79|   
#   80|->   region->insn_count = insn_count;
#   81|     region->op_count = op_count;
#   82|     for (i = 0; i < op_count; ++i)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def10]
libunwind-1.8.0-build/libunwind-1.8.0/src/mi/Gdyn-remote.c: scope_hint: In function '_Ux86_64_Idyn_remote_find_proc_info'
libunwind-1.8.0-build/libunwind-1.8.0/src/mi/Gdyn-remote.c:249:28: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'di'
libunwind-1.8.0-build/libunwind-1.8.0/include/libunwind-x86_64.h:136: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/include/libunwind.h:23: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/include/libunwind_i.h:51: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/src/mi/Gdyn-remote.c:28: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/include/libunwind-common.h:46:25: note: in definition of macro 'UNW_PASTE2'
libunwind-1.8.0-build/libunwind-1.8.0/include/libunwind_i.h:174:27: note: in expansion of macro 'UNW_PASTE'
libunwind-1.8.0-build/libunwind-1.8.0/include/libunwind-common.h:47:25: note: in expansion of macro 'UNW_PASTE2'
libunwind-1.8.0-build/libunwind-1.8.0/include/libunwind-common.h:54:25: note: in expansion of macro 'UNW_PASTE'
libunwind-1.8.0-build/libunwind-1.8.0/include/libunwind-common.h:47:25: note: in expansion of macro 'UNW_PASTE2'
libunwind-1.8.0-build/libunwind-1.8.0/include/libunwind-common.h:54:35: note: in expansion of macro 'UNW_PASTE'
libunwind-1.8.0-build/libunwind-1.8.0/include/libunwind_i.h:174:37: note: in expansion of macro 'UNW_PREFIX'
libunwind-1.8.0-build/libunwind-1.8.0/include/libunwind_i.h:272:41: note: in expansion of macro 'UNWI_OBJ'
libunwind-1.8.0-build/libunwind-1.8.0/src/mi/Gdyn-remote.c:204:1: note: in expansion of macro 'unwi_dyn_remote_find_proc_info'
libunwind-1.8.0-build/libunwind-1.8.0/src/mi/Gdyn-remote.c: scope_hint: In function '_Ux86_64_Idyn_remote_find_proc_info'
#  247|                   di = calloc (1, sizeof (*di));
#  248|   
#  249|->               di->start_ip = start_ip;
#  250|                 di->end_ip = end_ip;
#  251|   

Error: CLANG_WARNING: [#def11]
libunwind-1.8.0-build/libunwind-1.8.0/src/os-linux.c:52:30: warning[core.UndefinedBinaryOperatorResult]: The right operand of '<' is a garbage value
#   50|   
#   51|     while (maps_next (&mi, segbase, &hi, mapoff, NULL))
#   52|->     if (ip >= *segbase && ip < hi)
#   53|         {
#   54|           found = 1;

Error: CLANG_WARNING: [#def12]
libunwind-1.8.0-build/libunwind-1.8.0/src/os-linux.c:76:3: warning[deadcode.DeadStores]: Value stored to 'full_path' is never read
#   74|       }
#   75|   
#   76|->   full_path = mi.path;
#   77|   
#   78|     /* Get process root */

Error: CLANG_WARNING: [#def13]
libunwind-1.8.0-build/libunwind-1.8.0/src/os-linux.c:34: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/src/os-linux.h:275:7: warning[deadcode.DeadStores]: Value stored to 'cp' is never read
#  273|         if (!cp)
#  274|           continue;
#  275|->       cp = scan_string (cp, NULL, 0);
#  276|         if (dash != '-' || colon != ':')
#  277|           continue;       /* skip line with unknown or bad format */

Error: COMPILER_WARNING: [#def14]
libunwind-1.8.0-build/libunwind-1.8.0/src/ptrace/_UPT_get_dyn_info_list_addr.c: scope_hint: In function 'get_list_addr'
libunwind-1.8.0-build/libunwind-1.8.0/src/ptrace/_UPT_get_dyn_info_list_addr.c:85:3: warning[-Wcpp]: #warning Implement get_list_addr(), please.
#   83|                  int              *countp)
#   84|   {
#   85|-> # warning Implement get_list_addr(), please.
#   86|     *countp = 0;
#   87|     return 0;

Error: CLANG_WARNING: [#def15]
libunwind-1.8.0-build/libunwind-1.8.0/src/x86_64/Lstep.c:4: included_from: Included from here.
libunwind-1.8.0-build/libunwind-1.8.0/src/x86_64/Gstep.c:44:8: warning[deadcode.DeadStores]: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret'
#   42|   
#   43|     a = unw_get_accessors_int (c->as);
#   44|->   if ((ret = (*a->access_mem) (c->as, c->ip, &w0, 0, c->as_arg)) < 0
#   45|         || (ret = (*a->access_mem) (c->as, c->ip + 8, &w1, 0, c->as_arg)) < 0)
#   46|       return 0;

Error: CLANG_WARNING: [#def16]
libunwind-1.8.0-build/libunwind-1.8.0/src/x86_64/Gstep.c:45:11: warning[deadcode.DeadStores]: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret'
#   43|     a = unw_get_accessors_int (c->as);
#   44|     if ((ret = (*a->access_mem) (c->as, c->ip, &w0, 0, c->as_arg)) < 0
#   45|->       || (ret = (*a->access_mem) (c->as, c->ip + 8, &w1, 0, c->as_arg)) < 0)
#   46|       return 0;
#   47|   

Error: CLANG_WARNING: [#def17]
libunwind-1.8.0-build/libunwind-1.8.0/src/x86_64/Gtrace.c:449:27: warning[core.CallAndMessage]: 5th function call argument is an uninitialized value
#  447|          cache negative results too to prevent unnecessary dwarf parsing
#  448|          for common failures. */
#  449|->     unw_tdep_frame_t *f = trace_lookup (cursor, cache, cfa, rip, rbp, rsp);
#  450|   
#  451|       /* If we don't have information for this frame, give up. */

Error: CPPCHECK_WARNING: [#def18]
libunwind-1.8.0-build/libunwind-1.8.0/tests/Gperf-simple.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def19]
libunwind-1.8.0-build/libunwind-1.8.0/tests/Gperf-trace.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def20]
libunwind-1.8.0-build/libunwind-1.8.0/tests/Lperf-simple.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def21]
libunwind-1.8.0-build/libunwind-1.8.0/tests/Lperf-trace.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
libunwind-1.8.0-build/libunwind-1.8.0/tests/crasher.c:24:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/self/maps", "r")’
#   22|       FILE *out = fopen(fname, "w");
#   23|   
#   24|->     if (!maps || !out)
#   25|           exit(EXIT_FAILURE);
#   26|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def23]
libunwind-1.8.0-build/libunwind-1.8.0/tests/crasher.c: scope_hint: In function ‘write_maps’
libunwind-1.8.0-build/libunwind-1.8.0/tests/crasher.c:24:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "w")’
#   22|       FILE *out = fopen(fname, "w");
#   23|   
#   24|->     if (!maps || !out)
#   25|           exit(EXIT_FAILURE);
#   26|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
libunwind-1.8.0-build/libunwind-1.8.0/tests/crasher.c:24:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/self/maps", "r")’
#   22|       FILE *out = fopen(fname, "w");
#   23|   
#   24|->     if (!maps || !out)
#   25|           exit(EXIT_FAILURE);
#   26|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
libunwind-1.8.0-build/libunwind-1.8.0/tests/crasher.c:24:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "w")’
#   22|       FILE *out = fopen(fname, "w");
#   23|   
#   24|->     if (!maps || !out)
#   25|           exit(EXIT_FAILURE);
#   26|   

Error: GCC_ANALYZER_WARNING (CWE-674): [#def26]
libunwind-1.8.0-build/libunwind-1.8.0/tests/mapper.c: scope_hint: In function ‘push_some_stacks’
libunwind-1.8.0-build/libunwind-1.8.0/tests/mapper.c:51:5: warning[-Wanalyzer-infinite-recursion]: infinite recursion
#   49|     {
#   50|       push_some_stacks(n - 1);
#   51|->     push_some_stacks(n - 1);
#   52|     }
#   53|   }

Error: CPPCHECK_WARNING: [#def27]
libunwind-1.8.0-build/libunwind-1.8.0/tests/test-ptrace-misc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
libunwind-1.8.0-build/libunwind-1.8.0/tests/test-ptrace-misc.c: scope_hint: In function ‘bar’
libunwind-1.8.0-build/libunwind-1.8.0/tests/test-ptrace-misc.c:100:6: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
#   98|          ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
#   99|          )))))))))))))))))))))))))))))))))))))))))))))))))))))));
#  100|->   if (r < 2)
#  101|       v = r;
#  102|   

Error: CLANG_WARNING: [#def29]
libunwind-1.8.0-build/libunwind-1.8.0/tests/test-ptrace-misc.c:103:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'r'
#  101|       v = r;
#  102|   
#  103|->   kill (self, SIGUSR1);	/* tell test-ptrace to start single-stepping */
#  104|     v = func (v);
#  105|     kill (self, SIGUSR2);	/* tell test-ptrace to stop single-stepping */

Error: CLANG_WARNING: [#def30]
libunwind-1.8.0-build/libunwind-1.8.0/tests/test-ptrace-misc.c:105:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'v'
#  103|     kill (self, SIGUSR1);	/* tell test-ptrace to start single-stepping */
#  104|     v = func (v);
#  105|->   kill (self, SIGUSR2);	/* tell test-ptrace to stop single-stepping */
#  106|     return v;
#  107|   }

Error: CPPCHECK_WARNING (CWE-401): [#def31]
libunwind-1.8.0-build/libunwind-1.8.0/tests/test-ptrace-misc.c:106: error[memleak]: Memory leak: r
#  104|     v = func (v);
#  105|     kill (self, SIGUSR2);	/* tell test-ptrace to stop single-stepping */
#  106|->   return v;
#  107|   }
#  108|   

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-114.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibunwind-1.8.0-3.fc41
store-results-to/tmp/tmpnhtc26c4/libunwind-1.8.0-3.fc41.tar.xz
time-created2024-07-03 16:00:36
time-finished2024-07-03 16:02:07
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpnhtc26c4/libunwind-1.8.0-3.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpnhtc26c4/libunwind-1.8.0-3.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9