kit icon indicating copy to clipboard operation
kit copied to clipboard

Kit crashing when removing a script using the UI

Open edjw opened this issue 2 years ago • 17 comments

macOS Monterey Version 12.4

MacBook Air (M1, 2020) Script Kit 1.20.5 (Apple silicon)

When I use the Kit UI to remove a script, Kit crashes with no logs. I would expect it to remove the script file from the file system and therefore for the script to not be selectable in the UI any more.

https://user-images.githubusercontent.com/6547979/178587899-233ae1e3-8c43-48c4-8f33-c7456c56b5ef.mp4

edjw avatar Jul 12 '22 20:07 edjw

Does that only happen when removing that specific script (looks like a duplicated corgi script)?

Can you make a "Testing Remove Script" then just delete it?

johnlindquist avatar Jul 12 '22 21:07 johnlindquist

I'm seeing the same thing when deleting a kenv too

https://user-images.githubusercontent.com/6547979/178599432-ea73acb1-d2a1-4726-a518-38ca94511f56.mp4

.

edjw avatar Jul 12 '22 21:07 edjw

Thanks for taking a look at this :-)

Screenrecording of making the test script from scratch and trying to delete it. You'll notice that the 'test' kenv was not actually deleted when I tried to delete it in the previous one

https://user-images.githubusercontent.com/6547979/178599697-4e139044-5bbc-4a03-8fdb-d94d6efaa931.mp4

edjw avatar Jul 12 '22 21:07 edjw

I recently refactored how Kit.app watches for file changes. I'm guessing the "unlink" event isn't being handled properly. I'll dig into it tomorrow (AFK today). Really hoping I can reproduce 😅.

johnlindquist avatar Jul 12 '22 21:07 johnlindquist

Brilliant. Thanks very much. Yeah sorry I can't do much else to help you reproduce

edjw avatar Jul 12 '22 22:07 edjw

This is also a problem I'm having on the Intel MBP. I'm removing the scripts from the filesystem as an alternative.

BTW - amazing product....really enjoying using it!!

JayAchar avatar Aug 03 '22 11:08 JayAchar

@JayAchar Are you familiar with using the osx preferences->security & privacy->files and folders?

Could you see if Kit.app is listed there? Enable it, then try removing a script again?

johnlindquist avatar Aug 03 '22 12:08 johnlindquist

Seems to have access to ~/Documents but not full disk access. Is that required?

image

JayAchar avatar Aug 03 '22 12:08 JayAchar

It shouldn't be. It's ~/.kenv, so I thought that might be in the list.

I'll investigate too. I was just thinking about how silent crashes are often due to hitting a security wall and osx/the app never log anything. I've given Kit.app access to everything on my personal machine 😬 so the idea fits and would be explain how I've missed it.

johnlindquist avatar Aug 03 '22 12:08 johnlindquist

I'm experiencing this in v1.20.5. Here's an excerpt from the crash report in Console.app. Let me know if there's anything else I can do.

Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0   Electron Framework            	       0x10c258508 node::FreeArrayBufferAllocator(node::ArrayBufferAllocator*) + 296136
1   Electron Framework            	       0x10c258508 node::FreeArrayBufferAllocator(node::ArrayBufferAllocator*) + 296136
2   CoreFoundation                	       0x1aec3eddc __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 28
3   CoreFoundation                	       0x1aece3578 ___CFXRegistrationPost_block_invoke + 52
4   CoreFoundation                	       0x1aece34e4 _CFXRegistrationPost + 456
5   CoreFoundation                	       0x1aec0da74 _CFXNotificationPost + 732
6   Foundation                    	       0x1afacae48 -[NSNotificationCenter postNotificationName:object:userInfo:] + 96
7   AppKit                        	       0x1b204e324 -[NSWindow _finishClosingWindow] + 144
8   AppKit                        	       0x1b1ac07fc -[NSWindow _close] + 344
9   Electron Framework            	       0x10c24bf9c node::FreeArrayBufferAllocator(node::ArrayBufferAllocator*) + 245596
10  Electron Framework            	       0x10c1e8938 v8::CodeEvent::GetScriptName() + 5528
11  Electron Framework            	       0x10c18b8a4 v8::CpuProfileNode::GetNodeId() const + 73236
12  Electron Framework            	       0x10c0ebc30 v8::internal::ProfilerListener::~ProfilerListener() + 12460
13  Electron Framework            	       0x10c0ebb54 v8::internal::ProfilerListener::~ProfilerListener() + 12240
14  Electron Framework            	       0x10ceffe48 v8::internal::Accessors::MakeAccessor(v8::internal::Isolate*, 

AntonNiklasson avatar Aug 08 '22 13:08 AntonNiklasson

I've got a fix ready for the release later this week.

johnlindquist avatar Aug 08 '22 14:08 johnlindquist

Are older versions available to download anywhere?

AntonNiklasson avatar Aug 09 '22 13:08 AntonNiklasson

Give me ~1 hour and I'll post a preview build of the next version in this thread. (Downloading an older version would just trigger the auto-update)

johnlindquist avatar Aug 09 '22 14:08 johnlindquist

@AntonNiklasson

Here's today's nightly build. Still a few minor things to work out, but should be able to finalize it by this weekend:

m1: https://drive.google.com/file/d/1HV64M71nb4uEmLYwf_Isw7rEHLe-4CM1/view?usp=sharing Intel: https://drive.google.com/file/d/1YsyCKAHmE3EX07IAhgsZBTzhl2tNYCEr/view?usp=sharing

johnlindquist avatar Aug 09 '22 19:08 johnlindquist

Thanks a lot, John! Works great so far for me 🙌

AntonNiklasson avatar Aug 11 '22 06:08 AntonNiklasson

Awesome, just ran into this one. can't wait for the fix ;-)

joelgrimberg avatar Sep 20 '22 20:09 joelgrimberg

Yikes, I marked this as done in my todoist after posting the preview build 😅

I'm pushing to get the big, bad September build out asap

johnlindquist avatar Sep 20 '22 21:09 johnlindquist