Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV when switching between window layouts #3713

Closed
kidonng opened this issue Jun 12, 2021 · 3 comments
Closed

SIGSEGV when switching between window layouts #3713

kidonng opened this issue Jun 12, 2021 · 3 comments
Labels

Comments

@kidonng
Copy link
Contributor

kidonng commented Jun 12, 2021

Describe the bug
kitty crashes when switching between window layouts for a couple of times.

To Reproduce
Steps to reproduce the behavior:

  1. Launch kitty
  2. Open several windows (4 is enough)
  3. Press ctrl+shift+l several times to switch between window layouts
  4. After some time kitty will crash

Screenshots
N/A

Environment details

Press Ctrl+Shift+F6 in kitty, to copy debug output about kitty and its
configuration to the clipboard and paste it here. 

On older versions of kitty, run kitty --debug-config instead

(I don't know why, pressing Ctrl+Shift+F6 doesn't do anything)

Additional context
Reproduced with kitty --config NONE.

Crash report with make debug:
Process:               kitty [29682]
Path:                  /private/var/folders/*/kitty
Identifier:            kitty
Version:               0
Code Type:             X86-64 (Native)
Parent Process:        fish [24177]
Responsible:           kitty [13168]
User ID:               501

Date/Time:             2021-06-12 15:16:02.728 +0800
OS Version:            macOS 11.5 (20G5033c)
Report Version:        12
Anonymous UUID:        1F92AAD2-E3DE-D617-EE38-E71819508A69

Sleep/Wake UUID:       EAA1F16B-0E51-4F1A-8B6B-01FF4EAF7E97

Time Awake Since Boot: 18000 seconds
Time Since Wake:       18000 seconds

System Integrity Protection: disabled

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

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000018
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [29682]

External Modification Warnings:
Thread creation by external task.

VM Regions Near 0x18:
--> 
    __TEXT                      1069a0000-1069a4000    [   16K] r-x/r-x SM=COW  /var/folders/*/kitty.app/Contents/MacOS/kitty

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   fast_data_types.so            	0x00000001071de489 screen_detect_url + 57 (screen.c:2170)
1   fast_data_types.so            	0x00000001071a370e detect_url + 14 (mouse.c:311)
2   fast_data_types.so            	0x00000001071a36e8 mouse_open_url + 24 (mouse.c:408)
3   fast_data_types.so            	0x00000001071f07ed click_mouse_url + 189 (state.c:995)
4   fast_data_types.so            	0x00000001071ebe6b pyclick_mouse_url + 75 (state.c:1012)
5   org.python.python             	0x0000000106a660c2 cfunction_call + 90
6   org.python.python             	0x0000000106a1b6da _PyObject_MakeTpCall + 129
7   org.python.python             	0x0000000106b13cbd call_function + 270
8   org.python.python             	0x0000000106b11562 _PyEval_EvalFrameDefault + 45384
9   org.python.python             	0x0000000106a1c240 _PyFunction_Vectorcall + 192
10  org.python.python             	0x0000000106b13c53 call_function + 164
11  org.python.python             	0x0000000106b11489 _PyEval_EvalFrameDefault + 45167
12  org.python.python             	0x0000000106a1c240 _PyFunction_Vectorcall + 192
13  org.python.python             	0x0000000106a1efbb method_vectorcall + 481
14  org.python.python             	0x0000000106b1175e _PyEval_EvalFrameDefault + 45892
15  org.python.python             	0x0000000106b052d6 _PyEval_EvalCode + 403
16  org.python.python             	0x0000000106a1c2f8 _PyFunction_Vectorcall + 376
17  org.python.python             	0x0000000106a1ee7a method_vectorcall + 160
18  org.python.python             	0x0000000106b13c53 call_function + 164
19  org.python.python             	0x0000000106b11612 _PyEval_EvalFrameDefault + 45560
20  org.python.python             	0x0000000106a1c240 _PyFunction_Vectorcall + 192
21  org.python.python             	0x0000000106a1ef47 method_vectorcall + 365
22  org.python.python             	0x0000000106a1c7f4 _PyObject_CallFunctionVa + 163
23  org.python.python             	0x0000000106a1d0fe _PyObject_CallMethod_SizeT + 196
24  fast_data_types.so            	0x00000001071a389e dispatch_mouse_event + 286 (mouse.c:153)
25  fast_data_types.so            	0x00000001071a3771 send_pending_click_to_window + 65 (mouse.c:428)
26  fast_data_types.so            	0x00000001071eb6c8 send_pending_click_to_window_id + 200 (state.c:555)
27  glfw-cocoa.so                 	0x0000000107faa94e __schedule_timer_block_invoke + 62 (cocoa_init.m:720)
28  com.apple.Foundation          	0x00007fff21250e0f __NSFireTimer + 67
29  com.apple.CoreFoundation      	0x00007fff2049b279 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
30  com.apple.CoreFoundation      	0x00007fff2049ad6d __CFRunLoopDoTimer + 927
31  com.apple.CoreFoundation      	0x00007fff2049a8ca __CFRunLoopDoTimers + 307
32  com.apple.CoreFoundation      	0x00007fff204814a3 __CFRunLoopRun + 1988
33  com.apple.CoreFoundation      	0x00007fff2048061c CFRunLoopRunSpecific + 563
34  com.apple.HIToolbox           	0x00007fff28761a83 RunCurrentEventLoopInMode + 292
35  com.apple.HIToolbox           	0x00007fff287617e5 ReceiveNextEventCommon + 587
36  com.apple.HIToolbox           	0x00007fff28761583 _BlockUntilNextEventMatchingListInModeWithFilter + 70
37  com.apple.AppKit              	0x00007fff22c806f2 _DPSNextEvent + 864
38  com.apple.AppKit              	0x00007fff22c7eec5 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1364
39  com.apple.AppKit              	0x00007fff22c71239 -[NSApplication run] + 586
40  glfw-cocoa.so                 	0x0000000107faa631 _glfwPlatformRunMainLoop + 81 (cocoa_init.m:685)
41  glfw-cocoa.so                 	0x0000000107fa36d2 glfwRunMainLoop + 18 (init.c:352)
42  fast_data_types.so            	0x000000010718b82d run_main_loop + 13 (glfw.c:1399)
43  fast_data_types.so            	0x0000000107122b5b main_loop + 59 (child-monitor.c:1049)
44  org.python.python             	0x0000000106a27acd method_vectorcall_NOARGS + 99
45  org.python.python             	0x0000000106b13c53 call_function + 164
46  org.python.python             	0x0000000106b11489 _PyEval_EvalFrameDefault + 45167
47  org.python.python             	0x0000000106b052d6 _PyEval_EvalCode + 403
48  org.python.python             	0x0000000106a1c2f8 _PyFunction_Vectorcall + 376
49  org.python.python             	0x0000000106b13c53 call_function + 164
50  org.python.python             	0x0000000106b11562 _PyEval_EvalFrameDefault + 45384
51  org.python.python             	0x0000000106b052d6 _PyEval_EvalCode + 403
52  org.python.python             	0x0000000106a1c2f8 _PyFunction_Vectorcall + 376
53  org.python.python             	0x0000000106a1b907 _PyObject_FastCallDictTstate + 87
54  org.python.python             	0x0000000106a8878e slot_tp_call + 187
55  org.python.python             	0x0000000106a1b6da _PyObject_MakeTpCall + 129
56  org.python.python             	0x0000000106b13cbd call_function + 270
57  org.python.python             	0x0000000106b11562 _PyEval_EvalFrameDefault + 45384
58  org.python.python             	0x0000000106a1c240 _PyFunction_Vectorcall + 192
59  org.python.python             	0x0000000106b13c53 call_function + 164
60  org.python.python             	0x0000000106b11562 _PyEval_EvalFrameDefault + 45384
61  org.python.python             	0x0000000106a1c240 _PyFunction_Vectorcall + 192
62  org.python.python             	0x0000000106b13c53 call_function + 164
63  org.python.python             	0x0000000106b11562 _PyEval_EvalFrameDefault + 45384
64  org.python.python             	0x0000000106a1c240 _PyFunction_Vectorcall + 192
65  org.python.python             	0x0000000106b13c53 call_function + 164
66  org.python.python             	0x0000000106b11562 _PyEval_EvalFrameDefault + 45384
67  org.python.python             	0x0000000106b052d6 _PyEval_EvalCode + 403
68  org.python.python             	0x0000000106b0004f builtin_exec + 389
69  org.python.python             	0x0000000106a66a43 cfunction_vectorcall_FASTCALL + 95
70  org.python.python             	0x0000000106b13c53 call_function + 164
71  org.python.python             	0x0000000106b11562 _PyEval_EvalFrameDefault + 45384
72  org.python.python             	0x0000000106b052d6 _PyEval_EvalCode + 403
73  org.python.python             	0x0000000106a1c2f8 _PyFunction_Vectorcall + 376
74  org.python.python             	0x0000000106b13c53 call_function + 164
75  org.python.python             	0x0000000106b11562 _PyEval_EvalFrameDefault + 45384
76  org.python.python             	0x0000000106b052d6 _PyEval_EvalCode + 403
77  org.python.python             	0x0000000106a1c2f8 _PyFunction_Vectorcall + 376
78  org.python.python             	0x0000000106b83fd0 pymain_run_module + 212
79  org.python.python             	0x0000000106b83ac8 pymain_run_python + 479
80  org.python.python             	0x0000000106b838ad Py_RunMain + 23
81  org.python.python             	0x0000000106b84bca pymain_main + 35
82  org.python.python             	0x0000000106b84ba1 Py_Main + 42
83  kitty                         	0x00000001069a3c0c main + 1116
84  libdyld.dylib                 	0x00007fff203a4f5d start + 1

