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#74274: [PATCH] Revert part of d3f8ed730f to avoid segmentation fault Date: Sat, 09 Nov 2024 10:17:23 +0200 Message-ID: <86cyj4om7g.fsf@gnu.org> References: <20241108063148.30423-3-gongqijian@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5339"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd@gnu.org, gongqijian@gmail.com, 74274@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 09 09:18:16 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 1t9gff-0001FU-Gw for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Nov 2024 09:18:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9gfV-0004Ha-Dr; Sat, 09 Nov 2024 03:18:05 -0500 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 1t9gfT-0004HQ-7u for bug-gnu-emacs@gnu.org; Sat, 09 Nov 2024 03:18:03 -0500 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 1t9gfS-0003Ae-Vh for bug-gnu-emacs@gnu.org; Sat, 09 Nov 2024 03:18:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=O3qivieJf8UKNE1kbMt+HpMBwUfF9yeUv8Q87udxnC4=; b=YZb7SKSUxItqmImW/ghjsJsMQxIFiaK2WN9Djchiwkj4S4YTuFx1Nyb36Q4ROZ9lislA1aXKScaRDnG7/uKTIP3Ex0L/48OGkruWtoO9ftZJyYtbZ1xDhMByZKgpRI8KUAv7kOgYoot+nguBPSz1vjAAUv7BiRUIMMOBs+S0ePEBz8F+guuiz5FH/Y9Bz02v1C3coQGYQ8hOVQ4u8He2FQDaL/n3XDFYsiaePpHY1TQ/w/FAZ64LIZOxapAUMBnp0QgVztzBzHioYsorkKaTTQbhFFh3lpAgQv2PdPn3sJ7kCxUtgbvIA8YKnX0Yj7Qlcw/4/vrvhoTp84Bh3QPK3w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t9gfS-0007Lr-Gr for bug-gnu-emacs@gnu.org; Sat, 09 Nov 2024 03:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Nov 2024 08:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74274 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74274-submit@debbugs.gnu.org id=B74274.173114025428222 (code B ref 74274); Sat, 09 Nov 2024 08:18:02 +0000 Original-Received: (at 74274) by debbugs.gnu.org; 9 Nov 2024 08:17:34 +0000 Original-Received: from localhost ([127.0.0.1]:53276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9gez-0007L8-U4 for submit@debbugs.gnu.org; Sat, 09 Nov 2024 03:17:34 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9gex-0007Ku-6J for 74274@debbugs.gnu.org; Sat, 09 Nov 2024 03:17:32 -0500 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 1t9ger-00036i-H9; Sat, 09 Nov 2024 03:17:25 -0500 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=O3qivieJf8UKNE1kbMt+HpMBwUfF9yeUv8Q87udxnC4=; b=LPmGMigW6F0zf3nahJXC TwMXX1CGqawhWOOEkjzrcJrFfjQwd/3BiBMUA65N4SrBvQB9XHvxtcAHk19d/An0uoex02BJuvIWu Mgnau80LOSm8tAFbarm0UrIcMndAWH2b3bIBTOvZO8Z0onD0nrwgA4nPbZVoY/8kciTmtRT8cOeAa uZeVqH9Imt2YDFoX3RjiyKt6EO8C/PZ1n1vRfQ9jWfQlKuQRzsXfLfRp9j4l+Gui3azUXUdUpZ8ZA AhfyQFijhwkaHYigH6jzkNe2z4K+bvMD0j8wXRxBvSIju2Mc55EG4hgiQo1OfHkjZNnKZMW9tz6u3 9s9POmWrA2eJZQ==; In-Reply-To: (message from Gerd =?UTF-8?Q?M=C3=B6llmann?= on Sat, 09 Nov 2024 08:23:44 +0100) 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:295098 Archived-At: > Cc: Gerd Möllmann , 74274@debbugs.gnu.org > From: Gerd Möllmann > Date: Sat, 09 Nov 2024 08:23:44 +0100 > > Gerd Möllmann writes: > > > qijian gong writes: > > > >> Gerd Möllmann 于2024年11月9日 周六下午12:15写道: > >> > >> Do I understand this right, that the advice you add to > >> tty-tip-compute-position only serves the purpose of being able to pop up > >> a tip frame early, when mouse-position doesn't really have a position to > >> report? Or does it also serve another purpose? > >> > >> Yes, that's correct, there is no other purpose. It seems > >> mouse-position doesn't really have a position until the mouse was > >> moved by user. > > > > Ok, thanks. > > > > I think I know what this is. It's the very particular case of the very > > first redisplay + presence of a child freame, which copies glyphs from a > > current matrix that is still clear, i.e. zeroed, so that glyph::frame > > is zero and so on. > > Which is fixed for me with > > 1 file changed, 6 insertions(+), 3 deletions(-) > src/dispnew.c | 9 ++++++--- > > modified src/dispnew.c > @@ -3544,9 +3544,12 @@ prepare_desired_root_row (struct frame *root, int y) > if (!root_row->enabled_p) > { > struct glyph_row *from = MATRIX_ROW (root->current_matrix, y); > - memcpy (root_row->glyphs[0], from->glyphs[0], > - root->current_matrix->matrix_w * sizeof (struct glyph)); > - root_row->enabled_p = true; > + if (from->enabled_p) > + { > + memcpy (root_row->glyphs[0], from->glyphs[0], > + root->current_matrix->matrix_w * sizeof (struct glyph)); > + root_row->enabled_p = true; > + } > } > return root_row; > } Should this perhaps have an eassert which verifies that every glyph has a valid frame pointer? At the very least please add a comment there explaining the need for the enabled_p test and mentioning the frame pointer of the glyphs. Thanks.