Open wojciech-kulik opened 2 years ago
Are you able to reproduce this crash with the Inspector app? Otherwise, could you come up with a sample app so I could debug the issue?
Unfortunately, I wasn't able to reproduce it :(
Does your app manipulate constraints of subviews in any way?
This issue still occurs from time to time. I don't manipulate constraints. I use this control in settings. I have main NSWindow and whenever user changes a tab I change contentViewController
. I also use setFrame
on that window.
Changing segment just hides some views.
I really want to get it fixed, but I am at a loss where to start. Just doesn't make sense that it crashes only occasionally on a static layout like this.
I understand, no worries, I know that there is not much information here. I have never experienced this issue either.
This is the latest stacktrace:
Fatal Exception: NSGenericException
0 CoreFoundation 0xf28b4 (Missing UUID a68b8c771dbd35b083fe42ad58dd6629)
1 libobjc.A.dylib 0x19eb4 (Missing UUID 1c0364b5d7e33170baa69c28f400e7cc)
2 CoreAutoLayout 0x2a070 (Missing UUID 864305e982e3397ca9012f78d8edefa4)
3 CoreAutoLayout 0x2a1e0 (Missing UUID 864305e982e3397ca9012f78d8edefa4)
4 ShortcutRecorder 0xad38 -[SRRecorderControl updateActiveConstraints] + 698 (SRRecorderControl.m:698)
5 ShortcutRecorder 0xa758 __49-[SRRecorderControl endRecordingWithObjectValue:]_block_invoke_2 + 636 (SRRecorderControl.m:636)
6 libsystem_trace.dylib 0x76d8 (Missing UUID 4af0ea7de9f430e7914dfb292edb7f37)
7 ShortcutRecorder 0xa5d0 -[SRRecorderControl endRecordingWithObjectValue:] + 636 (SRRecorderControl.m:636)
8 libsystem_trace.dylib 0x76d8 (Missing UUID 4af0ea7de9f430e7914dfb292edb7f37)
9 ShortcutRecorder 0xa464 -[SRRecorderControl endRecording] + 609 (SRRecorderControl.m:609)
10 ShortcutRecorder 0xd708 -[SRRecorderControl abortEditing] + 1313 (SRRecorderControl.m:1313)
11 AppKit 0xd44ec (Missing UUID a4e78dd16b6e3f57924a4a6a2e679789)
12 ShortcutRecorder 0x8aa8 -[SRRecorderControl dealloc] + 138 (SRRecorderControl.m:138)
13 libobjc.A.dylib 0xf418 (Missing UUID 1c0364b5d7e33170baa69c28f400e7cc)
14 libobjc.A.dylib 0xbaf0 (Missing UUID 1c0364b5d7e33170baa69c28f400e7cc)
15 CoreFoundation 0x3c57c (Missing UUID a68b8c771dbd35b083fe42ad58dd6629)
16 Foundation 0x30e88 (Missing UUID 11eb37ae355b3a35af1b13b599244410)
17 AppKit 0x2d468 (Missing UUID a4e78dd16b6e3f57924a4a6a2e679789)
18 AppKit 0x4708 (Missing UUID a4e78dd16b6e3f57924a4a6a2e679789)
19 Snippety 0x567a4 main + 53 (SnippetyApplication.swift:53)
20 ??? 0x18af49058 (Missing)
Would it be possible to add there some extra check:
4 ShortcutRecorder 0xad38 -[SRRecorderControl updateActiveConstraints] + 698 (SRRecorderControl.m:698)
5 ShortcutRecorder 0xa758 __49-[SRRecorderControl endRecordingWithObjectValue:]_block_invoke_2 + 636
It is weird because it happens based on stack trace on "endRecording" when nothing actually happens on the view. Maybe it happens when user is in "recording mode" and closes window or changes tab? But I tried it and it doesn't crash.
The crash says that you are setting constraints with some layout guide. What layout guide it is?
EDIT:
10 ShortcutRecorder 0xd708 -[SRRecorderControl abortEditing] + 1313 (SRRecorderControl.m:1313)
11 AppKit 0xd44ec (Missing UUID a4e78dd16b6e3f57924a4a6a2e679789)
12 ShortcutRecorder 0x8aa8 -[SRRecorderControl dealloc] + 138 (SRRecorderControl.m:138)
Please take a look here, it looks like it happens during deallocation. Probably the view or something is already detached but the deallocation triggers constraints update?
EDIT2: I reproduced it! 🎊 That's the case:
EDIT3: I achieved 100% reproducibility.
The solution would be probably to avoid constraints update during deallocation :) 🍺
Could you reproduce it in a sample project that you can share? Want to make sure I got it right.
Please try the issue-148 branch.
I prepared a sample project: https://github.com/wojciech-kulik/ShortcutRecorderCrash
Steps:
If you change in Podfile
branch to issue-148
, this crash is not reproducible.
@Kentzo when do you think you will be able to release your fix?
Do you need binaries or a tag would suffice?
I'm using CocoaPods. Are you able to release the new version?
First of all, thank you for this nice library, I really like it!
From time to time I get this crash from my app:
My app is targeting
macOS 11.0
and I'm using ShortcutRecorder3.3.0
. The last noticed crash was on macOS 12.5.1