From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: <87eel4biiu.fsf@ericabrahamsen.net> References: <87sg9l57vx.fsf@gnu.org> <83zh3t56zd.fsf@gnu.org> <874km1djdi.fsf@gnu.org> <83y2jc6hc9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23013"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Amin Bandali , 44506@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 08 05:06:09 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kbbxw-0005tX-NR for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Nov 2020 05:06:08 +0100 Original-Received: from localhost ([::1]:37140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kbbxv-0005QC-PL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Nov 2020 23:06:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbbxq-0005Pu-2C for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 23:06:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48024) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbbxp-000266-PD for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 23:06:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kbbxp-00021F-Kj; Sat, 07 Nov 2020 23:06:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Sun, 08 Nov 2020 04:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44506 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 44506-submit@debbugs.gnu.org id=B44506.16048083237717 (code B ref 44506); Sun, 08 Nov 2020 04:06:01 +0000 Original-Received: (at 44506) by debbugs.gnu.org; 8 Nov 2020 04:05:23 +0000 Original-Received: from localhost ([127.0.0.1]:59570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbbxC-00020O-TS for submit@debbugs.gnu.org; Sat, 07 Nov 2020 23:05:23 -0500 Original-Received: from ericabrahamsen.net ([52.70.2.18]:58072 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbbxB-000208-6g for 44506@debbugs.gnu.org; Sat, 07 Nov 2020 23:05:21 -0500 Original-Received: from localhost (24-113-150-48.wavecable.com [24.113.150.48]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 61F9CFA086; Sun, 8 Nov 2020 04:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1604808315; bh=+ebaxaBHkM+CWUWUUbPQ5ClsdJB9Svr2JliqIbYkoUo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=w+W3EXSd0lTW6jy0TPsK/bGyE4UfZI6iGbr7SOWEh3D/3zSSgbYKL3j+U6emXhyy+ HzFGu1TMdwiy8Mo5iZiVm9OnCLJfRTpEipA99fP4Brt3mMZeVcT6j2X4gERBDoAq1R 5F7ibl+nOTQDYln/wxIGzVScxs2V+j6SoQ2/EHz4= In-Reply-To: <83y2jc6hc9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Nov 2020 22:29:42 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:192863 Archived-At: On 11/07/20 22:29 PM, Eli Zaretskii wrote: >> From: Amin Bandali >> Cc: 44506@debbugs.gnu.org, Eric Abrahamsen >> 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)))