Thread 1:
0   libsystem_pthread.dylib       	0x00007fff20385420 start_wqthread + 0

Thread 2:
0   libsystem_kernel.dylib        	0x00007fff203542ba mach_msg_trap + 10
1   libsystem_kernel.dylib        	0x00007fff2035462c mach_msg + 60
2   libsystem_kernel.dylib        	0x00007fff2037399b thread_suspend + 80
3   ???                           	0x0000000108103877 0 + 4430248055

Thread 3:: com.apple.NSEventThread
0   libsystem_kernel.dylib        	0x00007fff203542ba mach_msg_trap + 10
1   libsystem_kernel.dylib        	0x00007fff2035462c mach_msg + 60
2   com.apple.CoreFoundation      	0x00007fff20482b2f __CFRunLoopServiceMachPort + 316
3   com.apple.CoreFoundation      	0x00007fff2048120f __CFRunLoopRun + 1328
4   com.apple.CoreFoundation      	0x00007fff2048061c CFRunLoopRunSpecific + 563
5   com.apple.AppKit              	0x00007fff22e0668a _NSEventThread + 124
6   libsystem_pthread.dylib       	0x00007fff203898fc _pthread_start + 224
7   libsystem_pthread.dylib       	0x00007fff20385443 thread_start + 15

Thread 4:: KittyChildMon
0   libsystem_kernel.dylib        	0x00007fff2035a9ca poll + 10
1   fast_data_types.so            	0x00000001071234d9 io_loop + 457
2   libsystem_pthread.dylib       	0x00007fff203898fc _pthread_start + 224
3   libsystem_pthread.dylib       	0x00007fff20385443 thread_start + 15

