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.devel Subject: Re: [scratch/igc] 985247b6bee crash on Linux, KDE, Wayland Date: Thu, 05 Sep 2024 21:46:40 +0300 Message-ID: <86cyli2b1r.fsf@gnu.org> References: <8734mezkgo.fsf@gmail.com> <8634me447j.fsf@gnu.org> <861q1y437s.fsf@gnu.org> <86wmjq2mr2.fsf@gnu.org> <875xrars34.fsf@protonmail.com> <87h6aunilt.fsf@gmail.com> <87zfomqbgk.fsf@protonmail.com> <875xrani8k.fsf@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="1222"; mail-complaints-to="usenet@ciao.gmane.io" Cc: execvy@gmail.com, pipcet@protonmail.com, emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 05 21:09:44 2024 Return-path: Envelope-to: ged-emacs-devel@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 1smHrT-000088-VQ for ged-emacs-devel@m.gmane-mx.org; Thu, 05 Sep 2024 21:09:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smHVJ-0007to-GP; Thu, 05 Sep 2024 14:46:49 -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 1smHVG-0007tZ-Oj for emacs-devel@gnu.org; Thu, 05 Sep 2024 14:46:46 -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 1smHVG-0004vC-E0; Thu, 05 Sep 2024 14:46:46 -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=tf2GI9f/oJsFWcMzvNmXwNxGANRCD7eeJNczI6eG1BY=; b=DNAvK88G6UjBRITbVXQc NwjlXA+tvBNsL4mkBKsCSs/uMJ42I+hMfsjmgdateV81pzTBedRjyAByk7I4U5BsKoVfIKScTT/Px xH3BFKoXaNx7/rAUofjwA6UAdoEYZZr3jYkyBEsjSJPnI9l0LjQ0sZupSa4AguMCglQceOm8UGDP5 JQKCgwkDVFU5YxMH9OtMG79ZGS+mbymTv+i2DeGPq+MFAU23QjoxBty41lzSFcCOzqXc30IXFVDgk A2Kng730AVmNpWF7R0B7sAtCnDNnVUf0aZya077EZliL7V6JpQcXMtPP6Huq8NwXlFgHPzbRIovF9 /mC+NJa0dn5oIA==; In-Reply-To: (message from Gerd =?utf-8?Q?M=C3=B6llmann?= on Thu, 05 Sep 2024 19:16:14 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323428 Archived-At: > From: Gerd Möllmann > Cc: Pip Cet , Eli Zaretskii , > emacs-devel@gnu.org > Date: Thu, 05 Sep 2024 19:16:14 +0200 > > Eval EXEC writes: > > > (gdb) p f->output_data > > $2 = { > > tty = 0x0, > > x = 0x0, > > That's the FRAME_OUTPUT_DATA thing I mentioned. I pushed something for > that now, please give it a try. Thanks, but I don't think this is the right change. It is not useful to make MOUSE_HL_INFO return NULL, because it is immediately dereferenced in many places in the Emacs code. Here's one example: /* If a row with mouse-face was overwritten, arrange for frame_up_to_date_hook to redisplay the mouse highlight. */ if (mouse_face_overwritten_p) { Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; hlinfo->mouse_face_window = Qnil; } GCC emits warnings in all of these places, like this: dispnew.c: In function 'gui_update_window_end': dispnew.c:3991:34: warning: potential null pointer dereference [-Wnull-dereference] 3991 | hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dispnew.c:3992:63: warning: potential null pointer dereference [-Wnull-dereference] 3992 | hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ dispnew.c:3992:34: warning: potential null pointer dereference [-Wnull-dereference] If we think that fix_frame can be called for a frame that was deleted, we should test FRAME_LIVE_P, like we do elsewhere. So please fix it in some other way.