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#44313: 27.1.50; ns_mouse_position EXC_BAD_ACCESS crash Date: Fri, 30 Oct 2020 22:12:31 +0200 Message-ID: <83a6w3a2xc.fsf@gnu.org> References: <83o8kkb2vr.fsf@gnu.org> <83a6w4ar50.fsf@gnu.org> <83imara6v0.fsf@gnu.org> <83eelfa5x9.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17651"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44313@debbugs.gnu.org To: Aaron Jensen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 30 21:13:10 2020 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 1kYalq-0004W4-5H for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Oct 2020 21:13:10 +0100 Original-Received: from localhost ([::1]:34820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYalp-0005VX-6s for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Oct 2020 16:13:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYali-0005VN-TW for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2020 16:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48289) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYali-0006fR-Jj for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2020 16:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kYali-0008VN-EW for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2020 16:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Oct 2020 20:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44313 X-GNU-PR-Package: emacs Original-Received: via spool by 44313-submit@debbugs.gnu.org id=B44313.160408877632681 (code B ref 44313); Fri, 30 Oct 2020 20:13:02 +0000 Original-Received: (at 44313) by debbugs.gnu.org; 30 Oct 2020 20:12:56 +0000 Original-Received: from localhost ([127.0.0.1]:59835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYalc-0008V3-8f for submit@debbugs.gnu.org; Fri, 30 Oct 2020 16:12:56 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYala-0008Uq-5P for 44313@debbugs.gnu.org; Fri, 30 Oct 2020 16:12:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51816) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYalU-0006dS-VY; Fri, 30 Oct 2020 16:12:48 -0400 Original-Received: from [176.228.60.248] (port=2684 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kYalT-0005qL-8W; Fri, 30 Oct 2020 16:12:47 -0400 In-Reply-To: (message from Aaron Jensen on Fri, 30 Oct 2020 14:37:04 -0500) 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" Xref: news.gmane.io gmane.emacs.bugs:192187 Archived-At: > From: Aaron Jensen > Date: Fri, 30 Oct 2020 14:37:04 -0500 > Cc: 44313@debbugs.gnu.org > > On Fri, Oct 30, 2020 at 2:08 PM Eli Zaretskii wrote: > > I don't know. The code in Fmouse_pixel_position uses the > > selected-frame, so it is quite strange, to say the least, that this > > frame could be garbled when you just move the mouse pointer. > > I'm in the debugger right now. It happened as soon as I started a > full-screen zoom screenshare (maybe that's a hint?) > > The value of f is different than selected_frame and > dpyinfo->ns_focus_frame, which means that it's likely set in this > code: > > #ifdef NS_IMPL_COCOA > /* Find the uppermost Emacs frame under the mouse pointer. > > This doesn't work on GNUstep, although in recent versions there > is compatibility code that makes it a noop. */ > > NSPoint screen_position = [NSEvent mouseLocation]; > NSInteger window_number = 0; > do > { > NSWindow *w; > > window_number = [NSWindow windowNumberAtPoint:screen_position > belowWindowWithWindowNumber:window_number]; > w = [NSApp windowWithWindowNumber:window_number]; > > if (w && [[w delegate] isKindOfClass:[EmacsView class]]) > f = ((EmacsView *)[w delegate])->emacsframe; > } > while (window_number > 0 && !f); > #endif I'll let Alan chime in here. This is deep in NS specific code which I'm not familiar with. > I wonder if a check for FRAME_LIVE_P should be added here for safety? But the frame pointer in this case would crash FRAME_LIVE_P as well, AFAIU, because it cannot be dereferenced. See your last debug session, where the debugger tells this quite explicitly.