Subject: Re: bug#30699: 26.0.91; buffer contents flicker on macOS frames when frames are resized

From: Aaron Jensen <[email-masked]>
Date: Tue, 20 Mar 2018 14:50:14 -0700

I've been having crashes on master today. Here's the dump (I didn't
have lldb attached at the time). Thread 5 is what pointed me to this:

3   com.apple.SkyLight                0x00007fff594c6b44
CGSUpdateManager::enable_update(unsigned long long) + 320

dump:

Process:               Emacs [24810]
Path:
/usr/local/Cellar/emacs-plus/HEAD-b39ca55/Emacs.app/Contents/MacOS/Emacs
Identifier:            org.gnu.Emacs
Version:               Version 27.0.50 (9.0)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Emacs [24810]
User ID:               501

Date/Time:             2018-03-20 14:46:41.959 -0700
OS Version:            Mac OS X 10.13.3 (17D102)
Report Version:        12
Bridge OS Version:     3.0 (14Y661)
Anonymous UUID:        09E26AFE-B1D5-81E4-DFC1-FBBA35A17B93

Sleep/Wake UUID:       FB6822D9-AAE9-44F2-93DF-F9B725B456CF

Time Awake Since Boot: 250000 seconds
Time Since Wake:       2400 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGABRT)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

VM Regions Near 0:
-->
    __TEXT                 0000000100000000-00000001001e0000 [ 1920K]
r-x/rwx SM=COW   `
[/usr/local/Cellar/emacs-plus/HEAD-b39ca55/Emacs.app/Contents/MacOS/Emacs]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib            0x00007fff5f64fe3e __pthread_kill + 10
1   libsystem_pthread.dylib           0x00007fff5f78e150 pthread_kill + 333
2   libsystem_c.dylib                 0x00007fff5f55e8fe raise + 26
3   org.gnu.Emacs                     0x00000001000a18da
terminate_due_to_signal + 155
4   org.gnu.Emacs                     0x00000001000b8fb6 emacs_abort + 19
5   org.gnu.Emacs                     0x00000001001793fe ns_term_shutdown + 122
6   org.gnu.Emacs                     0x00000001000a1ab4 shut_down_emacs + 262
7   org.gnu.Emacs                     0x00000001000a18a5
terminate_due_to_signal + 102
8   org.gnu.Emacs                     0x00000001000bb3a6
handle_fatal_signal + 14
9   org.gnu.Emacs                     0x00000001000ba2dc
deliver_fatal_thread_signal + 114
10  org.gnu.Emacs                     0x00000001000bb44e handle_sigsegv + 168
11  libsystem_platform.dylib          0x00007fff5f781f5a _sigtramp + 26
12  ???                               000000000000000000 0 + 0
13  com.apple.AppKit                  0x00007fff351c0d9d
-[NSApplication run] + 812
14  org.gnu.Emacs                     0x00000001001795b2 -[EmacsApp run] + 373
15  org.gnu.Emacs                     0x000000010018434f ns_read_socket + 536
16  org.gnu.Emacs                     0x00000001000ac523 gobble_input + 234
17  org.gnu.Emacs                     0x00000001000ab3bb get_input_pending + 94
18  org.gnu.Emacs                     0x00000001000a7769 read_char + 443
19  org.gnu.Emacs                     0x00000001000a5ddf
read_key_sequence + 1326
20  org.gnu.Emacs                     0x00000001000a49c2 command_loop_1 + 783
21  org.gnu.Emacs                     0x000000010010cf9b
internal_condition_case + 82
22  org.gnu.Emacs                     0x00000001000b0dc7 command_loop_2 + 37
23  org.gnu.Emacs                     0x000000010010cb0b internal_catch + 73
24  org.gnu.Emacs                     0x00000001000a3fc0 command_loop + 156
25  org.gnu.Emacs                     0x00000001000a3ede recursive_edit_1 + 112
26  org.gnu.Emacs                     0x00000001000a4100 Frecursive_edit + 228
27  org.gnu.Emacs                     0x00000001000a2f63 main + 5206
28  libdyld.dylib                     0x00007fff5f500115 start + 1

Thread 1:: gmain
0   libsystem_kernel.dylib            0x00007fff5f64ffca __select + 10
1   libglib-2.0.0.dylib               0x00000001009eeb60 g_poll + 430
2   libglib-2.0.0.dylib               0x00000001009e282f
g_main_context_iterate + 340
3   libglib-2.0.0.dylib               0x00000001009e28dd
g_main_context_iteration + 55
4   libglib-2.0.0.dylib               0x00000001009e398b glib_worker_main + 30
5   libglib-2.0.0.dylib               0x0000000100a03941 g_thread_proxy + 90
6   libsystem_pthread.dylib           0x00007fff5f78b6c1 _pthread_body + 340
7   libsystem_pthread.dylib           0x00007fff5f78b56d _pthread_start + 377
8   libsystem_pthread.dylib           0x00007fff5f78ac5d thread_start + 13

Thread 2:
0   libsystem_kernel.dylib            0x00007fff5f64ffca __select + 10
1   org.gnu.Emacs                     0x000000010017a51a -[EmacsApp
fd_handler:] + 219
2   com.apple.Foundation              0x00007fff39cc8ee8
__NSThread__start__ + 1197
3   libsystem_pthread.dylib           0x00007fff5f78b6c1 _pthread_body + 340
4   libsystem_pthread.dylib           0x00007fff5f78b56d _pthread_start + 377
5   libsystem_pthread.dylib           0x00007fff5f78ac5d thread_start + 13

Thread 3:: com.apple.NSEventThread
0   libsystem_kernel.dylib            0x00007fff5f6467c2 mach_msg_trap + 10
1   libsystem_kernel.dylib            0x00007fff5f645cdc mach_msg + 60
2   com.apple.CoreFoundation          0x00007fff37bea575
__CFRunLoopServiceMachPort + 341
3   com.apple.CoreFoundation          0x00007fff37be98c7 __CFRunLoopRun + 1783
4   com.apple.CoreFoundation          0x00007fff37be8f43
CFRunLoopRunSpecific + 483
5   com.apple.AppKit                  0x00007fff353093c8 _NSEventThread + 184
6   libsystem_pthread.dylib           0x00007fff5f78b6c1 _pthread_body + 340
7   libsystem_pthread.dylib           0x00007fff5f78b56d _pthread_start + 377
8   libsystem_pthread.dylib           0x00007fff5f78ac5d thread_start + 13

Thread 4:
0   libsystem_pthread.dylib           0x00007fff5f78ac40 start_wqthread + 0
1   ???                               0x0000700005ec7b30 0 + 123145401695024

Thread 5:: Dispatch queue: NSCGSDisableUpdates
0   libsystem_kernel.dylib            0x00007fff5f6467c2 mach_msg_trap + 10
1   libsystem_kernel.dylib            0x00007fff5f645cdc mach_msg + 60
2   com.apple.SkyLight                0x00007fff59522285
CGSUpdateManager::enable_updates_common() + 565
3   com.apple.SkyLight                0x00007fff594c6b44
CGSUpdateManager::enable_update(unsigned long long) + 320
4   libdispatch.dylib                 0x00007fff5f4ce591
_dispatch_call_block_and_release + 12
5   libdispatch.dylib                 0x00007fff5f4c6d50
_dispatch_client_callout + 8
6   libdispatch.dylib                 0x00007fff5f4db20c
_dispatch_queue_serial_drain + 635
7   libdispatch.dylib                 0x00007fff5f4ce0fd
_dispatch_queue_invoke + 373
8   libdispatch.dylib                 0x00007fff5f4dbf02
_dispatch_root_queue_drain_deferred_wlh + 332
9   libdispatch.dylib                 0x00007fff5f4dfd16
_dispatch_workloop_worker_thread + 880
10  libsystem_pthread.dylib           0x00007fff5f78b033 _pthread_wqthread + 980
11  libsystem_pthread.dylib           0x00007fff5f78ac4d start_wqthread + 13

Thread 6:
0   libsystem_kernel.dylib            0x00007fff5f650562 __workq_kernreturn + 10
1   libsystem_pthread.dylib           0x00007fff5f78b26f
_pthread_wqthread + 1552
2   libsystem_pthread.dylib           0x00007fff5f78ac4d start_wqthread + 13

Thread 7:
0   libsystem_kernel.dylib            0x00007fff5f650562 __workq_kernreturn + 10
1   libsystem_pthread.dylib           0x00007fff5f78b26f
_pthread_wqthread + 1552
2   libsystem_pthread.dylib           0x00007fff5f78ac4d start_wqthread + 13

Thread 8:
0   libsystem_pthread.dylib           0x00007fff5f78ac40 start_wqthread + 0
1   ???                               0x0000000101642a00 0 + 4318308864

Thread 9:
0   libsystem_pthread.dylib           0x00007fff5f78ac40 start_wqthread + 0
1   ???                               0x0000000101643e00 0 + 4318313984

Thread 10:
0   libsystem_kernel.dylib            0x00007fff5f650562 __workq_kernreturn + 10
1   libsystem_pthread.dylib           0x00007fff5f78b26f
_pthread_wqthread + 1552
2   libsystem_pthread.dylib           0x00007fff5f78ac4d start_wqthread + 13

Thread 11:
0   libsystem_pthread.dylib           0x00007fff5f78ac40 start_wqthread + 0
1   ???                               0x0000000101646600 0 + 4318324224

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x00007fff98556340  rcx:
0x00000001005c8198  rdx: 0x0000000000000000
  rdi: 0x0000000000000307  rsi: 0x0000000000000006  rbp:
0x00000001005c81d0  rsp: 0x00000001005c8198
   r8: 0x0000000000000015   r9: 0x00000001123ef410  r10:
0x0000000000000000  r11: 0x0000000000000287
  r12: 0x0000000000000307  r13: 0x0000000101706150  r14:
0x0000000000000006  r15: 0x000000000000002d
  rip: 0x00007fff5f64fe3e  rfl: 0x0000000000000286  cr2: 0x00007fe9a401a000

Logical CPU:     0
Error Code:      0x02000148
Trap Number:     133