Thread 5:: CVDisplayLink
0   libsystem_kernel.dylib        	0x00007fff20356cde __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff20389e7f _pthread_cond_wait + 1352
2   com.apple.CoreVideo           	0x00007fff272cdfe3 CVDisplayLink::waitUntil(unsigned long long) + 229
3   com.apple.CoreVideo           	0x00007fff272cd4ec CVDisplayLink::runIOThread() + 482
4   libsystem_pthread.dylib       	0x00007fff203898fc _pthread_start + 224
5   libsystem_pthread.dylib       	0x00007fff20385443 thread_start + 15

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000000  rcx: 0x00007fbdf67f60dc  rdx: 0x0000000000000017
  rdi: 0x00007fbdfc1a1000  rsi: 0x0000000000000017  rbp: 0x00007ffee9256bd0  rsp: 0x00007ffee9256b90
   r8: 0x0000000106d63930   r9: 0x0000000106c22040  r10: 0x00007ffee9256c30  r11: 0x00000001072b6c3c
  r12: 0x00007fbdfc1a1000  r13: 0x000000000000001e  r14: 0x0000000000000017  r15: 0x0000000000000000
  rip: 0x00000001071de489  rfl: 0x0000000000010246  cr2: 0x0000000000000018
  
Logical CPU:     0
Error Code:      0x00000004 (no mapping for user data read)
Trap Number:     14

Thread 0 instruction stream:
  5e 41 5f 5d c3 66 90 55-48 89 e5 31 c0 48 85 b7  ^A_].f.UH..1.H..
  a8 00 00 00 0f 95 c0 5d-c3 66 2e 0f 1f 84 00 00  .......].f......
  00 00 00 0f 1f 40 00 55-48 89 e5 41 57 41 56 41  .....@.UH..AWAVA
  55 41 54 53 48 83 ec 18-41 89 d6 41 89 f5 49 89  UATSH...A..A..I.
  fc 48 8b 05 67 bc 0d 00-48 8b 00 48 89 45 d0 c7  .H..g...H..H.E..
  45 cc 00 00 00 00 89 d6-e8 3a 01 00 00 48 89 c3  E........:...H..
 [48]8b 40 18 44 89 e9 48-8d 0c 49 66 83 7c 88 08  H.@.D..H..If.|..	<==
  00 74 16 4c 89 e7 44 89-ee 44 89 f2 e8 36 01 00  .t.L..D..D...6..
  00 41 b5 01 e9 d8 00 00-00 48 85 db 74 46 48 89  .A.......H..tFH.
  df 44 89 ee e8 7e 12 fc-ff 41 89 c7 3b 43 20 73  .D...~...A..;C s
  4b 41 8b 44 24 14 ff c8-44 39 f0 76 41 41 8d 76  KA.D$...D9.vAA.v
  01 4c 89 e7 e8 de 00 00-00 48 89 c7 e8 46 17 fc  .L.......H...F..
  
Thread 0 last branch register state not available.


@kidonng kidonng added the bug label Jun 12, 2021
@kovidgoyal
Copy link
Owner

Doesn't crash for me with those steps and according to the traceback you
posted the crash is happening while processing a mouse click. I have
made a commit that should prevent the crash in the traceback, please try
it.

@kidonng
Copy link
Contributor Author

kidonng commented Jun 12, 2021

Sorry, I forgot to mention I also have to clicking around in order to reproduce the issues. The latest commit seems fine so far, thanks!

@kovidgoyal
Copy link
Owner

No worries, hopefully my commit fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants