Subject: bug#45798: 28.0.50; nsm-check-local-subnet-ipv4 fails with nsm-trust-local-network

From: "Basil L. Contovounesios" <[email-masked]>
Date: Mon, 11 Jan 2021 19:24:47 +0000

I've been consistently seeing the following error when running 'make
check' for a while.  It corresponds to the line in nsm-tests.el where
nsm-trust-local-network is bound to t.

--8<---------------cut here---------------start------------->8---
Running 2 tests (2021-01-11 18:36:03+0000, selector ‘(not (or (tag :expensive-test) (tag :unstable)))’)
Test nsm-check-local-subnet-ipv4 backtrace:
  signal(ert-test-failed (((should (eq t (nsm-should-check "google.com
  ert-fail(((should (eq t (nsm-should-check "google.com"))) :form (eq 
  #f(compiled-function () #<bytecode -0x1350ea665394e069>)()
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name nsm-check-local-subnet-ipv4 :document
  ert-run-or-rerun-test(#s(ert--stats :selector (not (or (tag :expensi
  ert-run-tests((not (or (tag :expensive-test) (tag :unstable))) #f(co
  ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable)))
  ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :un
  eval((ert-run-tests-batch-and-exit '(not (or (tag :expensive-test) (
  command-line-1(("-L" ":." "-l" "ert" "-l" "lisp/net/nsm-tests" "--ev
  command-line()
  normal-top-level()
Test nsm-check-local-subnet-ipv4 condition:
    (ert-test-failed
     ((should
       (eq t
	   (nsm-should-check "google.com")))
      :form
      (eq t nil)
      :value nil))
   FAILED  1/2  nsm-check-local-subnet-ipv4 (0.056046 sec)
   passed  2/2  nsm-check-local-subnet-ipv6 (0.000694 sec)

Ran 2 tests, 1 results as expected, 1 unexpected (2021-01-11 18:36:03+0000, 0.196751 sec)

1 unexpected results:
   FAILED  nsm-check-local-subnet-ipv4
--8<---------------cut here---------------end--------------->8---

I stepped through nsm-should-check a bit, but I don't understand what is
or should be happening.  The test fails when local var off-net is set to
nil, which happens when nsm-network-same-subnet returns non-nil.  This
happens with the following local var values:

  ip: [0 0 0 0 0 0 0 1 0]

  info: (lo [0 0 0 0 0 0 0 1 0]
            [0 0 0 0 0 0 0 1 0]
            [65535 65535 65535 65535 65535 65535 65535 65535 0])

  addresses: ([0 0 0 0 0 0 0 1 0])

  network-interface-list:
  ((wlp3s0 [65152 0 0 0 38609 2370 19874 38730 0]
           [65152 0 0 0 65535 65535 65535 65535 0]
           [65535 65535 65535 65535 0 0 0 0 0])
   (wlp3s0 [10754 32900 8418 50048 62480 33512 14881 61151 0]
           [10754 32900 8418 50048 65535 65535 65535 65535 0]
           [65535 65535 65535 65535 0 0 0 0 0])
   (lo [0 0 0 0 0 0 0 1 0] [0 0 0 0 0 0 0 1 0]
       [65535 65535 65535 65535 65535 65535 65535 65535 0])
   (wlp3s0 [192 168 0 144 0] [192 168 0 255 0] [255 255 255 0 0])
   (lo [127 0 0 1 0] [127 255 255 255 0] [255 0 0 0 0]))

I've observed that the test fails only on my home network.  I've heard
that my ISP and the modem they provide use a weird dual IPv6 stack that
has caused people problems in the past, but I know next to nothing about
these things and can't say if it's related to the issue at hand.

Another observation is that the test succeeds if I replace "google.com"
with "gnu.org".  Should I just change the test to use "gnu.org", and
forget about this?  Or is there some interesting issue here?  Any
suggestions or guidance are very welcome.

Here's my /etc/resolv.conf, in case it matters:

  # Generated by NetworkManager
  nameserver 8.8.8.8
  nameserver 8.8.4.4
  nameserver 2001:4860:4860::8888
  # NOTE: the libc resolver may not support more than 3 nameservers.
  # The nameservers listed below may not be recognized.
  nameserver 2001:4860:4860::8844

[ I've been pointing my DNS settings to Google ever since I spent some
  months in a country with very poor network services. ]

Thanks,

-- 
Basil

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
 of 2021-01-11 built on tia
Repository revision: fcf8ad610d43ba9b96d9ad1cc67185144c819006
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: Debian GNU/Linux bullseye/sid

Configured using:
 'configure 'CC=ccache gcc' 'CFLAGS=-O2 -march=native' --config-cache
 --prefix=/home/blc/.local --enable-checking=structs
 --with-x-toolkit=lucid --with-file-notification=yes --with-x'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11
XAW3D XDBE XIM XPM LUCID ZLIB

Important settings:
  value of $LANG: en_IE.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml easymenu mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo x-toolkit x multi-tty make-network-process emacs)