ninxsoft / Mist

A Mac utility that automatically downloads macOS Firmwares / Installers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crashing When "Include Betas" Is Checked on Intel Monterey

PicoMitchell opened this issue · comments

commented

🪲 Description

Initially was crashing on launch after upgrading to Mist 0.8. I figured out I could cancel the load and then uncheck "Include Betas" and reload and it would load and launch properly. I believe the issue has to do with the beta icon being drawn since I was able to uncheck the Sonoma Developer Catalog and then could load the list with "Include Betas" enabled, but Mist would then crash when I scrolled down the list to where and old High Sierra beta would be displayed.

Upon further investigation I found that if I scrolled very slowly down to the High Sierra beta, the beta icon would display properly and Mist would not crash, but if I scrolled faster Mist would crash.

📋 Steps to Reproduce

  1. Open Mist.app
  2. Enable Sonoma Developer Catalog
  3. Enable "Include Betas"
  4. Select Installers tab
  5. Reload
  6. Crash

✅ Expected Behaviour

Should not crash when displaying betas in the list

💻 Environment

  • Mist version (App menu ⇨ About Mist): 0.8
  • macOS Version (sw_vers): 12.6.6 (21G646)
  • Hardware (system_profiler SPHardwareDataType):
    • Model Identifier: MacBookPro11,5

📷 Crash Log

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	    0x7ff80120cffe __pthread_kill + 10
1   libsystem_pthread.dylib       	    0x7ff8012431ff pthread_kill + 263
2   libsystem_c.dylib             	    0x7ff80118ed24 abort + 123
3   libsystem_c.dylib             	    0x7ff80118e0cb __assert_rtn + 314
4   AppKit                        	    0x7ff8045ad192 _nsis_frameInEngine + 2206
5   AppKit                        	    0x7ff803dbc20a -[NSView nsis_frameInEngine:forLayoutGuide:withRounding:] + 19
6   AppKit                        	    0x7ff803deaebf -[NSView(NSConstraintBasedLayout) _subview:valueOfVariable:didChangeInEngine:] + 194
7   AppKit                        	    0x7ff803deb014 -[NSTextField nsis_valueOfVariable:didChangeInEngine:] + 52
8   CoreAutoLayout                	    0x7ff8089d43d4 -[NSISVariableObservation emitValueIfNeededWithEngine:] + 255
9   CoreAutoLayout                	    0x7ff8089c37c4 -[NSISEngine performPendingChangeNotifications] + 311
10  AppKit                        	    0x7ff803d99a74 _NSViewLayout + 596
11  AppKit                        	    0x7ff803d99533 -[NSView _layoutSubtreeWithOldSize:] + 361
12  AppKit                        	    0x7ff803d99681 -[NSView _layoutSubtreeWithOldSize:] + 695
13  AppKit                        	    0x7ff803d99681 -[NSView _layoutSubtreeWithOldSize:] + 695
14  AppKit                        	    0x7ff803d99681 -[NSView _layoutSubtreeWithOldSize:] + 695
15  AppKit                        	    0x7ff803d99681 -[NSView _layoutSubtreeWithOldSize:] + 695
16  AppKit                        	    0x7ff803d99681 -[NSView _layoutSubtreeWithOldSize:] + 695
17  AppKit                        	    0x7ff803d99681 -[NSView _layoutSubtreeWithOldSize:] + 695
18  AppKit                        	    0x7ff803d99681 -[NSView _layoutSubtreeWithOldSize:] + 695
19  AppKit                        	    0x7ff803d99681 -[NSView _layoutSubtreeWithOldSize:] + 695
20  AppKit                        	    0x7ff803d99681 -[NSView _layoutSubtreeWithOldSize:] + 695
21  AppKit                        	    0x7ff803d99681 -[NSView _layoutSubtreeWithOldSize:] + 695
22  AppKit                        	    0x7ff803d98a45 -[NSView _layoutSubtreeIfNeededAndAllowTemporaryEngine:] + 1041
23  AppKit                        	    0x7ff803d9853d -[NSWindow(NSConstraintBasedLayout) _layoutViewTree] + 148
24  AppKit                        	    0x7ff803e0ee4d -[NSWindow(NSConstraintBasedLayout) layoutIfNeeded] + 251
25  AppKit                        	    0x7ff803e0ec8c __NSWindowGetDisplayCycleObserverForLayout_block_invoke + 430
26  AppKit                        	    0x7ff803e0df17 NSDisplayCycleObserverInvoke + 155
27  AppKit                        	    0x7ff803e0daa4 NSDisplayCycleFlush + 921
28  QuartzCore                    	    0x7ff8083bbfbe CA::Transaction::run_commit_handlers(CATransactionPhase) + 98
29  QuartzCore                    	    0x7ff8083bacdc CA::Transaction::commit() + 376
30  AppKit                        	    0x7ff803eaf191 __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 285
31  AppKit                        	    0x7ff8045f6f1c ___NSRunLoopObserverCreateWithHandler_block_invoke + 41
32  CoreFoundation                	    0x7ff801309500 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
33  CoreFoundation                	    0x7ff801309392 __CFRunLoopDoObservers + 543
34  CoreFoundation                	    0x7ff801308824 __CFRunLoopRun + 840
35  CoreFoundation                	    0x7ff801307e1c CFRunLoopRunSpecific + 562
36  HIToolbox                     	    0x7ff809fb85e6 RunCurrentEventLoopInMode + 292
37  HIToolbox                     	    0x7ff809fb834a ReceiveNextEventCommon + 594
38  HIToolbox                     	    0x7ff809fb80e5 _BlockUntilNextEventMatchingListInModeWithFilter + 70
39  AppKit                        	    0x7ff803d42f6d _DPSNextEvent + 927
40  AppKit                        	    0x7ff803d4162a -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1394
41  AppKit                        	    0x7ff803d33cd9 -[NSApplication run] + 586
42  AppKit                        	    0x7ff803d07c57 NSApplicationMain + 817
43  SwiftUI                       	    0x7ff90c85009c specialized runApp(_:) + 161
44  SwiftUI                       	    0x7ff90d2b2424 runApp<A>(_:) + 164
45  SwiftUI                       	    0x7ff90cdaac5f static App.main() + 63
46  Mist                          	       0x102b9f246 0x102b07000 + 623174
47  dyld                          	       0x109c3052e start + 462
commented

This happens to me as well. But instead of betas I selected "Public".

Is there a way to reset the app?

Deleting the prefs .plist didn't help.

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               Mist [792]
Path:                  /Users/USER/Desktop/*/Mist.app/Contents/MacOS/Mist
Identifier:            com.ninxsoft.mist
Version:               0.8.1 (0.8.1)
Code Type:             X86-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2023-06-15 22:31:15.8142 +0200
OS Version:            macOS 12.6.7 (21G708)
Report Version:        12
System Integrity Protection: enabled

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

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	    0x7ff80db1effe __pthread_kill + 10
1   libsystem_pthread.dylib       	    0x7ff80db551ff pthread_kill + 263
2   libsystem_c.dylib             	    0x7ff80daa0d24 abort + 123
3   libsystem_c.dylib             	    0x7ff80daa00cb __assert_rtn + 314
4   AppKit                        	    0x7ff810ebf192 _nsis_frameInEngine + 2206
5   AppKit                        	    0x7ff8106ce20a -[NSView nsis_frameInEngine:forLayoutGuide:withRounding:] + 19
6   AppKit                        	    0x7ff8106fcebf -[NSView(NSConstraintBasedLayout) _subview:valueOfVariable:didChangeInEngine:] + 194
7   AppKit                        	    0x7ff8106fd014 -[NSTextField nsis_valueOfVariable:didChangeInEngine:] + 52
8   CoreAutoLayout                	    0x7ff8152e63d4 -[NSISVariableObservation emitValueIfNeededWithEngine:] + 255
9   CoreAutoLayout                	    0x7ff8152d57c4 -[NSISEngine performPendingChangeNotifications] + 311
10  AppKit                        	    0x7ff8106aba74 _NSViewLayout + 596
11  AppKit                        	    0x7ff8106ab533 -[NSView _layoutSubtreeWithOldSize:] + 361
12  AppKit                        	    0x7ff8106ab681 -[NSView _layoutSubtreeWithOldSize:] + 695
13  AppKit                        	    0x7ff8106ab681 -[NSView _layoutSubtreeWithOldSize:] + 695
14  AppKit                        	    0x7ff8106ab681 -[NSView _layoutSubtreeWithOldSize:] + 695
15  AppKit                        	    0x7ff8106ab681 -[NSView _layoutSubtreeWithOldSize:] + 695
16  AppKit                        	    0x7ff8106ab681 -[NSView _layoutSubtreeWithOldSize:] + 695
17  AppKit                        	    0x7ff8106ab681 -[NSView _layoutSubtreeWithOldSize:] + 695
18  AppKit                        	    0x7ff8106ab681 -[NSView _layoutSubtreeWithOldSize:] + 695
19  AppKit                        	    0x7ff8106ab681 -[NSView _layoutSubtreeWithOldSize:] + 695
20  AppKit                        	    0x7ff8106ab681 -[NSView _layoutSubtreeWithOldSize:] + 695
21  AppKit                        	    0x7ff8106ab681 -[NSView _layoutSubtreeWithOldSize:] + 695
22  AppKit                        	    0x7ff8106aaa45 -[NSView _layoutSubtreeIfNeededAndAllowTemporaryEngine:] + 1041
23  AppKit                        	    0x7ff8106aa53d -[NSWindow(NSConstraintBasedLayout) _layoutViewTree] + 148
24  AppKit                        	    0x7ff810720e4d -[NSWindow(NSConstraintBasedLayout) layoutIfNeeded] + 251
25  AppKit                        	    0x7ff810720c8c __NSWindowGetDisplayCycleObserverForLayout_block_invoke + 430
26  AppKit                        	    0x7ff81071ff17 NSDisplayCycleObserverInvoke + 155
27  AppKit                        	    0x7ff81071faa4 NSDisplayCycleFlush + 921
28  QuartzCore                    	    0x7ff814ccdfbe CA::Transaction::run_commit_handlers(CATransactionPhase) + 98
29  QuartzCore                    	    0x7ff814ccccdc CA::Transaction::commit() + 376
30  AppKit                        	    0x7ff8107c1191 __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 285
31  AppKit                        	    0x7ff810f08f1c ___NSRunLoopObserverCreateWithHandler_block_invoke + 41
32  CoreFoundation                	    0x7ff80dc1b500 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
33  CoreFoundation                	    0x7ff80dc1b392 __CFRunLoopDoObservers + 543
34  CoreFoundation                	    0x7ff80dc1a824 __CFRunLoopRun + 840
35  CoreFoundation                	    0x7ff80dc19e1c CFRunLoopRunSpecific + 562
36  HIToolbox                     	    0x7ff8168ca5e6 RunCurrentEventLoopInMode + 292
37  HIToolbox                     	    0x7ff8168ca34a ReceiveNextEventCommon + 594
38  HIToolbox                     	    0x7ff8168ca0e5 _BlockUntilNextEventMatchingListInModeWithFilter + 70
39  AppKit                        	    0x7ff810654f6d _DPSNextEvent + 927
40  AppKit                        	    0x7ff81065362a -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1394
41  AppKit                        	    0x7ff810645cd9 -[NSApplication run] + 586
42  AppKit                        	    0x7ff810619c57 NSApplicationMain + 817
43  SwiftUI                       	    0x7ff91916209c specialized runApp(_:) + 161
44  SwiftUI                       	    0x7ff919bc4424 runApp<A>(_:) + 164
45  SwiftUI                       	    0x7ff9196bcc5f static App.main() + 63
46  Mist                          	       0x100a29256 0x100991000 + 623190
47  dyld                          	       0x10441352e start + 462

commented

If you click the "Cancel" button before Mist is done loading, you can edit prefs etc as needed to not load any betas and then reload and it should not crash, but you just can't view betas in the list.

commented

If you click the "Cancel" button before Mist is done loading, you can edit prefs etc as needed to not load any betas and then reload and it should not crash, but you just can't view betas in the list.

This maybe works for ipsw's but the Intel installers section is empty… and then it crashes anyway…

commented

Is "Included Betas" uncheck and only "Standard" catalogs selected on the prefs? I'm able to load the Installers tab with those settings.

commented

As soon as I change ANY setting it crashes.

I even changed the settings in the preferences plist file itself with a plist editor. But as soon as the app launches the old settings are restored and then it crahes.

commented

Maybe you've run into a slightly different bug that I did, or maybe the same bug is manifesting itself in a different way.

As an aside, preferences plists should not ever really be edited directly, so it's not surprising that isn't working properly. The values are cached and synced through cfprefsd.

commented

After fully uninstalling the App with AppCleaner and reinstalling it, the settings are reversed to default so now I can continue. But I won't enable the extra features now but there's definitely a bug. And a Monterey only bug, I believe.

I am creating the Beta tag on-the-fly, via what I call a TextRibbon:

struct TextRibbon: View {
var title: String
var length: CGFloat
private let degrees: CGFloat = -45
var body: some View {
Text(title)
.foregroundColor(.white)
.frame(width: length)
.background(Color.accentColor)
.rotationEffect(.degrees(degrees))
.mask(Circle().frame(width: length, height: length))
}
}

I suspect either the rotation or mask could be causing the weirdness on macOS Monterey 12 - will continue testing to see if I can replicate (via VM).

As a last resort I can export the SwiftUI view as an image and just overlay instead of computing dynamically...

Confirming I am able to replicate the issue (in a VM):

Crash

commented

Hi.

On Laptop MBP10,2 Monterey 12.6.8, Mist V0.8 and V0.8.1 crash with "Include betas" checked and 0.7.1 don't do.
So i remove installed V0.8.1, test V0.8 and remove it, install V0.7.1, the previous installed working version was V0.5.
V0.7.1 work fine (Beta Sonoma is shown)

Capture d’écran 2023-06-21 à 16 54 36

Pbm between Bump V0.7.1 and Bump V0.8

Capture d’écran 2023-06-21 à 17 26 41

Regards

Finally had a chance to fire up a macOS Monterey 12 development environment - this is the error I get when attempting to run via Xcode:

validateComputeFunctionArguments:827: failed assertion `Compute Function(ciKernelMain): reads texture (image.coerce[1]) whose usage (0x00) doesn't specify MTLTextureUsageShaderRead (0x01)'

Interestingly enough, disabling Metal API Validation in the Xcode project scheme seems to make the crash go away:

Metal API Validation

Will continue to investigate... 🤔

From what I can ascertain, the issue started somewhere between version 0.7.1 and 0.8 (commits edcf8f5 and c781198):

https://github.com/ninxsoft/Mist/compare/edcf8f5..c781198

20 commits, time to start narrowing down the root cause 😤

2c6f2e3 seems to be the culprit - building and running d9b1977 (prior commit) seems to work fine on macOS Monterey 12, whereas 2c6f2e3 is crashing when the list / beta ribbons scroll into view.

Note: The beta ribbon was introduced in a build previous to both mentioned above, so will keep digging into 2c6f2e3 to narrow down further

I have isolated the issue to the .rotationEffect() modifier on the "Beta" TextRibbon:

var body: some View {
Text(title)
.foregroundColor(.white)
.frame(width: length)
.background(Color.accentColor)
.rotationEffect(.degrees(degrees))
.mask(Circle().frame(width: length, height: length))
}

The 45° rotation works fine on macOS Ventura 13 and later, but crashes on macOS Monterey 12

Since it's purely cosmetic, the simplest fix might just be not to rotate on macOS Monterey 12

Aha! Mist also crashes on macOS Ventura 13 and later when you click on the rotated Beta text ribbon, so I might just do away with the 45° .rotationEffect() modifier altogether 🤔

commented

I's eye-candy anyway, isn't it?

commented

@ninxsoft Hi.

macOS Monterey 12.6.8 and a local Mist V0.8.1 build (.rotationEffect() deactivated): no more crash

Capture d’écran 2023-06-24 à 10 43 30

Capture d’écran 2023-06-24 à 10 26 08

Regards

@matxpa thanks for helping confirm!

@5T33Z0 correct, just eye candy. I think it's just smarter / safer to remove the rotation altogether 👍

Will update the codebase + create a new release soon 🙌

commented

Curiously, I tried to change the value on the code line
" private let degrees: CGFloat =" and to
-95 ----> no crash
45 ----> (ie +45) crash
-50 ----> no crash
and .rotationEffect(.degrees(degrees)) (reactivated)

PS : my local V0.8.1 repo is up to date (f215031 commit)

No crash when using a value really close to 45, eg. private let degrees: CGFloat = -45.1 🥳

I suspect there's something like a dividing by zero error occurring under the hood for certain integer values.

commented

Other tests

  1. degrees = -50 ---> no crash
    Capture d’écran 2023-06-24 à 11 18 32
  2. degrees = -25 ---> no crash
    Capture d’écran 2023-06-24 à 11 19 57
  3. degrees = -40 ---> no crash
    Capture d’écran 2023-06-24 à 11 21 10
  4. degrees = -44 ---> no crash
    Capture d’écran 2023-06-24 à 11 22 29
  5. degrees = -46 ---> no crash
    Capture d’écran 2023-06-24 à 11 23 49
  6. degrees = -45 ---> CRASH
    Capture d’écran 2023-06-24 à 11 30 08
commented

45 degrees rotation --> crash

90 degrees rotation --> no crash Capture d’écran 2023-06-24 à 12 11 41

135 degrees rotation --> crash

180 degrees rotation --> no crash Capture d’écran 2023-06-24 à 12 15 06

So, on local repo I keep rotation with 45.1 degrees

Thanks for confirming!

commented

@ninxsoft
Mist 0.8.1 with latest commit (e3a6d93) local build work fine with Monterey 12.6.8 (beta)

With Mist 0.8.1 (your last week build with commit b1dd347) on Ventura 13.5 (beta) on Sonoma 14.0 beta2 work (no crashes with 45 degrees rotation)

And just F.Y.I
I tried to build Mist with latest commit (e3a6d93) on Sonoma 14.0 beta2 and Xcode 15.0.0 Beta
3 errors on Mist/Helpers/DownloadManager.swift on code lignes 90, 92 and 101

...
retries += 1
--> error task = URLSession.shared.downloadTask(withResumeData: data, completionHandler: completionHandler)
} else {
--> error task = URLSession.shared.downloadTask(with: url, completionHandler: completionHandler)
}

        if let task: URLSessionDownloadTask = task {
            progress = task.progress
        }

        urlError = nil
        task?.resume()

--> error semaphore.wait()
...

Regards

These are warnings, not errors, but yes, they will be looked at prior to Swift 6 being released. Thanks!

commented

Hi @ninxsoft

It seems "var degree" with 'Double' declaration and value (+/- 45) don't crash

like this little test (text is button), each time button is pressed the text rotates with 45°

import SwiftUI

struct ImageOverlay: View {
@State private var angle: Double = 0
var body: some View {
ZStack {
Button("BETA, Press here !") { angle -= 45 }
.font(.largeTitle)
.foregroundColor(.black)
}//.background(Color.black)
.opacity(1)
.rotationEffect(.degrees(angle))
.animation(.spring(), value: angle)
}
}

struct ContentView: View {
var body: some View {
VStack {
Image("macOS Sonoma")
.imageScale(.large)
.overlay(ImageOverlay(),alignment: .center)
Spacer()
}
}
}

Capture d’écran 2023-06-27 à 18 32 08

Regards