Bug 495961

Summary: Segfault on startup
Product: [Applications] kasts Reporter: lencho
Component: generalAssignee: bart
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version First Reported In: 24.08.3   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description lencho 2024-11-08 10:49:11 UTC
SUMMARY
Segfault on startup, due to empty feed?

OBSERVED RESULT
After adding a new (working, non empty!) feed and downloading some podacasts, closing the application and trying to start it up again, it just crashes.
Error in Konsole:
```
Failed to load feed ""
zsh: segmentation fault (core dumped)  kasts
```
Running with gdb:
```
Failed to load feed ""                                                                                                                                            
Thread 1 "kasts" received signal SIGSEGV, Segmentation fault.
0x0000555555685334 in ?? ()
```
Also, before the actual crash, some QML warnings, but probably irrelevant for the crash:
```
qrc:/qt/qml/org/kde/kirigami/dialogs/Dialog.qml:344:18: QML ScrollView: Binding loop detected for property "calculatedImplicitHeight"                             
qrc:/qt/qml/org/kde/kirigami/dialogs/Dialog.qml:344:18: QML ScrollView: Binding loop detected for property "calculatedImplicitWidth"
qrc:/qt/qml/org/kde/kirigami/dialogs/Dialog.qml:344:18: QML ScrollView: Binding loop detected for property "calculatedImplicitHeight"
qrc:/qt/qml/org/kde/kirigami/dialogs/Dialog.qml:401:33: QML Binding: Binding loop detected for property "value"
qrc:/qt/qml/org/kde/kirigami/dialogs/Dialog.qml:401:33: QML Binding: Binding loop detected for property "value"
qrc:/qt/qml/org/kde/kirigami/dialogs/Dialog.qml:344:18: QML ScrollView: Binding loop detected for property "calculatedImplicitHeight"
qrc:/qt/qml/org/kde/kirigami/dialogs/Dialog.qml:401:33: QML Binding: Binding loop detected for property "value"
qrc:/qt/qml/org/kde/kirigami/dialogs/Dialog.qml:344:18: QML ScrollView: Binding loop detected for property "calculatedImplicitHeight"
qrc:/qt/qml/org/kde/kirigami/dialogs/Dialog.qml:401:33: QML Binding: Binding loop detected for property "value"
```

I'd like to check the feeds DB to see what is wrong, but don't know where it is saved.

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.11.2-4-MANJARO (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 3600X 6-Core Processor
Memory: 15.5 Gio of RAM
Graphics Processor: NVIDIA GeForce GTX 1660 SUPER/PCIe/SSE2
Comment 1 bart 2024-11-08 13:04:39 UTC
The database is in ~/.local/share/KDE/kasts/database.db3 for distro-packaged versions.
For flatpak it's in something like ~/.var/app/org.kde.kasts/data/KDE/kasts/database.db3

It sounds like remove the incorrect (empty) podcast from the feeds table might solve the issue.

Let me see if I can build in a test to remove any lingering empty feed entries at app startup.
Comment 2 lencho 2024-11-08 13:21:04 UTC
Thanks,
Do you want me to send you the DB to check?
I can open it with DB Browser, but I'm not sure what I'm looking for. There does not seem to be a "feed" entry that is empty.
Comment 3 bart 2024-11-08 13:30:47 UTC
If you feel comfortable sharing that file, you can email it to me directly.  (That file contains all your podcast and episode statuses, so you might not want to upload it here.)
That should allow me to reproduce the issue.
Comment 4 bart 2024-11-10 17:36:58 UTC
Git commit aa9bbc1bdb25da727ecc92bb92b0b2d9e18752a9 by Bart De Vries.
Committed on 10/11/2024 at 17:34.
Pushed by bdevries into branch 'master'.

On startup, remove feed entries with empty URL on startup

This should never happen, but occasionally did when something went wrong
while adding a new feed, e.g. a crash.  This would then cause a segfault
on startup.

M  +6    -1    src/database.cpp

https://invent.kde.org/multimedia/kasts/-/commit/aa9bbc1bdb25da727ecc92bb92b0b2d9e18752a9
Comment 5 bart 2024-11-12 09:18:11 UTC
Git commit 170e4a48802fb8979eee7f37d6d3d0cdd90c4cce by Bart De Vries.
Committed on 12/11/2024 at 09:17.
Pushed by bdevries into branch 'release/24.12'.

On startup, remove feed entries with empty URL on startup

This should never happen, but occasionally did when something went wrong
while adding a new feed, e.g. a crash.  This would then cause a segfault
on startup.

M  +6    -1    src/database.cpp

https://invent.kde.org/multimedia/kasts/-/commit/170e4a48802fb8979eee7f37d6d3d0cdd90c4cce