Subject: bug#29223: 26.0.90; [Regression][Emacs26] Problem in network stack

From: Damien Cassou <[email-masked]>
Date: Thu, 09 Nov 2017 06:16:58 +0100

The commit "Avoid unnecessary rounding errors in timestamps" (3aee7b)
introduces a regression in the network stack. This can be seen while
using org-caldav and I managed to reproduce with emacs -Q (see attached
files).

Among the attached files, script.el is of the most importance. The first
call to `contact-server' works fine whereas the second triggers a
server-side error: 503 Service Unavailable. Unfortunately, you can't
directly reuse this script as it depends on a personal nextcloud
instance.

Reverting the commit fixes the bug. I added its author on CC.

commit 3aee7be62eaf8caef6f2fab31bee79674b3abbb7
Author: Paul Eggert <[email-masked]>
Date:   Sun Oct 22 01:04:36 2017 -0700

    Avoid unnecessary rounding errors in timestamps
    
    Avoid the rounding errors of float-time when it’s easy.  E.g.,
    replace (< (float-time a) (float-time b)) with (time-less-p a b).
    * lisp/desktop.el (desktop-save):
    * lisp/ecomplete.el (ecomplete-add-item):
    * lisp/epg.el (epg-wait-for-completion):
    * lisp/files.el (dir-locals-find-file, dir-locals-read-from-dir):
    * lisp/image-dired.el (image-dired-get-thumbnail-image)
    (image-dired-create-thumb-1):
    * lisp/info.el (info-insert-file-contents):
    * lisp/ls-lisp.el (ls-lisp-format-time):
    * lisp/net/ange-ftp.el (ange-ftp-file-newer-than-file-p)
    (ange-ftp-verify-visited-file-modtime):
    * lisp/net/rcirc.el (rcirc-ctcp-sender-PING):
    * lisp/textmodes/remember.el (remember-store-in-mailbox):
    * lisp/url/url-cookie.el (url-cookie-expired-p):
    Bypass float-time to avoid rounding errors.
    
    * lisp/files.el (dir-locals-find-file):

In GNU Emacs 26.0.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.21)
 of 2017-11-09 built on luz4
Repository revision: b23adf48bfe03332f508f088265a0c8162747cae
Windowing system distributor 'Fedora Project', version 11.0.11903000
System Description:	Fedora release 26 (Twenty Six)

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure --cache-file=/tmp/emacs.config.cache'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 LIBSYSTEMD LCMS2

Important settings:
  value of $LC_MONETARY: fr_FR.UTF-8
  value of $LC_NUMERIC: fr_FR.UTF-8
  value of $LC_TIME: fr_FR.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair time-date
mule-util 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 menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame 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 minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 94504 6564)
 (symbols 48 20339 1)
 (miscs 40 45 119)
 (strings 32 28291 1407)
 (string-bytes 1 748828)
 (vectors 16 13964)
 (vector-slots 8 492182 6318)
 (floats 8 49 68)
 (intervals 56 224 0)
 (buffers 992 12))

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill