Project

General

Profile

Bug #12172

genunix: variable may be used uninitialized

Added by Toomas Soome 3 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build errors with gcc 9. Collected issues from intel/genunix tree:

    ../../common/vm/seg_spt.c: In function 'segspt_create':
    ../../common/vm/seg_spt.c:727:4: error: 'ppa' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      727 |    page_unlock(ppa[i]);
          |    ^~~~~~~~~~~~~~~~~~~
    ../../common/vm/seg_spt.c: In function 'segspt_free_pages':
    ../../common/vm/seg_spt.c:868:5: error: 'rootpp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      868 |     page_destroy_pages(rootpp);
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/vm/seg_spt.c:896:3: error: 'sp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      896 |   mutex_exit(&sp->shm_mlock);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/vm/seg_spt.c:895:4: error: 'proj' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      895 |    rctl_decr_locked_mem(NULL, proj, unlocked_bytes, 0);
          |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    In file included from ../../common/sys/cpuvar.h:47,
                     from ../../common/sys/vtrace.h:42,
                     from ../../common/vm/seg_kp.c:60:
    ../../common/vm/seg_kp.c: In function 'segkp_get_internal':
    ../../common/sys/bitmap.h:86:23: error: 'segkpindex' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       86 |  ((bitmap)[(bitindex) >> BT_ULSHIFT])
          |                       ^~
    ../../common/vm/seg_kp.c:394:10: note: 'segkpindex' was declared here
      394 |  pgcnt_t segkpindex;
          |          ^~~~~~~~~~
    In file included from ../../common/sys/cpuvar.h:47,
                     from ../../common/sys/vtrace.h:42,
                     from ../../common/vm/seg_kp.c:60:
    ../../common/vm/seg_kp.c: In function 'segkp_release_internal':
    ../../common/sys/bitmap.h:86:23: error: 'segkpindex' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       86 |  ((bitmap)[(bitindex) >> BT_ULSHIFT])
          |                       ^~
    ../../common/vm/seg_kp.c:648:11: note: 'segkpindex' was declared here
      648 |  pgcnt_t  segkpindex;
          |           ^~~~~~~~~~

    ../../common/vm/vm_usage.c: In function 'vmu_calculate_seg':
    ../../common/vm/vm_usage.c:1239:29: error: 's_start' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1239 |      cur->vmb_end = s_index + p_bound_size;
          |                     ~~~~~~~~^~~~~~~~~~~~~~
    ../../common/vm/vm_usage.c:1099:37: error: 'p_end' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1099 |  pgcnt_t p_index, s_index, p_start, p_end, s_start, s_end, rss, virt;
          |                                     ^~~~~

    ../../common/os/waitq.c: In function 'waitq_link':
    ../../common/os/waitq.c:145:22: error: 'last_tp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      145 |   last_tp->t_priforw = t;
          |   ~~~~~~~~~~~~~~~~~~~^~~

    ../../common/os/modsysfile.c: In function 'append':
    ../../common/os/modsysfile.c:3150:17: error: 'last' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3150 |  last->hwc_next = spec;
          |  ~~~~~~~~~~~~~~~^~~~~~

    ../../common/os/modctl.c: In function 'modctl_modinfo':
    ../../common/os/modctl.c:449:6: error: 'nobase' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      449 |   if (!nobase && (uintptr_t)modi.mi_base > UINT32_MAX)
          |      ^
    ../../common/os/modctl.c: In function 'modctl_update_driver_aliases':
    ../../common/os/modctl.c:688:3: error: 'aliases' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      688 |   kmem_free(aliases, mc.num_aliases * sizeof (struct alias_info));
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/os/modctl.c: In function 'modloadonly':
    ../../common/os/modctl.c:2790:6: error: 'id' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2790 |  int id, retval;
          |      ^~

    ../../common/os/zone.c: In function 'zone_list':
    ../../common/os/zone.c:6389:3: error: 'zoneids' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     6389 |   kmem_free(zoneids, real_nzones * sizeof (zoneid_t));
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/syscall/sendfile.c -mcmodel=kernel
    ../../common/syscall/sendfile.c: In function 'sendvec_chunk':
    ../../common/syscall/sendfile.c:933:47: error: 'stp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      933 |     copyflag = stp != NULL ? stp->sd_copyflag :
          |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
      934 |         so->so_proto_props.sopp_zcopyflag;
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/syscall/sendfile.c:788:12: error: 'so' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      788 |      if (so->so_filter_active > 0 &&
          |          ~~^~~~~~~~~~~~~~~~~~
    ../../common/syscall/sendfile.c:808:22: error: 'wroff' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      808 |          dmp->b_rptr + wroff;
          |          ~~~~~~~~~~~~^~~~~~~
    In file included from ../../common/syscall/sendfile.c:34:
    ../../common/sys/sysmacros.h:57:36: error: 'maxblk' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       57 | #define MIN(a, b) ((a) < (b) ? (a) : (b))
          |                                    ^
    ../../common/syscall/sendfile.c:706:6: note: 'maxblk' was declared here
      706 |  int maxblk, wroff, tail_len;
          |      ^~~~~~
    ../../common/syscall/sendfile.c:804:12: error: 'extra' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      804 |      dmp = allocb(iov_len + extra, BPRI_HI);
          |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from ../../common/syscall/sendfile.c:56:
    ../../common/syscall/sendfile.c: In function 'sendfilev':
    ../../common/fs/sockfs/socktpi.h:273:43: error: 'so' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      273 | #define _SOTOTPI(so) ((sotpi_info_t *)(so)->so_priv)
          |                                           ^~
    ../../common/syscall/sendfile.c:1140:17: note: 'so' was declared here
     1140 |  struct sonode *so;
          |                 ^~

    In file included from ../../common/vm/vm_as.c:51:
    ../../common/vm/vm_as.c: In function 'as_map_segvn_segs':
    ../../common/sys/sysmacros.h:246:35: error: 'pgsz' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      246 | #define P2ALIGN(x, align)  ((x) & -(align))
          |                                   ^
    ../../common/vm/vm_as.c:1441:9: note: 'pgsz' was declared here
     1441 |  size_t pgsz;
          |         ^~~~
    ../../common/vm/vm_as.c: In function 'as_map_ansegs':
    ../../common/vm/vm_as.c:1645:10: error: 'type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1645 |  uchar_t type;
          |          ^~~~
    ../../common/vm/vm_as.c: In function 'as_ctl':
    ../../common/vm/vm_as.c:2538:3: error: 'mlock_map' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2538 |   kmem_free(mlock_map, mlock_size * sizeof (ulong_t));
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/vm/vm_as.c:2538:3: error: 'mlock_size' may be used uninitialized in this function [-Werror=maybe-uninitialized]

    ../../common/os/sleepq.c: In function 'sleepq_insert':
    ../../common/os/sleepq.c:159:22: error: 'last_tp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      159 |   last_tp->t_priforw = t;
          |   ~~~~~~~~~~~~~~~~~~~^~~

    ../../common/fs/vnode.c: In function 'vn_vfslocks_rele':
    ../../common/fs/vnode.c:2104:20: error: 'pvep' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2104 |      pvep->ve_next = vep->ve_next;
          |      ~~~~~~~~~~~~~~^~~~~~~~~~~~~~

    ../../common/os/taskq.c: In function 'taskq_d_thread':
    ../../common/os/taskq.c:1799:33: error: 'w' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1799 |   if ((tqe->tqent_func == NULL) &&
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
     1800 |       ((w == -1) || (bucket->tqbucket_flags & TQBUCKET_CLOSE))) {
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/os/timer.c: In function 'timer_fire':
    ../../common/os/timer.c:459:4: error: 'p' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      459 |    sigaddqa(p, NULL, it->it_sigq);
          |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/os/sunndi.c: In function 'i_ddi_fault_logger':
    ../../common/os/sunndi.c:2374:2: error: 'still' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2374 |  cmn_err(level, "!%s%d: %s %s device; service %s%s"+(bad|changed),
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     2375 |      ddi_driver_name(fedp->f_dip), ddi_get_instance(fedp->f_dip),
          |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     2376 |      bad ? "invalid report of fault" : action,
          |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     2377 |      location, still ? "still " : "", servstate);
          |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/os/sunddi.c: In function 'ddi_prop_search_common':
    ../../common/os/sunddi.c:1373:4: error: 'buffer' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1373 |    bcopy(propp->prop_val, buffer, propp->prop_len);
          |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/os/sunddi.c: In function 'impl_ddi_bus_prop_op':
    ../../common/os/sunddi.c:4379:3: error: 'buffer' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4379 |   (void) impl_fix_props(dip, ch_dip, name, len, buffer);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/os/vmem.c: In function 'vmem_xalloc':
    ../../common/os/vmem.c:1188:4: error: 'xsize' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1188 |    vmp->vm_source_free(vmp->vm_source, xvaddr, xsize);
          |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/os/vmem.c:945:12: error: 'addr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      945 |  uintptr_t addr, taddr, start, end;
          |            ^~~~

    ../../common/fs/vfs.c: In function 'domount':
    ../../common/fs/vfs.c:1652:19: error: 'ovflags' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1652 |    vfsp->vfs_flag = ovflags;
          |    ~~~~~~~~~~~~~~~^~~~~~~~~

    In file included from ../../common/sys/t_lock.h:38,
                     from ../../common/vm/seg_dev.c:48:
    ../../common/vm/seg_dev.c: In function 'ddi_segmap_setup':
    ../../common/sys/param.h:447:34: error: 'pfn' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      447 | #define ptob(x)  (((pgcnt_t)(x)) << PAGESHIFT)
          |                                  ^~
    ../../common/vm/seg_dev.c:2407:8: note: 'pfn' was declared here
     2407 |  pfn_t pfn;
          |        ^~~
    ../../common/vm/seg_dev.c: In function 'devmap_roundup':
    ../../common/vm/seg_dev.c:2711:10: error: 'poff' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2711 |  ulong_t poff;
          |          ^~~~
    ../../common/vm/seg_dev.c:2753:22: error: 'pg' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2753 |  rlen = len + offset - (poff - base + pg);
          |         ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~

    ../../common/os/sunpci.c: In function 'pci_post_suspend':
    ../../common/os/sunpci.c:1145:4: error: 'pmcsr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1145 |    pci_config_put16(hdl, p->ppc_cap_offset + PCI_PMCSR,
          |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1146 |        pmcsr);
          |        ~~~~~~

    ../../common/os/sunpm.c: In function 'pm_free_kept':
    ../../common/os/sunpm.c:2014:23: error: 'paths' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2014 |    dp->pdr_kept_paths = paths;
          |    ~~~~~~~~~~~~~~~~~~~^~~~~~~
    ../../common/os/sunpm.c: In function 'pm_parsenum':
    ../../common/os/sunpm.c:3970:16: error: 'offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3970 |   value += *np - offset;
          |            ~~~~^~~~~~~~
    ../../common/os/sunpm.c: In function 'pm_process_dep_request':
    ../../common/os/sunpm.c:6514:17: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     6514 |   work->pdw_ret = ret;
          |   ~~~~~~~~~~~~~~^~~~~

    ../../common/vm/seg_vn.c: In function 'segvn_softunlock':
    ../../common/vm/seg_vn.c:2596:14: error: 'anon_index' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2596 |    if ((ap = anon_get_ptr(amp->ahp, anon_index++))
          |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/vm/seg_vn.c: In function 'segvn_faultpage':
    ../../common/vm/seg_vn.c:3018:12: error: 'anon_index' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3018 |  if ((ap = anon_get_ptr(amp->ahp, anon_index)) == NULL)
          |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/vm/seg_vn.c: In function 'segvn_fault_vnodepages':
    ../../common/vm/seg_vn.c:4532:6: error: 'ierr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4532 |   if (ierr == -2) {
          |      ^
    ../../common/vm/seg_vn.c:4192:5: error: 'prot' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4192 |     hat_memload_array(hat, a, pgsz, ppa, prot,
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     4193 |         hat_flag);
          |         ~~~~~~~~~
    ../../common/vm/seg_vn.c: In function 'segvn_fault_anonpages':
    ../../common/vm/seg_vn.c:4849:13: error: 'ierr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4849 |   } else if (ierr == -2) {
          |             ^
    ../../common/vm/seg_vn.c:4774:4: error: 'prot' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4774 |    hat_memload_array(hat, a, pgsz, ppa,
          |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     4775 |        prot & vpprot, hat_flag);
          |        ~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/vm/seg_vn.c:4715:15: error: 'protchk' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4715 |     if ((prot & protchk) == 0) {
          |         ~~~~~~^~~~~~~~~~
    ../../common/vm/seg_vn.c: In function 'segvn_fault':
    ../../common/vm/seg_vn.c:5584:12: error: 'prot' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5584 |       prot &= ~PROT_WRITE;
    ../../common/vm/seg_vn.c:5239:11: error: 'fanon_index' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5239 |   ulong_t fanon_index;
          |           ^~~~~~~~~~~
    ../../common/vm/seg_vn.c:5238:17: error: 'vpp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5238 |   struct vpage *vpp;
          |                 ^~~
    ../../common/vm/seg_vn.c:5367:17: error: 'anon_index' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5367 |     dogetpage = non_anon(amp->ahp, anon_index,
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     5368 |         &vp_off, &vp_len);
          |         ~~~~~~~~~~~~~~~~~
    ../../common/vm/seg_vn.c: In function 'segvn_setprot':
    ../../common/vm/seg_vn.c:5680:10: error: 'pgcnt' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5680 |  pgcnt_t pgcnt;
          |          ^~~~~
    ../../common/vm/seg_vn.c:5867:6: error: 'evp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5867 |      for (cvp = svp; cvp < evp; cvp++) {
          |      ^~~
    ../../common/vm/seg_vn.c:5867:6: error: 'svp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    ../../common/vm/seg_vn.c: In function 'segvn_sync':
    ../../common/vm/seg_vn.c:7384:7: error: 'pageprot' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     7384 |    if (prot != pageprot) {
          |       ^
    ../../common/vm/seg_vn.c:7361:9: error: 'anon_index' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     7361 |    ap = anon_get_ptr(amp->ahp, anon_index++);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/vm/seg_vn.c: In function 'segvn_lockop':
    ../../common/vm/seg_vn.c:7647:10: error: 'anon_index' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     7647 |  ulong_t anon_index;
          |          ^~~~~~~~~~
    ../../common/vm/seg_vn.c:7810:18: error: 'pageprot' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     7810 |   if ((attr == 0 || VPP_PROT(vpp) == pageprot) &&
          |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/vm/seg_vn.c: In function 'segvn_advise':
    ../../common/vm/seg_vn.c:8501:13: error: 'new_svd' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     8501 |      (void) lgrp_privm_policy_set(policy,
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     8502 |          &new_svd->policy_info,
          |          ~~~~~~~~~~~~~~~~~~~~~~
     8503 |          new_seg->s_size);
          |          ~~~~~~~~~~~~~~~~
    ../../common/vm/seg_vn.c: In function 'segvn_dump':
    ../../common/vm/seg_vn.c:8729:20: error: 'anon_index' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     8729 |   if (amp && (ap = anon_get_ptr(svd->amp->ahp, anon_index++))) {
          |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/vm/seg_vn.c: In function 'segvn_pagelock':
    ../../common/vm/seg_vn.c:9401:11: error: 'wlen' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     9401 |    (void) seg_pinsert(seg, pamp, paddr, len, wlen, pl,
          |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     9402 |        rw, pflags, preclaim_callback);
          |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/vm/seg_vn.c: In function 'segvn_getmemid':
    ../../common/vm/seg_vn.c:9624:9: error: 'anon_index' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     9624 |    ap = anon_get_ptr(amp->ahp, anon_index);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/contract/process.c: In function 'ctmpl_process_set':
    ../../common/contract/process.c:204:12: error: 'param_value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      204 |  (((value) & ~((ctp)->ctp_ev_fatal | SAFE_EV)) || \
          |            ^
    ../../common/contract/process.c:232:11: note: 'param_value' was declared here
      232 |  uint64_t param_value;
          |           ^~~~~~~~~~~

    ../../common/os/sunmdi.c: In function 'mdi_pi_free':
    ../../common/os/sunmdi.c:3280:5: error: 'rv' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3280 |  if (rv == MDI_FAILURE)
          |     ^
    ../../common/os/sunmdi.c: In function 'i_mdi_pi_offline':
    ../../common/os/sunmdi.c:3918:5: error: 'rv' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3918 |  if (rv == MDI_SUCCESS) {
          |     ^
    ../../common/os/sunmdi.c: In function 'i_mdi_pi_online':
    ../../common/os/sunmdi.c:4006:5: error: 'rv' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4006 |  if (rv == MDI_SUCCESS) {
          |     ^
    ../../common/os/sunmdi.c: In function 'i_mdi_enable_disable_path':
    ../../common/os/sunmdi.c:6332:35: error: 'rv' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     6332 |    if (op == MDI_DISABLE_OP && rv == MDI_SUCCESS) {

    ../../common/syscall/psecflags.c: In function 'psecdo':
    ../../common/syscall/psecflags.c:79:2: error: 'set' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       79 |  secflags_apply_delta(set, args->delta);
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/os/streamio.c: In function 'strgetmsg':
    ../../common/os/streamio.c:7035:11: error: 'flg' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     7035 |   if (flg & MSG_HIPRI) {
    ../../common/os/streamio.c: In function 'kstrgetmsg':
    ../../common/os/streamio.c:7708:11: error: 'flg' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     7708 |   if (flg & MSG_HIPRI) {

    ../../common/os/ndifm.c: In function 'ndi_fmc_insert':
    ../../common/os/ndifm.c:269:7: error: 'fpp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      269 |  *fpp = fep;
          |  ~~~~~^~~~~
    ../../common/os/ndifm.c:274:16: error: 'fcp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      274 |   fcp->fc_head = fep;
          |   ~~~~~~~~~~~~~^~~~~

    ../../common/os/log_sysevent.c: In function 'log_sysevent_register':
    ../../common/os/log_sysevent.c:1418:3: error: 'chan' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1418 |   remove_class(chan, kdata.ps_id, databuf);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/vm/hat_refmod.c: In function 'hat_setstat':
    ../../common/vm/hat_refmod.c:195:16: error: 'nb' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      195 |    hrm->hrm_id = nb;
          |    ~~~~~~~~~~~~^~~~

    ../../common/fs/fem.c: In function 'remove_node':
    ../../common/fs/fem.c:3149:8: error: 'fn' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3149 |  if (fn->fn_av_rele)
          |      ~~^~~~~~~~~~~~

    ../../common/syscall/acl.c: In function 'cacl':
    ../../common/syscall/acl.c:357:5: error: 'dfaclbsize' may be used uninitialized
    in this function [-Werror=maybe-uninitialized]
      357 |  if (dfaclbsize && vsecattr.vsa_dfaclentp)
          |     ^

    ../../common/os/contract.c: In function 'ctmpl_set':
    ../../common/os/contract.c:1570:40: error: 'param_value' may be used uninitializ
    ed in this function [-Werror=maybe-uninitialized]
     1570 |   } else if ((~template->ctmpl_ev_crit & param_value) == 0) {
          |              ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
    ../../common/os/contract.c: In function 'ctmpl_get':
    ../../common/os/contract.c:1635:16: error: 'param_value' may be used uninitializ
    ed in this function [-Werror=maybe-uninitialized]
     1635 |   *param_value = template->ctmpl_ev_crit;
          |   ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

    In file included from ../../../common/devid/devid.c:37:
    ../../../common/devid/devid.c: In function 'devid_str_decode_id':
    ../../../common/devid/devid_impl.h:55:26: error: 'devid_len' may be used uniniti
    alized in this function [-Werror=maybe-uninitialized]
       55 | #define DEVID_FREE(x, n) kmem_free(x, n)
          |                          ^~~~~~~~~
    ../../../common/devid/devid.c:324:13: note: 'devid_len' was declared here
      324 |  int  slen, devid_len, ascii, i, n, c, pre_alloc = FALSE;
          |             ^~~~~~~~~

    ../../common/os/devid_cache.c: In function 'e_devid_cache_path_to_devid':
    ../../common/os/devid_cache.c:1152:7: error: 'ualen' may be used uninitialized i
    n this function [-Werror=maybe-uninitialized]
     1152 |       strncmp(ua, uasep + 1, ualen) != 0)
          |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/os/devid_cache.c:1135:29: error: 'pathlen' may be used uninitialize
    d in this function [-Werror=maybe-uninitialized]
     1135 |       strchr(cand + pathlen + 1, '/') != NULL)
          |                             ^

    ../../common/os/devcfg.c: In function 'i_ddi_alloc_node':
    ../../common/os/devcfg.c:365:21: error: 'elem' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      365 |   devimap->dno_free = elem;
          |   ~~~~~~~~~~~~~~~~~~^~~~~~
    ../../common/os/devcfg.c: In function 'find_sibling':
    ../../common/os/devcfg.c:2252:32: error: 'buf' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2252 |     if ((callback == NULL) || (callback(
          |                                ^~~~~~~~~
     2253 |         dip, buf, MAXNAMELEN) != DDI_SUCCESS))
          |         ~~~~~~~~~~~~~~~~~~~~~

    ../../common/os/flock.c: In function 'flk_wait_execute_request':
    ../../common/os/flock.c:1445:25: error: 'index' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1445 |   if (fg->lockmgr_status[index] != FLK_LOCKMGR_UP &&
          |       ~~~~~~~~~~~~~~~~~~^~~~~~~
    ../../common/os/flock.c:1445:25: error: 'fg' may be used uninitialized in this function [-Werror=maybe-uninitialized]

    In file included from ../../common/os/fork.c:80:
    ../../common/os/fork.c: In function 'cfork':
    ../../common/sys/brand.h:149:32: error: 'clone' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      149 | #define BROP(p)   ((p)->p_brand->b_ops)
          |                                ^~
    ../../common/os/fork.c:158:10: note: 'clone' was declared here
      158 |  klwp_t *clone;
          |          ^~~~~

    ../../common/contract/device.c: In function 'ctmpl_device_set':
    ../../common/contract/device.c:541:6: error: 'param_value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      541 |   if (param_value == CTDP_NONEG_SET &&
          |      ^
    ../../common/contract/device.c: In function 'contract_device_negotiate':
    ../../common/contract/device.c:2041:6: error: 'result' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2041 |  int result;
          |      ^~~~~~

    ../../common/os/kmem.c: In function 'kmem_cache_create':
    ../../common/os/kmem.c:3890:32: error: 'bestfit' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3890 |   cp->cache_maxcolor = bestfit % chunksize;
          |                        ~~~~~~~~^~~~~~~~~~~

    ../../common/fs/lookup.c: In function 'dirfindvp':
    ../../common/fs/lookup.c:906:15: error: 'dp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      906 |     dp->d_off = 2;
          |     ~~~~~~~~~~^~~

    ../../common/syscall/memcntl.c: In function 'memcntl':
    ../../common/syscall/memcntl.c:341:21: error: 'oszc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      341 |     p->p_stkpageszc = oszc;
          |     ~~~~~~~~~~~~~~~~^~~~~~

    ../../common/syscall/lwpsys.c: In function 'lwp_wait':
    ../../common/syscall/lwpsys.c:178:12: error: 'target_lep' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      178 |  lwpent_t *target_lep;
          |            ^~~~~~~~~~

    ../../common/syscall/lgrpsys.c: In function 'lgrp_affinity_set':
    ../../common/syscall/lgrpsys.c:712:8: error: 'retval' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      712 |  int   retval;
          |        ^~~~~~

    ../../common/os/devpolicy.c: In function 'devpolicy_load':
    ../../common/os/devpolicy.c:525:13: error: 'newpolicy' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      525 |    newpolicy[j].t_major = curmaj = items[i].dps_maj;
          |             ^
    ../../common/os/devpolicy.c:475:52: error: 'lastwild' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      475 |   } else if (lastmajor > curmaj || lastwild > wild ||
      476 |       lastwild && lastlen < len) {
          |       ~~~~~~~~
    ../../common/os/devpolicy.c:476:27: error: 'lastlen' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      476 |       lastwild && lastlen < len) {
          |                   ~~~~~~~~^~~~~
    ../../common/os/devpolicy.c:475:24: error: 'lastmajor' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      475 |   } else if (lastmajor > curmaj || lastwild > wild ||
          |              ~~~~~~~~~~^~~~~~~~

    ../../common/os/pcifm.c: In function 'pci_fm_ereport_post':
    ../../common/os/pcifm.c:1200:3: error: 'eqep' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1200 |   errorq_commit(ereport_errorq, eqep, ERRORQ_SYNC);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/os/pid.c: In function 'pid_allocate':
    ../../common/os/pid.c:211:26: error: 'pep' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      211 |   pidp->pid_prslot = pep - procdir;
          |                          ^

    ../../common/os/pool.c: In function 'pool_do_bind':
    ../../common/os/pool.c:1716:3: error: 'zone' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1716 |   zone_rele(zone);
          |   ^~~~~~~~~~~~~~~
    ../../common/os/pool.c:1706:3: error: 'kpj' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1706 |   mutex_exit(&kpj->kpj_poolbind);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    In file included from ../../common/sys/atomic.h:41,
                     from ../../common/sys/bitmap.h:140,
                     from ../../common/sys/cpuvar.h:47,
                     from ../../common/sys/cyclic.h:37,
                     from ../../common/sys/dtrace.h:57,
                     from ../../common/os/dtrace_subr.c:28:
    ../../common/os/dtrace_subr.c: In function 'dtrace_vtime_enable':
    ../../intel/asm/atomic.h:173:2: error: 'nstate' may be used uninitialized in thi
    s function [-Werror=maybe-uninitialized]
      173 |  __asm__ __volatile__(      \
          |  ^~~~~~~
    ../../common/os/dtrace_subr.c:187:30: note: 'nstate' was declared here
      187 |  dtrace_vtime_state_t state, nstate;
          |                              ^~~~~~
    In file included from ../../common/sys/atomic.h:41,
                     from ../../common/sys/bitmap.h:140,
                     from ../../common/sys/cpuvar.h:47,
                     from ../../common/sys/cyclic.h:37,
                     from ../../common/sys/dtrace.h:57,
                     from ../../common/os/dtrace_subr.c:28:
    ../../common/os/dtrace_subr.c: In function 'dtrace_vtime_disable':
    ../../intel/asm/atomic.h:173:2: error: 'nstate' may be used uninitialized in thi
    s function [-Werror=maybe-uninitialized]
      173 |  __asm__ __volatile__(      \
          |  ^~~~~~~
    ../../common/os/dtrace_subr.c:214:30: note: 'nstate' was declared here
      214 |  dtrace_vtime_state_t state, nstate;
          |                              ^~~~~~
    In file included from ../../common/sys/atomic.h:41,
                     from ../../common/sys/bitmap.h:140,
                     from ../../common/sys/cpuvar.h:47,
                     from ../../common/sys/cyclic.h:37,
                     from ../../common/sys/dtrace.h:57,
                     from ../../common/os/dtrace_subr.c:28:
    ../../common/os/dtrace_subr.c: In function 'dtrace_vtime_enable_tnf':
    ../../intel/asm/atomic.h:173:2: error: 'nstate' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      173 |  __asm__ __volatile__(      \
          |  ^~~~~~~
    ../../common/os/dtrace_subr.c:241:30: note: 'nstate' was declared here
      241 |  dtrace_vtime_state_t state, nstate;
          |                              ^~~~~~
    In file included from ../../common/sys/atomic.h:41,
                     from ../../common/sys/bitmap.h:140,
                     from ../../common/sys/cpuvar.h:47,
                     from ../../common/sys/cyclic.h:37,
                     from ../../common/sys/dtrace.h:57,
                     from ../../common/os/dtrace_subr.c:28:
    ../../common/os/dtrace_subr.c: In function 'dtrace_vtime_disable_tnf':
    ../../intel/asm/atomic.h:173:2: error: 'nstate' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      173 |  __asm__ __volatile__(      \
          |  ^~~~~~~
    ../../common/os/dtrace_subr.c:268:30: note: 'nstate' was declared here
      268 |  dtrace_vtime_state_t state, nstate;
          |                              ^~~~~~

    ../../common/os/errorq.c: In function 'errorq_drain':
    ../../common/os/errorq.c:684:25: error: 'dep' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      684 |     dep = dep->eqe_dump = eep;
          |           ~~~~~~~~~~~~~~^~~~~
    ../../common/os/errorq.c: In function 'errorq_panic_drain':
    ../../common/os/errorq.c:816:26: error: 'dep' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      816 |      dep = dep->eqe_dump = eep;
          |            ~~~~~~~~~~~~~~^~~~~

    ../../common/os/evchannels.c: In function 'evch_chrdevent_init':
    ../../common/os/evchannels.c:1687:29: error: 'psqstat' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1687 |  if (sdp != NULL && psqstat == 0)
          |                     ~~~~~~~~^~~~

    ../../common/os/exacct.c: In function 'exacct_assemble_task_usage':
    ../../common/os/exacct.c:666:16: error: 'record_type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      666 |  task_record = exacct_assemble_task_record(tk, tu, mask, record_type);
          |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/os/exacct.c: In function 'exacct_assemble_proc_usage':
    ../../common/os/exacct.c:1050:16: error: 'record_type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1050 |  proc_record = exacct_assemble_proc_record(pu, mask, record_type);
          |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/os/exacct.c: In function 'exacct_assemble_net_usage':
    ../../common/os/exacct.c:1377:13: error: 'record_type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1377 |  net_desc = exacct_assemble_net_record(ninfo, mask, record_type, what);
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    cc1: all warnings being treated as errors

Testing done: build/install/boot. have used this kernel since patch was created (20 days now).

History

#1

Updated by Toomas Soome 2 months ago

  • Description updated (diff)
#2

Updated by Electric Monk 2 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit c6f039c73ee9eb7e4acb232afaca51cdf9d30ff3

commit  c6f039c73ee9eb7e4acb232afaca51cdf9d30ff3
Author: Toomas Soome <tsoome@me.com>
Date:   2020-01-29T21:48:15.000Z

    12172 genunix: variable may be used uninitialized
    Reviewed by: John Levon <john.levon@joyent.com>
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF