sparkle-project / Sparkle

A software update framework for macOS
https://sparkle-project.org
Other
7.44k stars 1.05k forks source link

Crash @ -[SUUpdateAlert _createReleaseNotesViewPreferringPlainText:] #2653

Open fujisoft opened 1 day ago

fujisoft commented 1 day ago

Few users reported the same crash. I have no idea about the reason.

Summary

Assertion failed: (_releaseNotesSpinner != nil), function -[SUUpdateAlert _createReleaseNotesViewPreferringPlainText:], file SUUpdateAlert.m, line 312.

Crashed: com.apple.main-thread
0  libsystem_kernel.dylib         0x7d96 __pthread_kill + 10
1  libsystem_pthread.dylib        0x5ebd pthread_kill + 262
2  libsystem_c.dylib              0x7fa79 abort + 126
3  libsystem_c.dylib              0x7ed68 __assert_rtn + 312
4  Sparkle                        0x31a81 -[SUUpdatePermissionPrompt initPromptWithHost:request:reply:].cold.1 + 9105 (SUUpdatePermissionPrompt.m:9105)
5  Sparkle                        0x2d2df -[SUUpdateAlert _createReleaseNotesViewPreferringPlainText:] + 312 (SUUpdateAlert.m:312)
6  Sparkle                        0x2d5d1 -[SUUpdateAlert showUpdateReleaseNotesWithDownloadData:] + 211 (SUUpdateAlert.m:211)
7  Sparkle                        0x101e1 -[SPUStandardUserDriver showUpdateReleaseNotesWithDownloadData:] + 447 (SPUStandardUserDriver.m:447)
8  Sparkle                        0x13725 __87-[SPUUIBasedUpdateDriver basicDriverDidFindUpdateWithAppcastItem:secondaryAppcastItem:]_block_invoke.93 + 281 (SPUUIBasedUpdateDriver.m:281)
9  Sparkle                        0x12c08 -[SPUReleaseNotesDriver downloadDriverDidDownloadData:] + 58 (SPUUIBasedUpdateDriver.m:58)
10 Sparkle                        0x76b2 __66-[SPUDownloadDriver downloaderDidFinishWithTemporaryDownloadData:]_block_invoke + 223 (SPUDownloadDriver.m:223)
11 libdispatch.dylib              0x1ac6 _dispatch_call_block_and_release + 12
12 libdispatch.dylib              0x2dbc _dispatch_client_callout + 8
13 libdispatch.dylib              0xf1df _dispatch_main_queue_drain + 984
14 libdispatch.dylib              0xedf9 _dispatch_main_queue_callback_4CF + 31
15 CoreFoundation                 0xbbe46 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
16 CoreFoundation                 0x7b075 __CFRunLoopRun + 2459
17 CoreFoundation                 0x7a112 CFRunLoopRunSpecific + 557
18 HIToolbox                      0x2ea09 RunCurrentEventLoopInMode + 292
19 HIToolbox                      0x2e646 ReceiveNextEventCommon + 201
20 HIToolbox                      0x2e561 _BlockUntilNextEventMatchingListInModeWithFilter + 66
21 AppKit                         0x3f171 _DPSNextEvent + 880
22 AppKit                         0x953af0 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1273
23 AppKit                         0x30585 -[NSApplication run] + 603
24 AppKit                         0x44f3 NSApplicationMain + 816        

Possible Fix

We can replace the assertion to a if-else block or something?

Version

Sparkle version 2.6.4 macOS 14.7.0 Macmini8,1

zorgiepoo commented 1 day ago

I want to understand potential cause first.

Does your app specify SUShowReleaseNotes in Info.plist? (if so, what value do you set it as. Not a common setting except perhaps for Catalyst apps.)

Do your updates include a release notes URL (sparkle:releaseNotesLink) or a description (description)? (I am assuming sparkle:releaseNotesLink).

fujisoft commented 20 hours ago

Thank you!

Does your app specify SUShowReleaseNotes in Info.plist? (if so, what value do you set it as. Not a common setting except perhaps for Catalyst apps.)

No.

Do your updates include a release notes URL (sparkle:releaseNotesLink) or a description (description)? (I am assuming sparkle:releaseNotesLink).

The sparkle:releaseNotesLink is in our appcast. There is no description. The live appcast is here: https://update1.diskcatalogmaker.com/info/appcast/DiskCatalogMaker.xml

zorgiepoo commented 1 hour ago

The issue reproduces if the app bundle is moved while running before Sparkle's update window shows up (hence the nib is not loaded and the window is not loaded). This type of issue is pretty annoying to deal with. We can better add a check here against crashing but Sparkle will not work properly in this state (the app is running in an unsupported state).