From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#38407: 27.0.50; infinite loop with display of large file without newlines Date: Tue, 03 Dec 2019 18:05:42 +0200 Message-ID: <83o8wpjsx5.fsf@gnu.org> References: <39c498717f8958e7fdc408d4da51d378@webmail.orcon.net.nz> <24031.28277.201123.531348@cochabamba.vanoostrum.org> <83r21sowx1.fsf@gnu.org> <24032.4698.256238.87458@cochabamba.vanoostrum.org> <83k17jq1ch.fsf@gnu.org> <24032.17845.921546.629745@cochabamba.vanoostrum.org> <83fti7p349.fsf@gnu.org> <4B1ABCA7-A69C-4251-8EBD-A11654A92642@vanoostrum.org> <83v9r2o4z9.fsf@gnu.org> <24035.27244.755074.180653@cochabamba.vanoostrum.org> <83lfrwlz2w.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="211126"; mail-complaints-to="usenet@blaine.gmane.org" Cc: psainty@orcon.net.nz, pieter@vanoostrum.org, 38407@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 03 17:35:33 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1icB98-000sin-RS for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Dec 2019 17:35:30 +0100 Original-Received: from localhost ([::1]:55972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icB97-0001aH-K7 for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Dec 2019 11:35:29 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54145) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icAhk-0000Y8-Aq for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2019 11:07:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icAhb-0002ff-ER for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2019 11:07:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34980) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1icAhb-0002eU-9b for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2019 11:07:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1icAhZ-0007ki-UO for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2019 11:07:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Dec 2019 16:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38407 X-GNU-PR-Package: emacs Original-Received: via spool by 38407-submit@debbugs.gnu.org id=B38407.157538917429722 (code B ref 38407); Tue, 03 Dec 2019 16:07:01 +0000 Original-Received: (at 38407) by debbugs.gnu.org; 3 Dec 2019 16:06:14 +0000 Original-Received: from localhost ([127.0.0.1]:40953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icAgn-0007jK-Jr for submit@debbugs.gnu.org; Tue, 03 Dec 2019 11:06:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40033) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icAgj-0007iw-Np for 38407@debbugs.gnu.org; Tue, 03 Dec 2019 11:06:12 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1icAgW-0006lc-LU; Tue, 03 Dec 2019 11:05:56 -0500 Original-Received: from [176.228.60.248] (port=3264 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1icAgU-0004Ha-1m; Tue, 03 Dec 2019 11:05:54 -0500 In-reply-to: (message from Robert Pluim on Tue, 03 Dec 2019 12:20:26 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:172815 Archived-At: > From: Robert Pluim > Cc: Phil Sainty , pieter@vanoostrum.org, > 38407@debbugs.gnu.org > Date: Tue, 03 Dec 2019 12:20:26 +0100 > > >>>>> On Mon, 02 Dec 2019 11:27:10 +0100, Robert Pluim said: > /* Otherwise, we can wrap here. */ > SAVE_IT (wrap_it, *it, wrap_data); <===== > may_wrap = false; > } > } > } > > That SAVE_IT is what causes the __memmove_avx_unaligned_erms to show > up so high in the trace (via bidi_shelve_cache). Yes, I was wondering about that myself. But we need more details to understand better what, if anything, can be done about this. First, which part of SAVE_IT causes this? I'm guessing it's this part: #define SAVE_IT(ITCOPY, ITORIG, CACHE) \ do { \ if (CACHE) \ bidi_unshelve_cache (CACHE, true); \ ITCOPY = ITORIG; \ CACHE = bidi_shelve_cache (); \ <<<<<<<<<<<< } while (false) If that is true, then I think the offending part of bidi_shelve_cache is this: alloc = (bidi_shelve_header_size + bidi_cache_idx * sizeof (struct bidi_it)); databuf = xmalloc (alloc); bidi_cache_total_alloc += alloc; memcpy (databuf, &bidi_cache_idx, sizeof (bidi_cache_idx)); memcpy (databuf + sizeof (bidi_cache_idx), <<<<<<< bidi_cache, bidi_cache_idx * sizeof (struct bidi_it)); <<<<<<< memcpy (databuf + sizeof (bidi_cache_idx) + bidi_cache_idx * sizeof (struct bidi_it), bidi_cache_start_stack, sizeof (bidi_cache_start_stack)); And if this guess is also true, then I think the problem is that databuf + sizeof (bidi_cache_idx) is unaligned on 64-bit systems, since bidi_cache_idx is an int. Could you verify the above guesses? Thanks.