1. 25 Mar, 2020 2 commits
    • Ondřej Surý's avatar
      Fix 'Dereference of null pointer' from scan-build-10 · ddd0d356
      Ondřej Surý authored
      These are mostly false positives, the clang-analyzer FAQ[1] specifies
      why and how to fix it:
      
      > The reason the analyzer often thinks that a pointer can be null is
      > because the preceding code checked compared it against null. So if you
      > are absolutely sure that it cannot be null, remove the preceding check
      > and, preferably, add an assertion as well.
      
      The 4 warnings reported are:
      
      dnssec-cds.c:781:4: warning: Access to field 'base' results in a dereference of a null pointer (loaded from variable 'buf')
                              isc_buffer_availableregion(buf, &r);
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:996:36: note: expanded from macro 'isc_buffer_availableregion'
                                         ^
      /builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:821:16: note: expanded from macro 'ISC__BUFFER_AVAILABLEREGION'
                      (_r)->base = isc_buffer_used(_b);              \
                                   ^~~~~~~~~~~~~~~~~~~
      /builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:152:29: note: expanded from macro 'isc_buffer_used'
              ((void *)((unsigned char *)(b)->base + (b)->used)) /*d*/
                                         ^~~~~~~~~
      1 warning generated.
      
      --
      
      byname_test.c:308:34: warning: Access to field 'fwdtable' results in a dereference of a null pointer (loaded from variable 'view')
                      RUNTIME_CHECK(dns_fwdtable_add(view->fwdtable, dns_rootname,
                                                     ^~~~~~~~~~~~~~
      /builds/isc-projects/bind9/lib/isc/include/isc/util.h:318:52: note: expanded from macro 'RUNTIME_CHECK'
                                                         ^~~~
      /builds/isc-projects/bind9/lib/isc/include/isc/error.h:50:21: note: expanded from macro 'ISC_ERROR_RUNTIMECHECK'
              ((void)(ISC_LIKELY(cond) ||  \
                                 ^~~~
      /builds/isc-projects/bind9/lib/isc/include/isc/likely.h:23:43: note: expanded from macro 'ISC_LIKELY'
                                                  ^
      1 warning generated.
      
      --
      
      ./rndc.c:255:6: warning: Dereference of null pointer (loaded from variable 'host')
              if (*host == '/') {
                  ^~~~~
      1 warning generated.
      
      --
      
      ./main.c:1254:9: warning: Access to field 'sctx' results in a dereference of a null pointer (loaded from variable 'named_g_server')
              sctx = named_g_server->sctx;
                     ^~~~~~~~~~~~~~~~~~~~
      1 warning generated.
      
      References:
      1. https://clang-analyzer.llvm.org/faq.html#null_pointer
      ddd0d356
    • Ondřej Surý's avatar
      Fix 'Dead nested assignment's from scan-build-10 · 262f087b
      Ondřej Surý authored
      The 3 warnings reported are:
      
      os.c:872:7: warning: Although the value stored to 'ptr' is used in the enclosing expression, the value is never actually read from 'ptr'
              if ((ptr = strtok_r(command, " \t", &last)) == NULL) {
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 warning generated.
      
      --
      
      rpz.c:1117:10: warning: Although the value stored to 'zbits' is used in the enclosing expression, the value is never actually read from 'zbits'
              return (zbits &= x);
                      ^        ~
      1 warning generated.
      
      --
      
      openssleddsa_link.c:532:10: warning: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err'
              while ((err = ERR_get_error()) != 0) {
                      ^     ~~~~~~~~~~~~~~~
      1 warning generated.
      262f087b
  2. 24 Mar, 2020 8 commits
  3. 20 Mar, 2020 10 commits
  4. 19 Mar, 2020 5 commits
  5. 18 Mar, 2020 9 commits
    • Ondřej Surý's avatar
      Use clock_gettime() instead of gettimeofday() for isc_stdtime function · e691b89a
      Ondřej Surý authored
      This also removes Solaris 2.8 broken gettimeofday() workaround
      e691b89a
    • Ondřej Surý's avatar
      Merge branch '4-gitlab-ci.yml-improvement' into 'master' · af26de63
      Ondřej Surý authored
      Improve GitLab CI configuration
      
      See merge request !3254
      af26de63
    • Ondřej Surý's avatar
      Rename MAKE environment variable to MAKE_COMMAND · de1a637a
      Ondřej Surý authored
      The environment variable MAKE has been replaced with MAKE_COMMAND,
      because overriding MAKE variable also changed the definition of the MAKE
      inside the Makefiles, and we want only a single wrapper around the whole
      build process.
      
      Previously, setting `MAKE` to `bear make` meant that `bear make` would
      be run at every nested make invocation, which messed up the upcoming
      automake transition as compile_commands.json would be generated in every
      subdirectory instead of just having one central file at the top of the
      build tree.
      de1a637a
    • Ondřej Surý's avatar
      Remove cppcheck arm64 job · 99f9e2c5
      Ondřej Surý authored
      All *:sid:amd64 jobs were errorneously copied to *:sid:arm64 including
      the extra cppcheck run.  Remove the extra definitions from arm64 jobs.
      99f9e2c5
    • Ondřej Surý's avatar
      Replace dependencies+needs with needs+artifacts in GitLabCI config · 66ba808c
      Ondřej Surý authored
      All jobs now use solely the newer needs configuration to declare
      dependencies between jobs:
      
          needs:
            - job: <foo>
              artifacts: true
      
      instead of combination of dependencies and needs which is deprecated.
      This change completely unbundles the stages (alas the stages still needs
      to stay because the job graph has to stay acyclic between the stages).
      66ba808c
    • Ondřej Surý's avatar
      Merge branch '1675-logfileconfig-system-test-crashes-occasionally-rwlock' into 'master' · d7348a2b
      Ondřej Surý authored
      Use isc_rwlock to lock .logconfig member of isc_log_t
      
      Closes #1675
      
      See merge request !3229
      d7348a2b
    • Ondřej Surý's avatar
      Use isc_rwlock to lock .logconfig member of isc_log_t · 4d58856f
      Ondřej Surý authored
      In isc_log_woudlog() the .logconfig member of isc_log_t structure was
      accessed unlocked on the merit that there could be just a race when
      .logconfig would be NULL, so the message would not be logged.  This
      turned not to be true, as there's also data race deeper.  The accessed
      isc_logconfig_t object could be in the middle of destruction, so the
      pointer would be still non-NULL, but the structure members could point
      to a chunk of memory no longer belonging to the object.  Since we are
      only accessing integer types (the log level), this would never lead to
      a crash, it leads to memory access to memory area no longer belonging to
      the object and this a) wrong, b) raises a red flag in thread-safety tools.
      4d58856f
    • Ondřej Surý's avatar
      Merge branch 'marka-memget-cannot-fail-logging' into 'master' · ed2ee2df
      Ondřej Surý authored
      Cleanup logging API now that isc_mem_get cannot fail.
      
      See merge request !3252
      ed2ee2df
    • Mark Andrews's avatar
      Refactor the isc_log API so it cannot fail on memory failures · 0b793166
      Mark Andrews authored
      The isc_mem API now crashes on memory allocation failure, and this is
      the next commit in series to cleanup the code that could fail before,
      but cannot fail now, e.g. isc_result_t return type has been changed to
      void for the isc_log API functions that could only return ISC_R_SUCCESS.
      0b793166
  6. 17 Mar, 2020 6 commits