kit icon indicating copy to clipboard operation
kit copied to clipboard

v3.11.10 crashes when typing escape

Open andlang opened this issue 1 year ago • 11 comments

On my Intel MBP 16" with touchbar and macOS 15.2, Script Kit (3.11.10) crashes each time, I type escape. I just need to open it, type escape and it crashes. It seems like the same issue mentioned in https://github.com/johnlindquist/kit/discussions/774.

Here is the crash report from syslog:

20:23:36.899144+0100	Script Kit	MAC-PANEL-WINDOW: hideInstant
20:23:36.899240+0100	Script Kit	MAC-PANEL-WINDOW: Hiding window: <PROPanel: 0x1340649eb80>
20:23:36.899312+0100	Script Kit	MAC-PANEL-WINDOW: Window hidden - window: <PROPanel: 0x1340649eb80>
20:23:36.899987+0100	Script Kit	MAC-PANEL-WINDOW: hideInstant
20:23:36.900058+0100	Script Kit	MAC-PANEL-WINDOW: Hiding window: <PROPanel: 0x1340649eb80>
20:23:36.900115+0100	Script Kit	MAC-PANEL-WINDOW: Window hidden - window: <PROPanel: 0x1340649eb80>
20:23:36.902005+0100	Script Kit	MAC-PANEL-WINDOW: prepForClose
20:23:36.903978+0100	Script Kit	MAC-PANEL-WINDOW: Window resigned as key window before electron window reset.
20:23:36.904081+0100	Script Kit	window <ElectronNSWindow: 0x1340649eb80> windowNumber=4eb finishing close
20:23:36.919852+0100	Script Kit	order window: 4eb op: 0 relative: 0 related: 0
20:23:36.920054+0100	Script Kit	[0x134062bb800] invalidated because the current process cancelled the connection by calling xpc_connection_cancel()
20:23:36.920088+0100	Script Kit	[0x134070b8580] Session canceled.
20:23:36.920161+0100	Script Kit	agent connection cancelled (details: Session manually canceled)
20:23:36.920202+0100	Script Kit	[0x134070b8580] Disposing of session
20:23:36.924110+0100	Script Kit	Cannot remove an observer <_NSTouchBarFinderObservation 0x134076ea220> for the key path "nextResponder" from <ElectronNSWindow 0x1340649eb80> because it is not registered as an observer.
20:23:36.927998+0100	Script Kit	(
	0   CoreFoundation                      0x00007ff813df3326 __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007ff8138d8bd0 objc_exception_throw + 62
	2   Foundation                          0x00007ff814dae396 -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:] + 659
	3   Foundation                          0x00007ff814dae0b3 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] + 129
	4   Foundation                          0x00007ff814dadd79 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:context:] + 225
	5   AppKit                              0x00007ff8183026e8 -[NSWindow removeObserver:forKeyPath:context:] + 108
	6   AppKit                              0x00007ff81800999f -[_NSTouchBarFinderObservation invalidate] + 294
	7   AppKit                              0x00007ff81800b137 ___NSTouchBarFinderSetNeedsUpdateOnMain_block_invoke_2 + 962
	8   AppKit                              0x00007ff8177940b7 NSDisplayCycleObserverInvoke + 140
	9   AppKit                              0x00007ff817793ce9 NSDisplayCycleFlush + 878
	10  QuartzCore                          0x00007ff81ccdfe7d _ZN2CA11Transaction19run_commit_handlersE18CATransactionPhase + 95
	11  QuartzCore                          0x00007ff81ccde8fb _ZN2CA11Transaction6commitEv + 377
	12  AppKit                              0x00007ff81782b261 __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 289
	13  AppKit                              0x00007ff81833e2ef ___NSRunLoopObserverCreateWithHandler_block_invoke + 41
	14  CoreFoundation                      0x00007ff813d82193 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
	15  CoreFoundation                      0x00007ff813d820ae __CFRunLoopDoObservers + 503
	16  CoreFoundation                      0x00007ff813d81647 __CFRunLoopRun + 905
	17  CoreFoundation                      0x00007ff813d80c8e CFRunLoopRunSpecific + 550
	18  HIToolbox                           0x00007ff81f56f413 RunCurrentEventLoopInMode + 292
	19  HIToolbox                           0x00007ff81f574c2e ReceiveNextEventCommon + 192
	20  HIToolbox                           0x00007ff81f575029 _BlockUntilNextEventMatchingListInModeWithFilter + 66
	21  AppKit                              0x00007ff8176d75d3 _DPSNextEvent + 902
	22  AppKit                              0x00007ff81812a038 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1290
	23  AppKit                              0x00007ff8176c8549 -[NSApplication run] + 610
	24  Electron Framework                  0x00000001116e7758 ares_dns_rr_get_name + 5985848
	25  Electron Framework                  0x00000001116e5596 ares_dns_rr_get_name + 5977206
	26  Electron Framework                  0x0000000111699c2e ares_dns_rr_get_name + 5667598
	27  Electron Framework                  0x0000000111654164 ares_dns_rr_get_name + 5382212
	28  Electron Framework                  0x000000011019c595 _ZNK2v88internal8compiler23CompilationDependencies31FieldTypeDependencyOffTheRecordENS1_6MapRefES3_NS0_13InternalIndexENS1_9ObjectRefE + 7545061
	29  Electron Framework                  0x000000011019dfb2 _ZNK2v88internal8compiler23CompilationDependencies31FieldTypeDependencyOffTheRecordENS1_6MapRefES3_NS0_13InternalIndexENS1_9ObjectRefE + 7551746
	30  Electron Framework                  0x0000000110199cff _ZNK2v88internal8compiler23CompilationDependencies31FieldTypeDependencyOffTheRecordENS1_6MapRefES3_NS0_13InternalIndexENS1_9ObjectRefE + 7534671
	31  Electron Framework                  0x000000010dc073ce _ZN2v89CodeEvent13GetScriptLineEv + 540830
	32  Electron Framework                  0x000000010dc083cd _ZN2v89CodeEvent13GetScriptLineEv + 544925
	33  Electron Framework                  0x000000010dc08232 _ZN2v89CodeEvent13GetScriptLineEv + 544514
	34  Electron Framework                  0x000000010dc06c5a _ZN2v89CodeEvent13GetScriptLineEv + 538922
	35  Electron Framework                  0x000000010dc06d42 _ZN2v89CodeEvent13GetScriptLineEv + 539154
	36  Electron Framework                  0x000000010d8578e5 ElectronMain + 245
	37  dyld                                0x00007ff81390d2cd start + 1805
)

