Project

General

Profile

Bug #11102

rtld: NULL pointer errors

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

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

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

NULL pointer errors:

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                     from ../../common/_rtld.h:37,
                     from ../common/rtld.c:27:
    ../common/rtld.c: In function 'rtmap_format':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 4 of 'mdb_call_dcmd' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/rtld.c:505:53: note: in expansion of macro 'NULL'
           MSG_ORIG(MSG_RTMAP_STR), addr, DCMD_ADDRSPEC, NULL, NULL);
                                                         ^~~~
    In file included from ../common/rtld.c:29:0:
    /code/illumos-gate/proto/root_i386/usr/include/sys/mdb_modapi.h:196:12: note: expected 'int' but argument is of type 'void *'
     extern int mdb_call_dcmd(const char *, uintptr_t,
                ^~~~~~~~~~~~~
    ../common/rtld.c: In function 'walk_rtmap_init':
    ../common/rtld.c:682:21: error: comparison between pointer and integer [-Werror]
      if (wsp->walk_addr == NULL) {
                         ^~
    ../common/rtld.c: In function 'walk_rtmap_step':
    ../common/rtld.c:695:21: error: comparison between pointer and integer [-Werror]
      if (wsp->walk_addr == NULL)
                         ^~

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                     from ../common/cap.c:26:
    ../common/cap.c: In function 'cap_check_lmp_init':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 3 of 'pnavl_recorded' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/cap.c:365:54: note: in expansion of macro 'NULL'
     #define HWAVL_RECORDED(n) pnavl_recorded(&capavl, n, NULL, NULL)
                                                          ^~~~
    ../common/cap.c:393:17: note: in expansion of macro 'HWAVL_RECORDED'
       if ((file && (HWAVL_RECORDED(file) != 0)) ||
                     ^~~~~~~~~~~~~~
    In file included from ../common/cap.c:36:0:
    ../common/_rtld.h:751:13: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
     extern int  pnavl_recorded(avl_tree_t **, const char *, uint_t,
                 ^~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                     from ../common/cap.c:26:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 3 of 'pnavl_recorded' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/cap.c:365:54: note: in expansion of macro 'NULL'
     #define HWAVL_RECORDED(n) pnavl_recorded(&capavl, n, NULL, NULL)
                                                          ^~~~
    ../common/cap.c:394:8: note: in expansion of macro 'HWAVL_RECORDED'
           (HWAVL_RECORDED(NAME(lmp)) != 0) ||
            ^~~~~~~~~~~~~~
    In file included from ../common/cap.c:36:0:
    ../common/_rtld.h:751:13: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
     extern int  pnavl_recorded(avl_tree_t **, const char *, uint_t,
                 ^~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                     from ../common/cap.c:26:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 3 of 'pnavl_recorded' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/cap.c:365:54: note: in expansion of macro 'NULL'
     #define HWAVL_RECORDED(n) pnavl_recorded(&capavl, n, NULL, NULL)
                                                          ^~~~
    ../common/cap.c:396:8: note: in expansion of macro 'HWAVL_RECORDED'
           (HWAVL_RECORDED(PATHNAME(lmp)) != 0)))
            ^~~~~~~~~~~~~~
    In file included from ../common/cap.c:36:0:
    ../common/_rtld.h:751:13: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
     extern int  pnavl_recorded(avl_tree_t **, const char *, uint_t,
                 ^~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                     from ../common/cap.c:26:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 3 of 'pnavl_recorded' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/cap.c:365:54: note: in expansion of macro 'NULL'
     #define HWAVL_RECORDED(n) pnavl_recorded(&capavl, n, NULL, NULL)
                                                          ^~~~
    ../common/cap.c:404:16: note: in expansion of macro 'HWAVL_RECORDED'
         if ((alt = HWAVL_RECORDED(cp)) != 0)
                    ^~~~~~~~~~~~~~
    In file included from ../common/cap.c:36:0:
    ../common/_rtld.h:751:13: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
     extern int  pnavl_recorded(avl_tree_t **, const char *, uint_t,
                 ^~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                     from ../common/cap.c:26:
    ../common/cap.c: In function 'cap_check_fdesc':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 3 of 'pnavl_recorded' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/cap.c:365:54: note: in expansion of macro 'NULL'
     #define HWAVL_RECORDED(n) pnavl_recorded(&capavl, n, NULL, NULL)
                                                          ^~~~
    ../common/cap.c:466:17: note: in expansion of macro 'HWAVL_RECORDED'
       if ((file && (HWAVL_RECORDED(file) != 0)) ||
                     ^~~~~~~~~~~~~~
    In file included from ../common/cap.c:36:0:
    ../common/_rtld.h:751:13: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
     extern int  pnavl_recorded(avl_tree_t **, const char *, uint_t,
                 ^~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                     from ../common/cap.c:26:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 3 of 'pnavl_recorded' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/cap.c:365:54: note: in expansion of macro 'NULL'
     #define HWAVL_RECORDED(n) pnavl_recorded(&capavl, n, NULL, NULL)
                                                          ^~~~
    ../common/cap.c:467:26: note: in expansion of macro 'HWAVL_RECORDED'
           (fdp->fd_oname && (HWAVL_RECORDED(fdp->fd_oname) != 0)) ||
                              ^~~~~~~~~~~~~~
    In file included from ../common/cap.c:36:0:
    ../common/_rtld.h:751:13: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
     extern int  pnavl_recorded(avl_tree_t **, const char *, uint_t,
                 ^~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                     from ../common/cap.c:26:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 3 of 'pnavl_recorded' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/cap.c:365:54: note: in expansion of macro 'NULL'
     #define HWAVL_RECORDED(n) pnavl_recorded(&capavl, n, NULL, NULL)
                                                          ^~~~
    ../common/cap.c:468:26: note: in expansion of macro 'HWAVL_RECORDED'
           (fdp->fd_nname && (HWAVL_RECORDED(fdp->fd_nname) != 0)) ||
                              ^~~~~~~~~~~~~~
    In file included from ../common/cap.c:36:0:
    ../common/_rtld.h:751:13: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
     extern int  pnavl_recorded(avl_tree_t **, const char *, uint_t,
                 ^~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                     from ../common/cap.c:26:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 3 of 'pnavl_recorded' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/cap.c:365:54: note: in expansion of macro 'NULL'
     #define HWAVL_RECORDED(n) pnavl_recorded(&capavl, n, NULL, NULL)
                                                          ^~~~
    ../common/cap.c:470:8: note: in expansion of macro 'HWAVL_RECORDED'
           (HWAVL_RECORDED(fdp->fd_pname) != 0)))
            ^~~~~~~~~~~~~~
    In file included from ../common/cap.c:36:0:
    ../common/_rtld.h:751:13: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
     extern int  pnavl_recorded(avl_tree_t **, const char *, uint_t,
                 ^~~~~~~~~~~~~~

    ../common/external.c: In function 'get_lcinterface':
    ../common/external.c:373:42: error: comparison between pointer and integer [-Werror]
           lcp[CI_TLS_STATMOD].lc_un.lc_func) == NULL) {
                                              ^~

    ../common/config_elf.c: In function 'elf_config_validate':
    ../common/config_elf.c:119:23: error: comparison between pointer and integer [-Werror]
       if (filetbl->cf_obj == NULL)
                           ^~
    ../common/config_elf.c: In function 'elf_config':
    ../common/config_elf.c:335:53: error: comparison between pointer and integer [-Werror]
           (LA_SER_DEFAULT | LA_SER_CONFIG), PD_TKN_CAP) != NULL)
                                                         ^~
    ../common/config_elf.c:353:52: error: comparison between pointer and integer [-Werror]
           (LA_SER_SECURE | LA_SER_CONFIG), PD_TKN_CAP) != NULL)
                                                        ^~

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/time_iso.h:49:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/time.h:40,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/time.h:462,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/select.h:53,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/types.h:640,
                     from /code/illumos-gate/proto/root_i386/usr/include/sys/mman.h:54,
                     from ../common/object.c:30:
    ../common/object.c: In function 'elf_obj_fini':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:32:14: error: passing argument 3 of 'pnavl_recorded' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/object.c:264:45: note: in expansion of macro 'NULL'
      if (pnavl_recorded(&capavl, ofl->ofl_name, NULL, NULL))
                                                 ^~~~
    In file included from ../common/object.c:38:0:
    ../common/_rtld.h:751:13: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
     extern int  pnavl_recorded(avl_tree_t **, const char *, uint_t,
                 ^~~~~~~~~~~~~~

    ../common/dlfcns.c: In function 'dlmopen_core':
    ../common/dlfcns.c:748:64: error: comparison between pointer and integer [-Werror]
      if (LM_FIX_NAME(clmp)(path, clmp, &palp, AL_CNT_NEEDED, orig) == NULL)
                                                                    ^~
    ../common/dlfcns.c:761:36: error: comparison between pointer and integer [-Werror]
      if ((nlmco = create_cntl(lml, 1)) == NULL) {
                                        ^~

    ../common/elf.c: In function 'elf_lazy_load':
    ../common/elf.c:425:35: error: comparison between pointer and integer [-Werror]
      if ((lmco = create_cntl(lml, 0)) == NULL) {
                                       ^~
    ../common/elf.c: In function '_elf_lookup_filtee':
    ../common/elf.c:927:37: error: comparison between pointer and integer [-Werror]
        if ((lmco = create_cntl(lml, 0)) == NULL)
                                         ^~
    ../common/elf.c:928:12: error: return makes integer from pointer without a cast [-Werror=int-conversion]
         return (NULL);
                ^
    ../common/elf.c:1073:38: error: comparison between pointer and integer [-Werror]
         if ((lmco = create_cntl(lml, 0)) == NULL)
                                          ^~
    ../common/elf.c:1074:13: error: return makes integer from pointer without a cast [-Werror=int-conversion]
          return (NULL);
                 ^
    ../common/elf.c: In function 'elf_new_lmp':
    ../common/elf.c:1877:25: error: comparison between pointer and integer [-Werror]
         if (dyn->d_un.d_ptr != NULL)
                             ^~
    ../common/elf.c:1883:25: error: comparison between pointer and integer [-Werror]
         if (dyn->d_un.d_ptr != NULL)
                             ^~
    ../common/elf.c: In function 'elf_dladdr':
    ../common/elf.c:2513:21: error: comparison between pointer and integer [-Werror]
      if (SUNWSYMSZ(lmp) == NULL) {
                         ^~
    ../common/elf.c: In function 'elf_lazy_find_sym':
    ../common/elf.c:2723:10: error: return makes integer from pointer without a cast [-Werror=int-conversion]
       return (NULL);
              ^
    ../common/elf.c:2863:51: error: comparison between pointer and integer [-Werror]
        if (aplist_test(&alist, nlmp, AL_CNT_LAZYFIND) == NULL)
                                                       ^~
    ../common/analyze.c: In function 'find_file':
    ../common/analyze.c:1495:17: error: comparison between pointer and integer [-Werror]
        if (*strhash == NULL)
                     ^~
    ../common/analyze.c: In function 'lookup_sym_interpose':
    ../common/analyze.c:2719:10: error: return makes integer from pointer without a cast [-Werror=int-conversion]
       return (NULL);
              ^
    ../common/analyze.c: In function '_lookup_sym':
    ../common/analyze.c:3131:11: error: return makes integer from pointer without a cast [-Werror=int-conversion]
        return (NULL);
               ^

    ../common/util.c: In function 'create_cntl':
    ../common/util.c:1326:11: error: return makes integer from pointer without a cast [-Werror=int-conversion]
        return (NULL);
               ^
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 3 months ago

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

git commit 67d74cc3e7c9d9461311136a0b2069813a3fd927

commit  67d74cc3e7c9d9461311136a0b2069813a3fd927
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-03T20:45:44.000Z

    11102 rtld: NULL pointer errors
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Reviewed by: C Fraire <cfraire@me.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Also available in: Atom PDF