GNU bug report logs - #44506
28.0.50; Segfault on opening a particular message in Gnus in terminal/tty

Previous Next

Packages: emacs, gnus;

Reported by: Amin Bandali <bandali <at> gnu.org>

Date: Sat, 7 Nov 2020 18:40:02 UTC

Severity: normal

Found in version 28.0.50

Fixed in version 27.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 44506 <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 44506 <at> debbugs.gnu.org, Amin Bandali <bandali <at> gnu.org>
Subject: Re: bug#44506: 28.0.50; Segfault on opening a particular message in
 Gnus in terminal/tty
Date: Sat, 07 Nov 2020 20:05:13 -0800
On 11/07/20 22:29 PM, Eli Zaretskii wrote:
>> From: Amin Bandali <bandali <at> gnu.org>
>> Cc: 44506 <at> debbugs.gnu.org, Eric Abrahamsen <eric <at> ericabrahamsen.net>
>> Date: Sat, 07 Nov 2020 15:03:53 -0500
>> 
>> After some bisecting of my config files, I narrowed the segaulting of
>> Gnus when opening that message down to inclusion of (require 'ebdb-gnus)
>> in my configs.  ebdb-gnus is part of EBDB, available on GNU ELPA.  I'm
>> Cc'ing Eric, EBDB's creator and maintainer, in case he might have any
>> ideas.
>
> I don't see anything in EBDB that could cause Emacs to use static
> compositions, but maybe I'm missing something.

FWIW I was able to reproduce the segfault in terminal (not in GUI). I
don't know what static compositions are, but the places where EBDB
messes with lower-level character stuff are pasted below. As you can see
it's pretty ad-hoc stuff.

There's also ebdb-i18n.el, but that mostly just involves looking up the
scripts of characters in `char-script-table'.

(defconst ebdb-char-fold-table
  (eval-when-compile
    (let ((tbl (make-char-table 'char-fold-table))
	  (uni (unicode-property-table-internal 'decomposition))
	  ;; Lowercase and uppercase alphabet.
	  (target-seq (append (number-sequence 65 90)
			      (number-sequence 97 122))))

      ;; I don't understand what's happening here, but it's necessary.
      (let ((func (char-table-extra-slot uni 1)))
	(map-char-table (lambda (char v)
                          (when (consp char)
                            (funcall func (car char) v uni)))
			uni))
      ;; Create lists of equivalent chars, keyed to the most basic
      ;; ascii letter.
      (map-char-table
       (lambda (char decomp)
	 (when (consp decomp)
	   (when (symbolp (car decomp))
	     (setq decomp (cdr decomp)))
	   (when (memq (car decomp) target-seq)
	     (aset tbl (car decomp)
		   (cons char
			 (aref tbl (car decomp)))))))
       uni)
      ;; Then turn the lists into regexps.
      (map-char-table
       (lambda (char dec-list)
	 (let ((re (regexp-opt (cons (char-to-string char)
				     (mapcar #'string dec-list)))))
           (aset tbl char re)))
       tbl)
      tbl))
  "Char-table holding regexps used in char fold searches.
Keys are characters in the upper- and lower-case ascii ranges.
Values are a regexp matching all characters that decompose to the
key character.")

(defun ebdb-char-fold-to-regexp (string)
  "A highly simplified version of `char-fold-to-regexp'.
Only converts characters in STRING that decompose to the range
[a-zA-Z]."
  (let ((out nil)
	(end (length string))
	char
	(i 0))
    (while (< i end)
      (setq char (aref string i))
      (push
       (or (aref ebdb-char-fold-table char)
	   (string char))
       out)
      (cl-incf i))
    (setq out (apply #'concat (nreverse out)))
    (if (> (length out) 5000)
        (regexp-quote string)
      out)))




This bug report was last modified 3 years and 33 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.