Let me know, if you need more information.

andlang avatar Dec 19 '24 19:12 andlang

@andlang had you tried any other versions of v3? Or just 3.11.10?

johnlindquist avatar Dec 19 '24 20:12 johnlindquist

I also tried 3.10.12 which also crashed (at least after a while using it). I just realized, that after a restart of my Mac, Script Kit works at first (also handling correctly the escape key). But then I played with the emoji picker, and now it crashes again each time with the error mentioned above.

andlang avatar Dec 19 '24 20:12 andlang

@andlang Same error in the logs as the "crash after escape"?

johnlindquist avatar Dec 19 '24 21:12 johnlindquist

Yes, the error, that I see in the logs when Script Kit crashes is always:

  Cannot remove an observer <_NSTouchBarFinderObservation 0x11407b74540> for the key path "nextResponder" from <ElectronNSWindow 0x11406375e80> because it is not registered as an observer.

andlang avatar Dec 19 '24 23:12 andlang

@andlang Please give this build a try:

https://github.com/script-kit/app/releases/tag/v3.11.12

johnlindquist avatar Dec 20 '24 01:12 johnlindquist

Unfortunately, this version still has the same error/crash. What I realized is, that in the Clipboard History, I can type escape, and it just closes the window, without crashing the whole app. But when I type escape e. g. in Define or App Launcher, the whole Script Kit app crashes.

andlang avatar Dec 20 '24 18:12 andlang

Oh, interesting. That gives me an idea to what it might be. I'll fire off another build soon

johnlindquist avatar Dec 20 '24 18:12 johnlindquist

@andlang

https://github.com/script-kit/app/releases/tag/v3.11.15

Please try this build. I believe it should resolve it

johnlindquist avatar Dec 20 '24 20:12 johnlindquist

