Subject: bug#44313: 27.1.50; ns_mouse_position EXC_BAD_ACCESS crash

From: Eli Zaretskii <[email-masked]>
Date: Fri, 30 Oct 2020 09:15:52 +0200

> From: Aaron Jensen <[email-masked]>
> Date: Thu, 29 Oct 2020 15:16:22 -0500
> 
> Not sure how to reproduce this, but it has happened multiple times
> today. I'm on e29cace60a
> 
> * thread #1, queue = 'com.apple.main-thread', stop reason =
> EXC_BAD_ACCESS (code=1, address=0x9038f6d4d)
>   * frame #0: 0x0000000100378558
> emacs`ns_mouse_position(fp=0x00007ffeefbfd3e8, insist=-1,
> bar_window=0x00007ffeefbfd3e0, part=0x00007ffeefbfd3c4,
> x=0x00007ffeefbfd3d8, y=0x00007ffeefbfd3d0, time=0x00007ffeefbfd3b8)
> at nsterm.m:2536:12
>     frame #1: 0x000000010001fefc emacs`Fmouse_pixel_position at frame.c:2494:7
[...]
> (lldb) frame select 3

The crash is in frame #0, so please show the relevant variables
there.  According to the line number the crash is here:

  if (f && FRAME_NS_P (f))

So why does FRAME_NS_P crash? which part of the frame's structure are
invalid?

Thanks.