Fixed defects

List of Defects

Error: CLANG_WARNING: [#def1]
perl-5.38.2-build/perl-5.38.2/class.c:974:52: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value
#  972|               continue;
#  973|   
#  974|->         if(field_attributes[i].requires_value && !(value && SvOK(value)))
#  975|               croak("Field attribute %" SVf " requires a value", SVfARG(name));
#  976|   

Error: CLANG_WARNING: [#def2]
perl-5.38.2-build/perl-5.38.2/class.c:977:9: warning[core.CallAndMessage]: 3rd function call argument is an uninitialized value
#  975|               croak("Field attribute %" SVf " requires a value", SVfARG(name));
#  976|   
#  977|->         (*field_attributes[i].apply)(aTHX_ pn, value);
#  978|           return;
#  979|       }

Error: CPPCHECK_WARNING: [#def3]
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: COMPILER_WARNING (CWE-563): [#def4]
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c: scope_hint: In function ‘main’
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c:7:13: warning[-Wunused-variable]: unused variable ‘tictoc’
#    7 |     clock_t tictoc;
#      |             ^~~~~~

Error: COMPILER_WARNING (CWE-457): [#def5]
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c:9:12: warning[-Wmaybe-uninitialized]: ‘ts1’ may be used uninitialized
#    9 |     ret1 = futimens(0, ts1);
#      |            ^~~~~~~~~~~~~~~~
perl-5.38.2-build/perl-5.38.2/perl.h:1789: included_from: Included from here.
/usr/include/sys/stat.h:452:12: note: by argument 2 of type ‘const struct timespec[2]’ to ‘futimens’ declared here
#  452 | extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
#      |            ^~~~~~~~
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c:8:21: note: ‘ts1’ declared here
#    8 |     struct timespec ts1[2], ts2[2];
#      |                     ^~~

Error: COMPILER_WARNING (CWE-252): [#def6]
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c: scope_hint: In function ‘main’
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c:11:5: warning[-Wunused-result]: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’
#   11 |     read(0, buf, 0); /* Assuming reading nothing updates atime (the [0]) */
#      |     ^~~~~~~~~~~~~~~

Error: COMPILER_WARNING (CWE-457): [#def7]
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c:12:12: warning[-Wmaybe-uninitialized]: ‘ts1’ may be used uninitialized
#   12 |     ret1 = utimensat(AT_FDCWD, "/dev/stdin", ts1, 0);
#      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
perl-5.38.2-build/perl-5.38.2/perl.h:1789: included_from: Included from here.
/usr/include/sys/stat.h:433:12: note: by argument 3 of type ‘const struct timespec[2]’ to ‘utimensat’ declared here
#  433 | extern int utimensat (int __fd, const char *__path,
#      |            ^~~~~~~~~
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c:9:21: note: ‘ts1’ declared here
#    9 |     struct timespec ts1[2], ts2[2];
#      |                     ^~~

Error: GCC_ANALYZER_WARNING (CWE-457): [#def8]
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c: scope_hint: In function ‘main’
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c:13:38: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ts1[0].tv_nsec’

Error: CLANG_WARNING: [#def9]
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c:13:47: warning[core.UndefinedBinaryOperatorResult]: The left operand of '!=' is a garbage value

Error: COMPILER_WARNING (CWE-252): [#def10]
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c: scope_hint: In function ‘main’
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c:14:5: warning[-Wunused-result]: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’
#   14 |     read(0, buf, 0); /* Assuming reading nothing updates atime (the [0]) */
#      |     ^~~~~~~~~~~~~~~

Error: COMPILER_WARNING (CWE-563): [#def11]
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c:16:17: warning[-Wunused-but-set-variable]: variable ‘st’ set but not used
#   16 |     struct stat st;
#      |                 ^~

Error: GCC_ANALYZER_WARNING (CWE-457): [#def12]
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c: scope_hint: In function ‘main’
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c:16:38: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ts1[0].tv_nsec’

Error: CLANG_WARNING: [#def13]
perl-5.38.2-build/perl-5.38.2/dist/Time-HiRes/tmp25136.c:16:47: warning[core.UndefinedBinaryOperatorResult]: The left operand of '!=' is a garbage value

Error: CLANG_WARNING: [#def14]
perl-5.38.2-build/perl-5.38.2/doop.c:720:29: warning[core.NullDereference]: Access to field 'sv_flags' results in a dereference of a null pointer
#  718|               const char *s = SvPV_const(*mark,len);
#  719|               sv_catpvn_flags(sv,s,len,
#  720|->                             DO_UTF8(*mark) ? SV_CATUTF8 : SV_CATBYTES);
#  721|           }
#  722|       }

Error: CPPCHECK_WARNING: [#def15]
perl-5.38.2-build/perl-5.38.2/ext/PerlIO-scalar/scalar.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def16]
perl-5.38.2-build/perl-5.38.2/ext/XS-Typemap/Typemap.xs:920:3: warning[deadcode.DeadStores]: Value stored to 'dummy' is never read
#  918|     U32 size_RETVAL;
#  919|    CODE:
#  920|->   dummy += 0; /* Fix -Wall */
#  921|     size_RETVAL = ix_array;
#  922|     RETVAL = array;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def17]
perl-5.38.2-build/perl-5.38.2/perl.h:3327: included_from: Included from here.
perl-5.38.2-build/perl-5.38.2/handy.h:99:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cv’
perl-5.38.2-build/perl-5.38.2/cv.h:91:36: note: in expansion of macro ‘MUTABLE_PTR’
perl-5.38.2-build/perl-5.38.2/cv.h:153:34: note: in expansion of macro ‘CvFLAGS’
perl-5.38.2-build/perl-5.38.2/pp_sort.c:761:27: note: in expansion of macro ‘CvANON’
perl-5.38.2-build/perl-5.38.2/scope.h:151:15: note: in expansion of macro ‘push_scope’
perl-5.38.2-build/perl-5.38.2/pp_sort.c:717:5: note: in expansion of macro ‘ENTER’
perl-5.38.2-build/perl-5.38.2/embed.h:259:82: note: in definition of macro ‘gv_autoload_pvn’
perl-5.38.2-build/perl-5.38.2/hv.h:460:46: note: in expansion of macro ‘HEK_KEY’
perl-5.38.2-build/perl-5.38.2/hv.h:474:34: note: in expansion of macro ‘HEK_FLAGS’
perl-5.38.2-build/perl-5.38.2/gv.h:68:33: note: in expansion of macro ‘HEK_UTF8’
perl-5.38.2-build/perl-5.38.2/gv.h:26:34: note: in expansion of macro ‘SvANY’
perl-5.38.2-build/perl-5.38.2/gv.h:65:34: note: in expansion of macro ‘GvXPVGV’
perl-5.38.2-build/perl-5.38.2/gv.h:68:42: note: in expansion of macro ‘GvNAME_HEK’
perl-5.38.2-build/perl-5.38.2/pp_sort.c:767:29: note: in expansion of macro ‘GvNAMEUTF8’
perl-5.38.2-build/perl-5.38.2/perl.h:4534: included_from: Included from here.
perl-5.38.2-build/perl-5.38.2/gv.h:140:26: note: in expansion of macro ‘GvGP’
perl-5.38.2-build/perl-5.38.2/pp_sort.c:770:30: note: in expansion of macro ‘GvCVu’
perl-5.38.2-build/perl-5.38.2/pp_sort.c:770:30: note: in expansion of macro ‘GvCVu’
perl-5.38.2-build/perl-5.38.2/cv.h:91:36: note: in expansion of macro ‘MUTABLE_PTR’
perl-5.38.2-build/perl-5.38.2/cv.h:153:34: note: in expansion of macro ‘CvFLAGS’
perl-5.38.2-build/perl-5.38.2/pp_sort.c:761:27: note: in expansion of macro ‘CvANON’
perl-5.38.2-build/perl-5.38.2/cv.h:91:36: note: in expansion of macro ‘MUTABLE_PTR’
perl-5.38.2-build/perl-5.38.2/cv.h:153:34: note: in expansion of macro ‘CvFLAGS’
perl-5.38.2-build/perl-5.38.2/pp_sort.c:761:27: note: in expansion of macro ‘CvANON’
#   97|    */
#   98|   #if defined(PERL_USE_GCC_BRACE_GROUPS)
#   99|-> #  define MUTABLE_PTR(p) ({ void *p_ = (p); p_; })
#  100|   #else
#  101|   #  define MUTABLE_PTR(p) ((void *) (p))

Error: CLANG_WARNING: [#def18]
perl-5.38.2-build/perl-5.38.2/cpan/Encode/Encode.xs:8: included_from: Included from here.
perl-5.38.2-build/perl-5.38.2/perl.h:7811: included_from: Included from here.
perl-5.38.2-build/perl-5.38.2/inline.h:1928:15: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1926|   
# 1927|       if (len == 0) {
# 1928|->         len = strlen((const char *) s);
# 1929|       }
# 1930|   

Error: CPPCHECK_WARNING (CWE-758): [#def19]
perl-5.38.2-build/perl-5.38.2/locale.c:3502: error[shiftTooManyBits]: Shifting 32-bit value by 4294967295 bits is undefined behaviour
# 3500|           /* The first call to S_populate_hash_from_localeconv() will be for the
# 3501|            * MONETARY values */
# 3502|->         index_bits = INDEX_TO_BIT(monetary_index);
# 3503|           locale = monetary_locale;
# 3504|   

Error: CPPCHECK_WARNING (CWE-758): [#def20]
perl-5.38.2-build/perl-5.38.2/locale.c:3508: error[shiftTooManyBits]: Shifting 32-bit value by 4294967295 bits is undefined behaviour
# 3506|            * do the NUMERIC values in the same call */
# 3507|           if (strEQ(numeric_locale, monetary_locale)) {
# 3508|->             index_bits |= INDEX_TO_BIT(numeric_index);
# 3509|           }
# 3510|           else {

Error: CPPCHECK_WARNING (CWE-758): [#def21]
perl-5.38.2-build/perl-5.38.2/locale.c:3545: error[shiftTooManyBits]: Shifting 32-bit value by 4294967295 bits is undefined behaviour
# 3543|        * NUMERIC fields */
# 3544|       if (requires_2nd_localeconv) {
# 3545|->         populate_hash_from_localeconv(hv,
# 3546|                                         numeric_locale,
# 3547|                                         INDEX_TO_BIT(numeric_index),

Error: CPPCHECK_WARNING (CWE-457): [#def22]
perl-5.38.2-build/perl-5.38.2/locale.c:4144: error[uninitvar]: Uninitialized variable: cat_index
# 4142|   
# 4143|       {
# 4144|->         return my_langinfo_i(item, cat_index, querylocale_i(cat_index),
# 4145|                                &PL_langinfo_buf, &PL_langinfo_bufsize, utf8ness);
# 4146|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def23]
perl-5.38.2-build/perl-5.38.2/mg.c:2639:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mg’
perl-5.38.2-build/perl-5.38.2/mg.c:2636:19: note: in expansion of macro ‘mg_find’
perl-5.38.2-build/perl-5.38.2/mg.c:2636:19: note: in expansion of macro ‘mg_find’
perl-5.38.2-build/perl-5.38.2/sv.h:1440:36: note: in expansion of macro ‘SvANY’
perl-5.38.2-build/perl-5.38.2/mg.c:373:19: note: in expansion of macro ‘SvMAGIC’
perl-5.38.2-build/perl-5.38.2/mg.c: scope_hint: In function ‘Perl_defelem_target’
perl-5.38.2-build/perl-5.38.2/mg.c:2636:19: note: in expansion of macro ‘mg_find’
# 2637|       assert(mg);
# 2638|       if (LvTARGLEN(sv)) {
# 2639|->         if (mg->mg_obj) {
# 2640|               SV * const ahv = LvTARG(sv);
# 2641|               HE * const he = hv_fetch_ent(MUTABLE_HV(ahv), mg->mg_obj, FALSE, 0);

Error: CPPCHECK_WARNING (CWE-562): [#def24]
perl-5.38.2-build/perl-5.38.2/perl.c:5239: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
# 5237|               SAVEFREESV(cv);
# 5238|           }
# 5239|->         JMPENV_PUSH(ret);
# 5240|           switch (ret) {
# 5241|           case 0:

Error: GCC_ANALYZER_WARNING (CWE-127): [#def25]
perl-5.38.2-build/perl-5.38.2/pp_sort.c:469:28: warning[-Wanalyzer-out-of-bounds]: stack-based buffer under-read
perl-5.38.2-build/perl-5.38.2/pp_sort.c: scope_hint: In function ‘sortsv_cmp_locale’
perl-5.38.2-build/perl-5.38.2/perl.h:6227: included_from: Included from here.
perl-5.38.2-build/perl-5.38.2/pp_sort.c:31: included_from: Included from here.
perl-5.38.2-build/perl-5.38.2/pp_sort.c:654:5: note: in expansion of macro ‘sortsv_flags_impl’
perl-5.38.2-build/perl-5.38.2/pp_sort.c:469:28: note: valid subscripts for ‘stack’ are ‘[0]’ to ‘[59]’
#  └──────────────────────┘
#             ^
#  467|                   --stackp;
#  468|                   t = list1; list1 = list2; list2 = t;    /* swap lists */
#  469|->             } while ((runs = stackp->runs) == 0);
#  470|           }
#  471|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def26]
perl-5.38.2-build/perl-5.38.2/pp_sort.c: scope_hint: In function ‘Perl_pp_sort’
perl-5.38.2-build/perl-5.38.2/pp_sort.c:741:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
perl-5.38.2-build/perl-5.38.2/scope.h:151:15: note: in expansion of macro ‘push_scope’
perl-5.38.2-build/perl-5.38.2/pp_sort.c:717:5: note: in expansion of macro ‘ENTER’
perl-5.38.2-build/perl-5.38.2/perl.h:4538: included_from: Included from here.
perl-5.38.2-build/perl-5.38.2/op.h:1080:39: note: in definition of macro ‘OpSIBLING’
perl-5.38.2-build/perl-5.38.2/op.h:474:25: note: in expansion of macro ‘cLISTOPx’
perl-5.38.2-build/perl-5.38.2/op.h:474:34: note: in expansion of macro ‘PL_op’
perl-5.38.2-build/perl-5.38.2/pp_sort.c:739:36: note: in expansion of macro ‘cLISTOP’
perl-5.38.2-build/perl-5.38.2/pp_sort.c:739:26: note: in expansion of macro ‘OpSIBLING’
#  739|               OP *nullop = OpSIBLING(cLISTOP->op_first);  /* pass pushmark */
#  740|               assert(nullop->op_type == OP_NULL);
#  741|->             PL_sortcop = nullop->op_next;
#  742|           }
#  743|           else {

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
diffbase-analyzer-version-clang18.1.7
diffbase-analyzer-version-cppcheck2.14.2
diffbase-analyzer-version-gcc14.1.1
diffbase-analyzer-version-gcc-analyzer14.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-35.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-nameperl-5.40.0-509.fc41
diffbase-store-results-to/tmp/tmpbcwepj6a/perl-5.40.0-509.fc41.tar.xz
diffbase-time-created2024-07-03 16:43:39
diffbase-time-finished2024-07-03 16:53:20
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpbcwepj6a/perl-5.40.0-509.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpbcwepj6a/perl-5.40.0-509.fc41.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-35.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-nameperl-5.38.2-506.fc40
store-results-to/tmp/tmpaocige10/perl-5.38.2-506.fc40.tar.xz
time-created2024-07-03 16:33:00
time-finished2024-07-03 16:43:14
titleFixed defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpaocige10/perl-5.38.2-506.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpaocige10/perl-5.38.2-506.fc40.src.rpm'
tool-versioncsmock-3.5.3-1.el9