Thank you for your effort! Unfortunately, I still have the same crash. Also with 3.11.15 from just now. I checked a bit the code today for myself, and tired to find the reason for the crash, but with no success. Maybe I should get a new MacBook without touchbar 🫣

andlang avatar Dec 21 '24 23:12 andlang

@andlang the log should at least be a little different. Can you send me the last few lines before the crash?

My friend has a touchbar Mac. I'll hunt it down and figure this out

johnlindquist avatar Dec 22 '24 00:12 johnlindquist

Sure, here are the last messages of the main.log, after I presses escape on the main window:

[2024-12-22 12:27:49.397] [info]  process.ts: 38025: KIT_LOADING null in 1233.5243310000005ms
[2024-12-22 12:27:49.398] [info]  process.ts: 38025: KIT_READY in 1234.0572910000046ms
[2024-12-22 12:27:49.459] [info]  prompt.ts: Prompt window in bounds.
[2024-12-22 12:27:49.581] [info]  io.ts: ✋ Escape pressed
[2024-12-22 12:27:49.587] [info]  prompt.ts: 37566: Escape received by prompt
[2024-12-22 12:27:49.588] [info]  prompt.ts: 37566: Closing prompt window
[2024-12-22 12:27:49.588] [info]  [35mprompt.ts:[0m Closing prompt window with escape
[2024-12-22 12:27:49.589] [info]  process.ts: 🛑 removeByPid: 37566
[2024-12-22 12:27:49.589] [info]  prompt.ts: alwaysOnTop is disabled on mac
[2024-12-22 12:27:49.589] [info]  prompt.ts: 🙈 Hiding prompt window
[2024-12-22 12:27:49.589] [info]  prompt.ts: 37566: "hideInstant" still cooling down
[2024-12-22 12:27:49.589] [info]  prompts.ts: 37566: 🥱 Closing prompt
[2024-12-22 12:27:49.590] [info]  prompt.ts: 37566 1 👋 Close prompt
[2024-12-22 12:27:49.590] [info]  prompt.ts: 37566: "hideInstant" still cooling down
[2024-12-22 12:27:49.590] [info]  utils.ts: 1: 📌 Prepping for close
[2024-12-22 12:27:49.593] [info]  prompt.ts: 37566: window 1: closed
[2024-12-22 12:27:49.594] [info]  prompt.ts: Hours since sync: 0
[2024-12-22 12:27:49.594] [info]  prompts.ts: 37566: 🚮 Deleted prompt. 1 prompts remaining.
[2024-12-22 12:27:49.594] [info]  process.ts: Emitting TERM_KILL for 37566
[2024-12-22 12:27:49.595] [info]  process.ts: 37566: 🛑 removed
[2024-12-22 12:27:49.596] [info]  prompt.ts: ✋ Removing process because of escape 37566
[2024-12-22 12:27:49.596] [info]  prompt.ts: 👆 Emoji changed: off
[2024-12-22 12:27:49.605] [info]  prompt.ts: 📌 closed
[2024-12-22 12:27:49.612] [info]  process.ts: 🏃‍♂️💨 Active process: 38025 - Idle

And that is the console output (filtered by Script Kit) at the same time:

12:27:49.004848+0100	Script Kit	MAC-PANEL-WINDOW: setAppearance
12:27:49.010243+0100	Script Kit Helper (Renderer)	[0x104000e7d00] activating connection: mach=true listener=false peer=false name=com.apple.distributed_notifications@Uv3
12:27:49.588840+0100	Script Kit	MAC-PANEL-WINDOW: hideInstant
12:27:49.588917+0100	Script Kit	MAC-PANEL-WINDOW: Hiding window: <PROPanel: 0x11c0639de80>
12:27:49.588974+0100	Script Kit	MAC-PANEL-WINDOW: Window hidden - window: <PROPanel: 0x11c0639de80>
12:27:49.590636+0100	Script Kit	MAC-PANEL-WINDOW: prepForClose
12:27:49.593111+0100	Script Kit	MAC-PANEL-WINDOW: Window resigned as key window before electron window reset.
12:27:49.605739+0100	Script Kit	window <ElectronNSWindow: 0x11c0639de80> windowNumber=b7a finishing close
12:27:49.611891+0100	Script Kit	order window: b7a op: 0 relative: 0 related: 0
12:27:49.612062+0100	Script Kit	[0x11c060da800] invalidated because the current process cancelled the connection by calling xpc_connection_cancel()
12:27:49.612086+0100	Script Kit	[0x11c02edaa40] Session canceled.
12:27:49.612133+0100	Script Kit	agent connection cancelled (details: Session manually canceled)
12:27:49.612169+0100	Script Kit	[0x11c02edaa40] Disposing of session
12:27:49.617033+0100	Script Kit	order window: b7a op: 0 relative: 0 related: 0
12:27:49.617362+0100	Script Kit	Cannot remove an observer <_NSTouchBarFinderObservation 0x11c07a8d490> for the key path "nextResponder" from <ElectronNSWindow 0x11c0639de80> because it is not registered as an observer.
12:27:49.620981+0100	Script Kit	(
	0   CoreFoundation                      0x00007ff81b324326 __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007ff81ae09bd0 objc_exception_throw + 62
	2   Foundation                          0x00007ff81c2df396 -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:] + 659
	3   Foundation                          0x00007ff81c2df0b3 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] + 129
	4   Foundation                          0x00007ff81c2ded79 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:context:] + 225
	5   AppKit                              0x00007ff81f8336e8 -[NSWindow removeObserver:forKeyPath:context:] + 108
	6   AppKit                              0x00007ff81f53a99f -[_NSTouchBarFinderObservation invalidate] + 294
	7   AppKit                              0x00007ff81f53c137 ___NSTouchBarFinderSetNeedsUpdateOnMain_block_invoke_2 + 962
	8   AppKit                              0x00007ff81ecc50b7 NSDisplayCycleObserverInvoke + 140
	9   AppKit                              0x00007ff81ecc4ce9 NSDisplayCycleFlush + 878
	10  QuartzCore                          0x00007ff824210e7d _ZN2CA11Transaction19run_commit_handlersE18CATransactionPhase + 95
	11  QuartzCore                          0x00007ff82420f8fb _ZN2CA11Transaction6commitEv + 377
	12  AppKit                              0x00007ff81ed5c261 __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 289
	13  AppKit                              0x00007ff81f86f2ef ___NSRunLoopObserverCreateWithHandler_block_invoke + 41
	14  CoreFoundation                      0x00007ff81b2b3193 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
	15  CoreFoundation                      0x00007ff81b2b30ae __CFRunLoopDoObservers + 503
	16  CoreFoundation                      0x00007ff81b2b2647 __CFRunLoopRun + 905
	17  CoreFoundation                      0x00007ff81b2b1c8e CFRunLoopRunSpecific + 550
	18  HIToolbox                           0x00007ff826aa0413 RunCurrentEventLoopInMode + 292
	19  HIToolbox                           0x00007ff826aa5d63 ReceiveNextEventCommon + 501
	20  HIToolbox                           0x00007ff826aa6029 _BlockUntilNextEventMatchingListInModeWithFilter + 66
	21  AppKit                              0x00007ff81ec085d3 _DPSNextEvent + 902
	22  AppKit                              0x00007ff81f65b038 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1290
	23  AppKit                              0x00007ff81ebf9549 -[NSApplication run] + 610
	24  Electron Framework                  0x00000001137ec6d8 ares_dns_rr_get_name + 5985720
	25  Electron Framework                  0x00000001137ea516 ares_dns_rr_get_name + 5977078
	26  Electron Framework                  0x000000011379ebae ares_dns_rr_get_name + 5667470
	27  Electron Framework                  0x00000001137590e4 ares_dns_rr_get_name + 5382084
	28  Electron Framework                  0x00000001122a1595 _ZNK2v88internal8compiler23CompilationDependencies31FieldTypeDependencyOffTheRecordENS1_6MapRefES3_NS0_13InternalIndexENS1_9ObjectRefE + 7545061
	29  Electron Framework                  0x00000001122a2fb2 _ZNK2v88internal8compiler23CompilationDependencies31FieldTypeDependencyOffTheRecordENS1_6MapRefES3_NS0_13InternalIndexENS1_9ObjectRefE + 7551746
	30  Electron Framework                  0x000000011229ecff _ZNK2v88internal8compiler23CompilationDependencies31FieldTypeDependencyOffTheRecordENS1_6MapRefES3_NS0_13InternalIndexENS1_9ObjectRefE + 7534671
	31  Electron Framework                  0x000000010fd0c3ce _ZN2v89CodeEvent13GetScriptLineEv + 540830
	32  Electron Framework                  0x000000010fd0d3cd _ZN2v89CodeEvent13GetScriptLineEv + 544925
	33  Electron Framework                  0x000000010fd0d232 _ZN2v89CodeEvent13GetScriptLineEv + 544514
	34  Electron Framework                  0x000000010fd0bc5a _ZN2v89CodeEvent13GetScriptLineEv + 538922
	35  Electron Framework                  0x000000010fd0bd42 _ZN2v89CodeEvent13GetScriptLineEv + 539154
	36  Electron Framework                  0x000000010f95c8e5 ElectronMain + 245
	37  dyld                                0x00007ff81ae3e2cd start + 1805
)
12:27:49.621299+0100	kernel	AMFI: Denying core dump for pid 36617 (Script Kit)
12:27:49.625756+0100	chrome_crashpad_handler	[0x13000075200] activating connection: mach=true listener=false peer=false name=com.apple.cfprefsd.daemon
12:27:49.625878+0100	chrome_crashpad_handler	[0x13000075300] activating connection: mach=true listener=false peer=false name=com.apple.cfprefsd.agent
12:27:49.963720+0100	chrome_crashpad_handler	[1222/122749.963669:WARNING:crash_report_exception_handler.cc(235)] UniversalExceptionRaise: (os/kern) failure (5)
12:27:49.968571+0100	WindowManager	Connection invalidated | (36617) Script Kit
12:27:49.970647+0100	storekitagent	Connection to Script Kit[36617] invalidated
12:27:50.004386+0100	mDNSResponder	[R25328] DNSServiceCreateConnection STOP PID[36617](Script Kit)
12:27:50.006855+0100	runningboardd	[anon<Script Kit Helper (GPU)>(501):36621] termination reported by proc_exit
12:27:50.009519+0100	runningboardd	XPC connection invalidated: [xpcservice<com.apple.coremedia.videoencoder([anon<Script Kit Helper (GPU)>(501):36621])(501)>{vt hash: 0}:37778:37778]
12:27:50.011020+0100	runningboardd	[xpcservice<com.apple.coremedia.videoencoder([anon<Script Kit Helper (GPU)>(501):36621])(501)>{vt hash: 0}:37778:37778] termination reported by launchd (2, 9, 9)
12:27:50.011230+0100	runningboardd	Removing process: [xpcservice<com.apple.coremedia.videoencoder([anon<Script Kit Helper (GPU)>(501):36621])(501)>{vt hash: 0}:37778:37778]
12:27:50.011425+0100	runningboardd	removeJobWithInstance called for identity without existing job [xpcservice<com.apple.coremedia.videoencoder([anon<Script Kit Helper (GPU)>(501):36621])(501)>{vt hash: 0}:37778:37778]
12:27:50.024728+0100	runningboardd	Removing assertions for terminated process: [xpcservice<com.apple.coremedia.videoencoder([anon<Script Kit Helper (GPU)>(501):36621])(501)>{vt hash: 0}:37778:37778]
12:27:50.050870+0100	loginwindow	-[PersistentAppsSupport applicationQuit:] | for app:Script Kit, _appTrackingState = 2
12:27:50.050899+0100	loginwindow	-[PersistentAppsSupport applicationQuit:] | App: Script Kit, quit, updating active tracking timer
12:27:50.106956+0100	runningboardd	Removing process: [anon<Script Kit Helper (GPU)>(501):36621]
12:27:50.107064+0100	runningboardd	removeJobWithInstance called for identity without existing job [anon<Script Kit Helper (GPU)>(501):36621]
12:27:50.107084+0100	runningboardd	Removing assertions for terminated process: [anon<Script Kit Helper (GPU)>(501):36621]

andlang avatar Dec 22 '24 11:12 andlang