Subject: 28.1; GNUS nnimap hangs with high UID

From: [email-masked]
Date: Tue, 14 Jun 2022 17:11:40 +0200

Hi,

when opening IMAP folder with high (very) UID, gnus hangs on
gnu-uncompress-range.

I have an INBOX folder with very high UIDNEXT (2206239514). Even though
the actual number of email in the folder is low (33 EXISTS),
gnus-uncompress-range try to /uncompress/ 2 billions numbers, which make
it hangs forever.

---
Baptiste.

---- Technical details ----

*imap commands*

796 EXAMINE "INBOX"
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk $Filtered LoadRemoteImages $Junk $Classified $Forwarded $NotJunk gnus-expire)
* OK [PERMANENTFLAGS ()] Read-only mailbox.
* 33 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1370959925] UIDs valid
* OK [UIDNEXT 2206239514] Predicted next UID
* OK [HIGHESTMODSEQ 7659] Highest

*Backtrace*

⟶ nnimap-get-response

SELECT
(("OK" ("READ-WRITE") "Select" "completed" ("0.000" "+" "0.000" "secs") ".") ("OK" ("CLOSED") "Previous" "mailbox" "closed.") ("FLAGS" ("\\Answered" "\\Flagged" "\\Deleted" "\\Seen" "\\Draft" "NonJunk" "$Filtered" "LoadRemoteImages" "$Junk" "$Classified" "$Forwarded" "$NotJunk" "gnus-expire")) ("OK" ("PERMANENTFLAGS" "(\\Answered" "\\Flagged" "\\Deleted" "\\Seen" "\\Draft" "NonJunk" "$Filtered" "LoadRemoteImages" "$Junk" "$Classified" "$Forwarded" "$NotJunk" "gnus-expire" "\\*)") "Flags" "permitted.") ("33" "EXISTS") ("0" "RECENT") ("OK" ("UIDVALIDITY" "1370959925") "UIDs" "valid") ("OK" ("UIDNEXT" "2206239514") "Predicted" "next" "UID") ("OK" ("HIGHESTMODSEQ" "7659") "Highest"))

⟶ gnus-uncompress-range

gnus-uncompress-range((1 . 2206239513))

---- Versions ----

In GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6)
 of 2022-04-28 built on frederik
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Arch Linux

Configured using:
 'configure --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib
 --localstatedir=/var --with-cairo --with-harfbuzz --with-libsystemd
 --with-modules --with-x-toolkit=gtk3 'CFLAGS=-march=x86-64
 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2
 -Wformat -Werror=format-security -fstack-clash-protection
 -fcf-protection -g -ffile-prefix-map=/build/emacs/src=/usr/src/debug
 -flto=auto' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
 -flto=auto''

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

Important settings:
  value of $LANG: fr_FR.UTF-8
  locale-coding-system: utf-8-unix