Project

General

Profile

Bug #11122

libc_db: NULL pointer errors

Added by Toomas Soome about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

NULL pointer errors:

    ../common/thread_db.c: In function 'td_read_uberdata':
    ../common/thread_db.c:221:26: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       ta_p->single_ulwp_addr = NULL;
                              ^
    ../common/thread_db.c:235:35: error: comparison between pointer and integer [-Werror]
        if ((psaddr_t)head.hash_bucket == NULL)
                                       ^~
    ../common/thread_db.c: In function 'td_read_bootstrap_data':
    ../common/thread_db.c:322:39: error: comparison between pointer and integer [-Werror]
       if ((ta_p->bootstrap_addr = psaddr) == NULL)
                                           ^~
    ../common/thread_db.c:327:14: error: comparison between pointer and integer [-Werror]
       if (psaddr == NULL) {
                  ^~
    ../common/thread_db.c:329:25: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        ta_p->bootstrap_addr = NULL;
                             ^
    ../common/thread_db.c:357:27: error: comparison between pointer and integer [-Werror]
      if (ta_p->bootstrap_addr == NULL)
                               ^~
    ../common/thread_db.c: In function 'ph_lock_th':
    ../common/thread_db.c:486:38: error: comparison between pointer and integer [-Werror]
      if (th_p == NULL || th_p->th_unique == NULL) {
                                          ^~
    ../common/thread_db.c: In function 'ph_lock_sh':
    ../common/thread_db.c:501:38: error: comparison between pointer and integer [-Werror]
      if (sh_p == NULL || sh_p->sh_unique == NULL) {
                                          ^~
    ../common/thread_db.c: In function '__td_ta_map_addr2sync':
    ../common/thread_db.c:736:11: error: comparison between pointer and integer [-Werror]
      if (addr == NULL)
               ^~
    ../common/thread_db.c: In function '__td_ta_thr_iter':
    ../common/thread_db.c:985:21: error: comparison between pointer and integer [-Werror]
          first_lwp_addr == NULL && first_zombie_addr == NULL) {
                         ^~
    ../common/thread_db.c:985:50: error: comparison between pointer and integer [-Werror]
          first_lwp_addr == NULL && first_zombie_addr == NULL) {
                                                      ^~
    ../common/thread_db.c:999:21: error: comparison between pointer and integer [-Werror]
      if (first_lwp_addr == NULL)
                         ^~
    ../common/thread_db.c:1099:26: error: comparison between pointer and integer [-Werror]
        if (first_zombie_addr == NULL ||
                              ^~
    ../common/thread_db.c: In function '__td_ta_sync_iter':
    ../common/thread_db.c:1223:13: error: comparison between pointer and integer [-Werror]
      if (psaddr == NULL)
                 ^~
    ../common/thread_db.c:1236:17: error: comparison between pointer and integer [-Werror]
           next_desc != NULL;
                     ^~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from ../common/thread_db.c:31:
    ../common/thread_db.c: In function '__td_thr_get_info':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 2 of 'memset' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/thread_db.c:1402:22: note: in expansion of macro 'NULL'
      (void) memset(ti_p, NULL, sizeof (*ti_p));
                          ^~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/string.h:33:0,
                     from ../../libc/inc/thr_uberdata.h:38,
                     from ../common/thread_db.c:35:
    /code/illumos-gate/proto/root_i386/usr/include/iso/string_iso.h:72:14: note: expected 'int' but argument is of type 'void *'
     extern void *memset(void *, int, size_t);
                  ^~~~~~
    ../common/thread_db.c: In function '__td_thr_validate':
    ../common/thread_db.c:2113:22: error: comparison between pointer and integer [-Werror]
      if (th_p->th_unique == NULL || th_p->th_ta_p == NULL)
                          ^~
    ../common/thread_db.c: In function '__td_thr_tsd':
    ../common/thread_db.c:2174:22: error: comparison between pointer and integer [-Werror]
       else if (tsd_paddr != NULL &&
                          ^~
    ../common/thread_db.c:2179:21: error: comparison between pointer and integer [-Werror]
        nkey = tsd_paddr == NULL ? TSD_NFAST : stsd.tsd_nalloc;
                         ^~
    ../common/thread_db.c: In function '__td_thr_tlsbase':
    ../common/thread_db.c:2267:8: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      *base = NULL;
            ^
    ../common/thread_db.c: In function '__td_thr_sleepinfo':
    ../common/thread_db.c:2471:35: error: comparison between pointer and integer [-Werror]
      if (return_val != TD_OK || wchan == NULL) {
                                       ^~
    ../common/thread_db.c:2473:19: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       sh_p->sh_unique = NULL;
                       ^
    ../common/thread_db.c: In function 'read_sync_stats':
    ../common/thread_db.c:2678:46: error: comparison between pointer and integer [-Werror]
      for (next_desc = (psaddr_t)first; next_desc != NULL;
                                                  ^~
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk about 1 year ago

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

git commit c3e74f84d7edf7b5144c2401d7fefd666a92e6c0

commit  c3e74f84d7edf7b5144c2401d7fefd666a92e6c0
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-03T19:44:47.000Z

    11122 libc_db: NULL pointer errors
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Also available in: Atom PDF