From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70385: Crash in note_fringe_highlight Date: Mon, 15 Apr 2024 21:23:51 +0300 Message-ID: <86ttk2jxhk.fsf@gnu.org> References: <86h6g49cdv.fsf@mail.linkov.net> <87jzkz1kdn.fsf@yahoo.com> <86r0f6lv76.fsf@gnu.org> <8734rm25zb.fsf@yahoo.com> <86edb6lqw0.fsf@gnu.org> <87y19ezq14.fsf@yahoo.com> <87ttk2sgl9.fsf@> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9139"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, vekazanov@gmail.com, 70385@debbugs.gnu.org, juri@linkov.net To: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 15 20:25:14 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 1rwR0z-00023b-VP for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Apr 2024 20:25:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwR0g-0005f8-JT; Mon, 15 Apr 2024 14:24:54 -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 1rwR0c-0005cX-Gb for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 14:24:50 -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 1rwR0c-0006fc-0G for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 14:24:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rwR0n-0008JE-PI for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 14:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Apr 2024 18:25:01 +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.171320545631555 (code B ref 70385); Mon, 15 Apr 2024 18:25:01 +0000 Original-Received: (at 70385) by debbugs.gnu.org; 15 Apr 2024 18:24:16 +0000 Original-Received: from localhost ([127.0.0.1]:38852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwR04-0008Ct-3M for submit@debbugs.gnu.org; Mon, 15 Apr 2024 14:24:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwR00-0008BN-Kp for 70385@debbugs.gnu.org; Mon, 15 Apr 2024 14:24:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rwQzi-0006G1-Rk; Mon, 15 Apr 2024 14:23:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Ggf5mWE/GpZAAPQGUAvIAQrhEnI2lHfgAI36BPZM5Sg=; b=EMV2R9iJSTw8kA8hCvO6 equhgCDaIATYaQSo5mIKD3jfnmK1A/87cx95cLCFDS7LlrBXDeqq3JjpwyUwueiOEPDLYSfJub4C8 itjSUigeowlOYy7HfST7B36tRVNGtyYILJ679UvLlTH+L9lUgoADpYbVcVXpza4MHuMSQ4DSzYmWi VOAxm8gsqgOd2+VB3kfKBsZAeCTH0E9W9CP6qzTji9y8kFF0mouG5ZAk4vuYheKCfLf73yblwyouK DaRUfzGzZBKybdYBfRB/gR86olJsel8dZ49IoQL2Q7TkL2rQi3cnlaLdMCn4Jx0oXPLMTptkUNqxs vQCM128fCA6seg==; In-Reply-To: <87ttk2sgl9.fsf@> (message from =?UTF-8?Q?Bj=C3=B6rn?= Bidar on Mon, 15 Apr 2024 20:04:02 +0300) 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:283388 Archived-At: > From: Björn Bidar > Cc: Eli Zaretskii , Po Lu , > juri@linkov.net, 70385@debbugs.gnu.org, vekazanov@gmail.com > Date: Mon, 15 Apr 2024 20:04:02 +0300 > > Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text > editors" writes: > > > 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. > > Tried the change but it wasn't enough: OK, but can you please collect the data I asked for? It's important for figuring out the solution. Thanks.