libunwind-1.8.1-2.fc43

List of Findings

Error: SHELLCHECK_WARNING (CWE-829): [#def1]
/usr/libexec/libunwind/check-namespace.sh:69:8: warning[SC2092]: Remove backticks to avoid executing output (or use eval if intentional).
#   67|   match () {
#   68|       sym=$1
#   69|->     if `echo "$symtab" | grep -q " ${sym}\$"`; then
#   70|   	symtab=`echo "$symtab" | grep -v " ${sym}\$"`
#   71|       else

Error: SHELLCHECK_WARNING: [#def2]
/usr/libexec/libunwind/check-namespace.sh:109:9: warning[SC2195]: This pattern will never match the case statement's word. Double check them.
#  107|               ignore _gp
#  108|               ;;
#  109|->         loongarch64)
#  110|               ignore _fbss
#  111|               ignore _fdata

Error: SHELLCHECK_WARNING (CWE-398): [#def3]
/usr/libexec/libunwind/check-namespace.sh:236:14: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#  234|       esac
#  235|   
#  236|->     if [ xno = xyes ]; then
#  237|   	match _UL${plat}_dwarf_find_debug_frame
#  238|       fi

Error: SHELLCHECK_WARNING (CWE-398): [#def4]
/usr/libexec/libunwind/check-namespace.sh:361:14: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#  359|       esac
#  360|   
#  361|->     if [ xno = xyes ]; then
#  362|   	match _U${plat}_dwarf_find_debug_frame
#  363|       fi

Error: SHELLCHECK_WARNING (CWE-398): [#def5]
/usr/libexec/libunwind/check-namespace.sh:423:14: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#  421|       filter_misc
#  422|       check_local_unw_abi
#  423|->     if [ xno = xyes ]; then
#  424|         check_cxx_abi
#  425|       fi

Error: SHELLCHECK_WARNING: [#def6]
/usr/libexec/libunwind/run-coredump-unwind:24:130: warning[SC3020]: In POSIX sh, &> is undefined.
#   22|     comm -13 "$dynsyms" "$funcsyms" > "$keep_symbols"
#   23|     # Copy the full debuginfo, keeping only a minimal set of symbols and removing some unnecessary sections
#   24|->   objcopy -S --remove-section .gdb_index --remove-section .comment --keep-symbols="$keep_symbols" "$debuginfo" "$mini_debuginfo" &> /dev/null
#   25|     wait
#   26|     #Inject the compressed data into the .gnu_debugdata section of the original binary

Error: SHELLCHECK_WARNING (CWE-563): [#def7]
/usr/libexec/libunwind/run-coredump-unwind:36:1: warning[SC2034]: TESTDIR appears unused. Verify use (or export if used externally).
#   34|   
#   35|   
#   36|-> TESTDIR=`pwd`
#   37|   TEMPDIR=`mktemp --tmpdir -d libunwind-test-XXXXXXXXXX`
#   38|   trap "rm -r -- $TEMPDIR" EXIT

Error: SHELLCHECK_WARNING (CWE-569): [#def8]
/usr/libexec/libunwind/run-coredump-unwind:38:16: warning[SC2064]: Use single quotes, otherwise this expands now rather than when signalled.
#   36|   TESTDIR=`pwd`
#   37|   TEMPDIR=`mktemp --tmpdir -d libunwind-test-XXXXXXXXXX`
#   38|-> trap "rm -r -- $TEMPDIR" EXIT
#   39|   
#   40|   cp crasher $TEMPDIR/crasher

Error: SHELLCHECK_WARNING (CWE-252): [#def9]
/usr/libexec/libunwind/run-coredump-unwind:47:5: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#   45|   # create core dump
#   46|   (
#   47|->     cd $TEMPDIR
#   48|       ulimit -c 10000
#   49|       ./crasher backing_files

Error: SHELLCHECK_WARNING: [#def10]
/usr/libexec/libunwind/run-coredump-unwind:48:12: warning[SC3045]: In POSIX sh, ulimit -c is undefined.
#   46|   (
#   47|       cd $TEMPDIR
#   48|->     ulimit -c 10000
#   49|       ./crasher backing_files
#   50|   ) 2>/dev/null

Error: SHELLCHECK_WARNING (CWE-569): [#def11]
/usr/libexec/libunwind/run-coredump-unwind:51:10: warning[SC2125]: Brace expansions and globs are literal in assignments. Quote it or use an array.
#   49|       ./crasher backing_files
#   50|   ) 2>/dev/null
#   51|-> COREFILE=$TEMPDIR/core*
#   52|   if ! test -f "$COREFILE"; then
#   53|       echo "crasher process did not produce coredump, test skipped"

Error: SHELLCHECK_WARNING (CWE-156): [#def12]
/usr/libexec/libunwind/run-coredump-unwind:58:44: warning[SC2046]: Quote this to prevent word splitting.
#   56|   
#   57|   # magic option -testcase enables checking for the specific contents of the stack
#   58|-> ./test-coredump-unwind $COREFILE -testcase `cat $TEMPDIR/backing_files`

Error: SHELLCHECK_WARNING (CWE-569): [#def13]
/usr/libexec/libunwind/run-ptrace-mapper:24:47: warning[SC2048]: Use "$@" (with quotes) to prevent whitespace problems.
#   22|   #
#   23|   dir="$(dirname $0)"
#   24|-> "${dir}/test-ptrace" -c -n -t "${dir}/mapper" $*

Error: COMPILER_WARNING: [#def14]
libunwind-1.8.1/include/dwarf_i.h:10: included_from: Included from here.
libunwind-1.8.1/src/dwarf/Gfind_proc_info-lsb.c:33: included_from: Included from here.
libunwind-1.8.1/src/dwarf/Lfind_proc_info-lsb.c:4: included_from: Included from here.
libunwind-1.8.1/include/libunwind_i.h:146:10: warning: 'unreachable' redefined
#  146 | # define unreachable() __builtin_unreachable()
#      |          ^~~~~~~~~~~
libunwind-1.8.1/src/dwarf/Gfind_proc_info-lsb.c:29: included_from: Included from here.
/usr/lib/gcc/x86_64-redhat-linux/15/include/stddef.h:468:9: note: this is the location of the previous definition
#  468 | #define unreachable() (__builtin_unreachable ())
#      |         ^~~~~~~~~~~
#  144|   
#  145|   #if defined(HAVE__BUILTIN_UNREACHABLE)
#  146|-> # define unreachable() __builtin_unreachable()
#  147|   #else
#  148|   # define unreachable() do { } while (1)

Error: COMPILER_WARNING: [#def15]
libunwind-1.8.1/src/../include/libunwind_i.h:146:10: warning[warning]: 'unreachable' redefined
#  144|   
#  145|   #if defined(HAVE__BUILTIN_UNREACHABLE)
#  146|-> # define unreachable() __builtin_unreachable()
#  147|   #else
#  148|   # define unreachable() do { } while (1)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def16]
libunwind-1.8.1/src/coredump/_UCD_create.c:59:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'ui' where non-null expected
libunwind-1.8.1/src/coredump/_UCD_create.c:59:25: acquire_memory: this call could return NULL
libunwind-1.8.1/src/coredump/_UCD_create.c:59:25: danger: argument 1 ('malloc(288)') from [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
#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-476): [#def17]
libunwind-1.8.1/src/coredump/_UCD_create.c:138:11: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'cur'
libunwind-1.8.1/src/coredump/_UCD_create.c:67:6: branch_false: following 'false' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:69:27: branch_false: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:74:6: branch_false: following 'false' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:80:7: branch_false: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:80:6: branch_false: following 'false' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:86:7: branch_false: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:86:6: branch_false: following 'false' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:109:7: branch_false: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:119:6: branch_false: following 'false' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:124:37: branch_false: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:125:40: acquire_memory: this call could return NULL
libunwind-1.8.1/src/coredump/_UCD_create.c:126:6: branch_true: following 'true' branch...
 branch_true: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:130:14: branch_true: following 'true' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:133:15: branch_true: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:133:14: branch_false: following 'false' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:138:27: branch_false: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:138:11: danger: 'cur' could be NULL: unchecked value from [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
#  136|                 goto err;
#  137|               }
#  138|->           cur->p_type   = hdr64.p_type  ;
#  139|             cur->p_flags  = hdr64.p_flags ;
#  140|             cur->p_offset = hdr64.p_offset;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def18]
libunwind-1.8.1/src/coredump/_UCD_create.c:162:11: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'cur'
libunwind-1.8.1/src/coredump/_UCD_create.c:67:6: branch_false: following 'false' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:69:27: branch_false: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:74:6: branch_false: following 'false' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:80:7: branch_false: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:80:6: branch_false: following 'false' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:86:7: branch_false: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:86:6: branch_false: following 'false' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:109:7: branch_false: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:111:15: branch_false: following 'false' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:119:6: branch_false: following 'false' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:124:37: branch_false: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:125:40: acquire_memory: this call could return NULL
libunwind-1.8.1/src/coredump/_UCD_create.c:126:6: branch_false: following 'false' branch...
 branch_false: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:154:14: branch_true: following 'true' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:157:15: branch_true: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:157:14: branch_false: following 'false' branch...
libunwind-1.8.1/src/coredump/_UCD_create.c:162:27: branch_false: ...to here
libunwind-1.8.1/src/coredump/_UCD_create.c:162:11: danger: 'cur' could be NULL: unchecked value from [(13)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/12)
#  160|                 goto err;
#  161|               }
#  162|->           cur->p_type   = hdr32.p_type  ;
#  163|             cur->p_flags  = hdr32.p_flags ;
#  164|             cur->p_offset = hdr32.p_offset;

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

Error: COMPILER_WARNING: [#def20]
libunwind-1.8.1/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: GCC_ANALYZER_WARNING (CWE-835): [#def21]
libunwind-1.8.1/src/mi/Gaddress_validator.c:118:15: warning[-Wanalyzer-infinite-loop]: infinite loop
libunwind-1.8.1/src/mi/Gaddress_validator.c:118:15: danger: infinite loop here
libunwind-1.8.1/src/mi/Gaddress_validator.c:120:11: branch_true: if it ever follows 'true' branch, it will always do so...
 branch_true: ...to here
#  116|       {
#  117|         char buf;
#  118|->       bytes = read (_mem_validate_pipe[0], &buf, 1);
#  119|       }
#  120|     while ( errno == EINTR );

Error: GCC_ANALYZER_WARNING (CWE-476): [#def22]
libunwind-1.8.1/src/mi/Gdyn-remote.c:249:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'di'
libunwind-1.8.1/src/mi/Gdyn-remote.c:204:1: enter_function: entry to '_Ux86_64_Idyn_remote_find_proc_info'
libunwind-1.8.1/src/mi/Gdyn-remote.c:229:10: branch_false: following 'false' branch...
libunwind-1.8.1/src/mi/Gdyn-remote.c:230:14: call_function: inlined call to 'fetchw' from '_Ux86_64_Idyn_remote_find_proc_info'
libunwind-1.8.1/src/mi/Gdyn-remote.c:229:11: branch_false: following 'false' branch...
libunwind-1.8.1/src/mi/Gdyn-remote.c:233:12: branch_false: ...to here
libunwind-1.8.1/src/mi/Gdyn-remote.c:244:14: branch_true: following 'true' branch...
libunwind-1.8.1/src/mi/Gdyn-remote.c:246:18: branch_true: following 'true' branch (when 'di' is NULL)...
libunwind-1.8.1/src/mi/Gdyn-remote.c:247:22: branch_true: ...to here
libunwind-1.8.1/src/mi/Gdyn-remote.c:247:22: acquire_memory: this call could return NULL
libunwind-1.8.1/src/mi/Gdyn-remote.c:249:15: danger: 'di' could be NULL: unchecked value from [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  247|                   di = calloc (1, sizeof (*di));
#  248|   
#  249|->               di->start_ip = start_ip;
#  250|                 di->end_ip = end_ip;
#  251|   

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

Error: COMPILER_WARNING: [#def24]
libunwind-1.8.1/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: CPPCHECK_WARNING (CWE-476): [#def25]
libunwind-1.8.1/tests/Gtest-bt.c:268: error[nullPointer]: Null pointer dereference: bad_ptr
#  266|       /* Make a NULL pointer dereference.  */
#  267|       int *bad_ptr = NULL;
#  268|->     *bad_ptr = 0;
#  269|     }
#  270|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def26]
libunwind-1.8.1/tests/Gtest-bt.c:268:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libunwind-1.8.1/tests/Gtest-bt.c:233:1: enter_function: entry to ‘main’
libunwind-1.8.1/tests/Gtest-bt.c:245:3: call_function: calling ‘bar’ from ‘main’
libunwind-1.8.1/tests/Gtest-bt.c:245:3: return_function: returning to ‘main’ from ‘bar’
libunwind-1.8.1/tests/Gtest-bt.c:250:6: branch_false: following ‘false’ branch...
libunwind-1.8.1/tests/Gtest-bt.c:253:7: branch_false: ...to here
libunwind-1.8.1/tests/Gtest-bt.c:261:6: branch_false: following ‘false’ branch...
libunwind-1.8.1/tests/Gtest-bt.c:264:7: branch_false: ...to here
libunwind-1.8.1/tests/Gtest-bt.c:264:6: branch_true: following ‘true’ branch...
libunwind-1.8.1/tests/Gtest-bt.c:268:5: branch_true: ...to here
libunwind-1.8.1/tests/Gtest-bt.c:268:5: danger: dereference of NULL ‘0’
#  266|       /* Make a NULL pointer dereference.  */
#  267|       int *bad_ptr = NULL;
#  268|->     *bad_ptr = 0;
#  269|     }
#  270|   

Error: GCC_ANALYZER_WARNING (CWE-479): [#def27]
libunwind-1.8.1/tests/Gtest-concurrent.c:64:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘printf’ from within signal handler
libunwind-1.8.1/tests/Gtest-concurrent.c:73:1: enter_function: entry to ‘worker’
libunwind-1.8.1/tests/Gtest-concurrent.c:51:1: enter_function: entry to ‘handler’
libunwind-1.8.1/tests/Gtest-concurrent.c:64:9: danger: call to ‘printf’ from within signal handler
#   62|         unw_get_reg (&c, UNW_REG_IP, &ip);
#   63|         if (verbose)
#   64|-> 	printf ("%lx: IP=%lx\n", (long) pthread_self (), (unsigned long) ip);
#   65|       }
#   66|     while ((ret = unw_step (&c)) > 0);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def28]
libunwind-1.8.1/tests/Gtest-concurrent.c:69:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘fprintf’ from within signal handler
libunwind-1.8.1/tests/Gtest-concurrent.c:73:1: enter_function: entry to ‘worker’
libunwind-1.8.1/tests/Gtest-concurrent.c:51:1: enter_function: entry to ‘handler’
libunwind-1.8.1/tests/Gtest-concurrent.c:68:6: branch_true: following ‘true’ branch...
libunwind-1.8.1/tests/Gtest-concurrent.c:69:5: branch_true: ...to here
libunwind-1.8.1/tests/Gtest-concurrent.c:69:5: danger: call to ‘fprintf’ from within signal handler
#   67|   
#   68|     if (ret < 0)
#   69|->     panic ("unw_step() returned %d\n", ret);
#   70|   }
#   71|   

Error: CPPCHECK_WARNING (CWE-457): [#def29]
libunwind-1.8.1/tests/Gtest-resume-sig.c:135: error[uninitvar]: Uninitialized variable: &foo
#  133|   	{
#  134|   	  if (verbose)
#  135|-> 	    printf ("OK: stack still at %p\n", &foo);
#  136|   	}
#  137|         signal (SIGUSR2, SIG_IGN);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def30]
libunwind-1.8.1/tests/crasher.c:24:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/self/maps", "r")’
libunwind-1.8.1/tests/crasher.c:21:18: acquire_resource: opened here
libunwind-1.8.1/tests/crasher.c:24:9: danger: ‘fopen("/proc/self/maps", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   22|       FILE *out = fopen(fname, "w");
#   23|   
#   24|->     if (!maps || !out)
#   25|           exit(EXIT_FAILURE);
#   26|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def31]
libunwind-1.8.1/tests/crasher.c:24:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "w")’
libunwind-1.8.1/tests/crasher.c:22:17: acquire_resource: opened here
libunwind-1.8.1/tests/crasher.c:24:9: danger: ‘fopen(fname, "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   22|       FILE *out = fopen(fname, "w");
#   23|   
#   24|->     if (!maps || !out)
#   25|           exit(EXIT_FAILURE);
#   26|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
libunwind-1.8.1/tests/crasher.c:24:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/self/maps", "r")’
libunwind-1.8.1/tests/crasher.c:21:18: acquire_memory: allocated here
libunwind-1.8.1/tests/crasher.c:24:9: danger: ‘fopen("/proc/self/maps", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   22|       FILE *out = fopen(fname, "w");
#   23|   
#   24|->     if (!maps || !out)
#   25|           exit(EXIT_FAILURE);
#   26|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
libunwind-1.8.1/tests/crasher.c:24:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "w")’
libunwind-1.8.1/tests/crasher.c:22:17: acquire_memory: allocated here
libunwind-1.8.1/tests/crasher.c:24:9: danger: ‘fopen(fname, "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#   22|       FILE *out = fopen(fname, "w");
#   23|   
#   24|->     if (!maps || !out)
#   25|           exit(EXIT_FAILURE);
#   26|   

Error: GCC_ANALYZER_WARNING (CWE-674): [#def34]
libunwind-1.8.1/tests/mapper.c:51:5: warning[-Wanalyzer-infinite-recursion]: infinite recursion
libunwind-1.8.1/tests/mapper.c:46:32: enter_function: entry to ‘push_some_stacks’
libunwind-1.8.1/tests/mapper.c:48:6: branch_true: following ‘true’ branch (when ‘n > 0’)...
libunwind-1.8.1/tests/mapper.c:50:5: branch_true: ...to here
libunwind-1.8.1/tests/mapper.c:50:5: call_function: calling ‘push_some_stacks’ from ‘push_some_stacks’
#   49|     {
#   50|       push_some_stacks(n - 1);
#   51|->     push_some_stacks(n - 1);
#   52|     }
#   53|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
libunwind-1.8.1/tests/test-ptrace-misc.c:100:6: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
libunwind-1.8.1/tests/test-ptrace-misc.c:110:1: enter_function: entry to ‘main’
libunwind-1.8.1/tests/test-ptrace-misc.c:119:3: call_function: calling ‘bar’ from ‘main’
#   98|          ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
#   99|          )))))))))))))))))))))))))))))))))))))))))))))))))))))));
#  100|->   if (r < 2)
#  101|       v = r;
#  102|   

Error: CPPCHECK_WARNING (CWE-401): [#def36]
libunwind-1.8.1/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|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def37]
libunwind-1.8.1/tests/test-ptrace.c:112:11: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘sp’
libunwind-1.8.1/tests/test-ptrace.c:180:1: enter_function: entry to ‘main’
libunwind-1.8.1/tests/test-ptrace.c:232:6: branch_false: following ‘false’ branch...
libunwind-1.8.1/tests/test-ptrace.c:266:3: branch_false: ...to here
libunwind-1.8.1/tests/test-ptrace.c:270:10: branch_true: following ‘true’ branch...
libunwind-1.8.1/tests/test-ptrace.c:272:13: branch_true: ...to here
libunwind-1.8.1/tests/test-ptrace.c:371:11: call_function: calling ‘do_backtrace’ from ‘main’
#  110|   	      sprintf (buf + len, "+0x%lx", (unsigned long) off);
#  111|   	    }
#  112|-> 	  printf ("%016lx %-32s (sp=%016lx)\n", (long) ip, buf, (long) sp);
#  113|   	}
#  114|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def38]
libunwind-1.8.1/tests/test-ptrace.c:237:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
libunwind-1.8.1/tests/test-ptrace.c:232:6: branch_true: following ‘true’ branch...
libunwind-1.8.1/tests/test-ptrace.c:236:11: branch_true: ...to here
libunwind-1.8.1/tests/test-ptrace.c:236:10: branch_true: following ‘true’ branch...
libunwind-1.8.1/tests/test-ptrace.c:237:9: branch_true: ...to here
libunwind-1.8.1/tests/test-ptrace.c:237:9: acquire_resource: opened here
libunwind-1.8.1/tests/test-ptrace.c:237:9: danger: ‘open("/dev/null", 1)’ leaks here; was opened at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  235|   
#  236|         if (!verbose)
#  237|-> 	dup2 (open ("/dev/null", O_WRONLY), 1);
#  238|   
#  239|   #if HAVE_DECL_PTRACE_TRACEME

Error: GCC_ANALYZER_WARNING: [#def39]
libunwind-1.8.1/tests/test-ptrace.c:237:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘open("/dev/null", 1)’
libunwind-1.8.1/tests/test-ptrace.c:232:6: branch_true: following ‘true’ branch...
libunwind-1.8.1/tests/test-ptrace.c:236:11: branch_true: ...to here
libunwind-1.8.1/tests/test-ptrace.c:236:10: branch_true: following ‘true’ branch...
libunwind-1.8.1/tests/test-ptrace.c:237:9: branch_true: ...to here
libunwind-1.8.1/tests/test-ptrace.c:237:9: acquire_resource: opened here
libunwind-1.8.1/tests/test-ptrace.c:237:9: danger: ‘open("/dev/null", 1)’ could be invalid: unchecked value from [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  235|   
#  236|         if (!verbose)
#  237|-> 	dup2 (open ("/dev/null", O_WRONLY), 1);
#  238|   
#  239|   #if HAVE_DECL_PTRACE_TRACEME

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-250.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibunwind-1.8.1-2.fc43
store-results-to/tmp/tmpdx5insfu/libunwind-1.8.1-2.fc43.tar.xz
time-created2025-04-25 14:10:51
time-finished2025-04-25 14:12:39
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpdx5insfu/libunwind-1.8.1-2.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpdx5insfu/libunwind-1.8.1-2.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9