From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70385: Crash in note_fringe_highlight Date: Mon, 15 Apr 2024 21:58:15 +0800 Message-ID: <87y19ezq14.fsf@yahoo.com> References: <86h6g49cdv.fsf@mail.linkov.net> <87jzkz1kdn.fsf@yahoo.com> <86r0f6lv76.fsf@gnu.org> <8734rm25zb.fsf@yahoo.com> <86edb6lqw0.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11191"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: bjorn.bidar@thaodan.de, juri@linkov.net, 70385@debbugs.gnu.org, vekazanov@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 15 15:59:12 2024 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 1rwMrX-0002gv-Kq for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Apr 2024 15:59:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwMrP-0003YY-51; Mon, 15 Apr 2024 09:59:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rwMrN-0003Y6-7Q for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 09:59:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rwMrM-000834-U9 for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 09:59:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rwMrX-0003Fv-Uw for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 09:59:12 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Apr 2024 13:59:11 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70385 X-GNU-PR-Package: emacs Original-Received: via spool by 70385-submit@debbugs.gnu.org id=B70385.171318953112288 (code B ref 70385); Mon, 15 Apr 2024 13:59:11 +0000 Original-Received: (at 70385) by debbugs.gnu.org; 15 Apr 2024 13:58:51 +0000 Original-Received: from localhost ([127.0.0.1]:37463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwMrB-0003Bu-8d for submit@debbugs.gnu.org; Mon, 15 Apr 2024 09:58:50 -0400 Original-Received: from sonic305-21.consmr.mail.ne1.yahoo.com ([66.163.185.147]:43346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwMr8-0003BJ-6K for 70385@debbugs.gnu.org; Mon, 15 Apr 2024 09:58:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1713189508; bh=pE/z15EJuMt6GkqkDB03SneDNE8o2UOh9enrJPuIThA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=Alg16g7mWOU6u9hqP3SNKPmRDXToQF1YhjM6T2Wq6mSrWhduDsBDlhB8M3tvJl4XKCWI+VRZ6eGZ3ViY0F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xcXYK1Q9zoiJoXiy4WWqEdljs37BsMHVVkw12OYLUzN_wFmNImZe46WVHsMcWAJ_q2XOfW 0wy6JlZs_X.AlR7JywA9nHl.S5xbrh2vgiY2OEbbCk7DeDrYqrvXDqgMq09j5g8NX65VnbAyCIQ1 r2YqOIL9RqsF.aKSrAhaaoWelcHNeI54lRLlT_g.C5WGseZEIySJZHW3cgzLcBAxMCmKPiWWpdFr bY3nY3E6KFQQZAp9CoO0AZy3jHc4wEWMiuUsSBpNd.Vr7oEB9loTU22VonywYv8nHXw2rtIR.n1r RspPWdr5zekafA_6C2li4Mwr5XuODZdLeZbqzYWyWNZnR_Q__Ni_vEGhXm_WQwKkwDxi4m97WI1Z aKvLKVvE0CveGRzH37FSi4abKiHTOc.9kNpbGwV9_vLvSSp_K9K7WWPWnH99205ExJit7kbRuXCY 0l1ehSW6zj70LovyQChj8QQ0YM9_QJrzMIjhB9NEzKMOnVPNgM1mzok7zSij4dRwJPCjoEKMa9m9 a5ZI8wzJqanHOl7MOFVA7kMB9t22OrH_tHv5ngvkOd X-Sonic-MF: X-Sonic-ID: 32e42379-b693-4f4e-b64d-dfc3af8a7356 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Mon, 15 Apr 2024 13:58:28 +0000 Original-Received: by hermes--production-sg3-6f9f87bd85-kf2q6 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID fd4b7981057cfff4b04a18f47ae9aa85; Mon, 15 Apr 2024 13:58:22 +0000 (UTC) In-Reply-To: <86edb6lqw0.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 15 Apr 2024 16:03:27 +0300") X-Mailer: WebService/1.1.22205 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283377 Archived-At: Eli Zaretskii writes: > I think this should be > > if ((window_outdated (w) > || !w->window_end_valid > || !MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->current_matrix, > vpos))) Yes, sorry. > I'm not sure it will help, because it seems the segfault happens in > the MATRIX_ROW_DISPLAYS_TEXT_P macro. So I think we are somehow > dealing with w->current_matrix whose 'nrows' is too small. The > mouse-highlight code detects that case in x_y_to_hpos_vpos. Right. What about this? diff --git a/src/xdisp.c b/src/xdisp.c index d984c12d1aa..dcecc2b09d4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -35772,6 +35772,7 @@ note_fringe_highlight (struct frame *f, Lisp_Object window, int x, int y, /* Don't access the TEXT_AREA of a row that does not display text, or when the window is outdated. (bug#70385) */ if (window_outdated (w) + || (vpos >= w->current_matrix->nrows) || !MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->current_matrix, vpos))) return; It's the same test x_y_to_hpos_vpos applies to decide whether to punt and return NULL.