ViennaRSS / vienna-rss

Vienna is a free and open-source RSS/Atom newsreader for macOS.
https://www.vienna-rss.com
Apache License 2.0
1.84k stars 228 forks source link

3.8.0b3: crash when trying to view a smart folder #1559

Closed phiw13 closed 2 years ago

phiw13 commented 2 years ago

what the headline says: 3.8.0b3: crash when trying to view a smart folder

To Reproduce

log attached below

Please complete the following information:

Additional information: In which version of Vienna does the problem not occur, if applicable.

Vienna-2022-05-16-130739.ips.zip

michbsd commented 2 years ago

Seeing the same.. and not only on smart folders.

This is the crash error:

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString numericCompare:]: unrecognized selector sent to instance 0x6000031f0800'
abort() called
terminating with uncaught exception of type NSException
phiw13 commented 2 years ago

I found one feed that is causing crashes (clicking on that one in the feed list, or its enclosing folder crashes the browser).

https://orientxxi.info/?page=backend&lang=fr – I have 2 unread articles for this one.

sbondorf commented 2 years ago

Same here, but on startup. I see the main window for a brief moment, without content, then it crashes.

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString numericCompare:]: unrecognized selector sent to instance 0x6000029c6f40'
abort() called
terminating with uncaught exception of type NSException
Eitot commented 2 years ago

I will have a look. I am not seeing anything in the logs so far, but I’ll try to reproduce it with the feed above.

Eitot commented 2 years ago

The crash happens here: -[ArticleController sortArticles]. The problem appears to be invalid data in the ArticleSortDescriptors array which is responsible for storing the article sorting options in the View menu → Sort. If a value had been stored before then a crash upon start happens. There were some changes there in beta 3 to replace the NSArchiver/NSUnarchiver APIs.

You can mitigate this with this command

defaults delete uk.co.opencommunity.vienna2 ArticleListSortOrders

and then keep the default sorting to avoid crashes during while using the beta.

sbondorf commented 2 years ago

Worked for me, thanks!

Another detail that I now remember and that indicates I experienced this problem: after downgrading to beta 2, my articles weren't sorted ascending by date anymore.

Eitot commented 2 years ago

Worked for me, thanks!

Another detail that I now remember and that indicates I experienced this problem: after downgrading to beta 2, my articles weren't sorted ascending by date anymore.

That’s unfortunately necessary, because NSArchiver/NSUnarchiver are old formats that aren’t compatible with any of their replacements that Vienna now uses (#1525). It was not possible to simply reuse the same preference for this, since it would have resulted in crashes in the older versions of Vienna.

phiw13 commented 2 years ago

after upgrading again to beta3 I immediately quit Vienna and then tried the defaults delete command.

Domain (uk.co.opencommunity.vienna2) not found.
Defaults have not been changed.

That particular preference did not appear to exist :-(. I then deleted the plist – Vienna’s prefs are not hard at all to reset and restarted Vienna. Since then I have not yet experienced any of these crashes.

Like @sbondorf I had to reset the sort order after downgrading. Anyway, at the moment all seems well. Feeds and smart folders that caused crashes yesterday now display as expected.

Eitot commented 2 years ago

I've identified the issue and submitted a fix.

The problem only appears if you sort articles by subject. Since Vienna also stores previous sort orders, the issue can also appear if at one point you used that sort order and it is still recorded in the user defaults.

The above advice I gave is the only mitigation currently until the next build.