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:03:14 -0800 Message-ID: <87mtzsbim5.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="14473"; 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:04:17 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 1kbbw9-0003dt-8w for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Nov 2020 05:04:17 +0100 Original-Received: from localhost ([::1]:36390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kbbw7-0004rl-Sp for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Nov 2020 23:04:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbbvu-0004rP-JF for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 23:04:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48020) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbbvu-0001KR-A5 for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 23:04:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kbbvu-0001yE-3w; Sat, 07 Nov 2020 23:04:02 -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:04:02 +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.16048082087533 (code B ref 44506); Sun, 08 Nov 2020 04:04:02 +0000 Original-Received: (at 44506) by debbugs.gnu.org; 8 Nov 2020 04:03:28 +0000 Original-Received: from localhost ([127.0.0.1]:59565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbbvM-0001xR-Ew for submit@debbugs.gnu.org; Sat, 07 Nov 2020 23:03:28 -0500 Original-Received: from ericabrahamsen.net ([52.70.2.18]:58030 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbbvK-0001xF-S5 for 44506@debbugs.gnu.org; Sat, 07 Nov 2020 23:03:27 -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 162E5FA086; Sun, 8 Nov 2020 04:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1604808201; bh=+ebaxaBHkM+CWUWUUbPQ5ClsdJB9Svr2JliqIbYkoUo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=pVDE/iARdDYKjKSFidbXHNFsEKvHa4luAuqh/PAHVHN35pxIMpW+YwZY1Af/86McY m30FEOJ/QVEsi0+jzVI0/S1bHqAXPfe+YrVipN21tfBXMaJoz8KtEGmXWMosWs9tXf GvRX5LGa+JQ7BoqSGZBYNiKe/ujkIYJKDYEQQXBc= 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:192862 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)))