Bug 481531 - Angelfish crashes at startup
Summary: Angelfish crashes at startup
Status: RESOLVED FIXED
Alias: None
Product: angelfish
Classification: Applications
Component: general (show other bugs)
Version: 24.01.95
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Jonah Brüchert
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-02-19 02:43 UTC by Kotori Itsuka
Modified: 2024-03-06 01:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Backtrace of crash (11.73 KB, text/plain)
2024-02-19 02:43 UTC, Kotori Itsuka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kotori Itsuka 2024-02-19 02:43:02 UTC
Created attachment 165933 [details]
Backtrace of crash

SUMMARY
angelfish crashes at startup

STEPS TO REPRODUCE
1. Run angelfish

OBSERVED RESULT
angelfish crashes

EXPECTED RESULT
angelfish runs

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.93.0
KDE Frameworks Version: 5.249.0
Qt Version: 6.7.0
Kernel Version: 6.7.4-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 2700X Eight-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 6500 XT

ADDITIONAL INFORMATION
std::clamp throws while qMax(min, qMin(val, max)) does not.
Comment 1 Kotori Itsuka 2024-02-19 02:57:16 UTC
This appears to be a bug in kirigami.
Comment 2 fanzhuyifan 2024-02-19 05:06:09 UTC
This line:

                const qreal pageX = std::clamp(partialWidth, -x(), -x() + m_view->width() - child->width());

https://invent.kde.org/frameworks/kirigami/-/blob/master/src/columnview.cpp?ref_type=heads#L529

For some reason -x() > -x() + m_view->width() - child->width(). Any chance you could get gdb to print out x(), m_view->width(), and child->width()?
Comment 3 Kotori Itsuka 2024-02-19 10:25:16 UTC
(gdb) f 7
#7  ContentItem::layoutItems (this=0x55555688b8e0) at /usr/src/debug/kirigami/kirigami-5.249.0/src/columnview.cpp:529
529                     const qreal pageX = std::clamp(partialWidth, -x(), -x() + m_view->width() - child->width());                             
(gdb) print partialWidth
$1 = 0
(gdb) print x()
$2 = 0
(gdb) print m_view->width()
$3 = 0
(gdb) print child->width()
$4 = 361
Comment 4 Devin Lin 2024-03-01 14:34:39 UTC
I do not experience this issue, potentially it is a difference with Qt versions?

I am using 6.6
Comment 5 Antonio Rojas 2024-03-01 15:45:07 UTC
(In reply to Devin Lin from comment #4)
> I do not experience this issue, potentially it is a difference with Qt
> versions?
> 
> I am using 6.6

This is an assert, is your package compiled with c++ assertions?
Comment 6 Devin Lin 2024-03-01 16:23:43 UTC
You're right, it looks like it's an issue when compiled with assertions enabled.

I opened an MR to add a bounds check, hopefully kirigami devs will chime in whether this situation is a symptom of a larger issue: https://invent.kde.org/frameworks/kirigami/-/merge_requests/1478
Comment 7 Devin Lin 2024-03-05 13:23:32 UTC
Git commit 9eaf9709cbbb1c179981b6060ad1c9837c96b9f1 by Devin Lin.
Committed on 05/03/2024 at 13:22.
Pushed by devinlin into branch 'master'.

ColumnView: Add check args to clamp

Otherwise the program crashes if assertions are enabled due to bounds checking.

It seems it is possible for m_view->width() = 0 while child->width() > 0.

See https://bugs.kde.org/show_bug.cgi?id=481531

M  +2    -1    src/columnview.cpp

https://invent.kde.org/frameworks/kirigami/-/commit/9eaf9709cbbb1c179981b6060ad1c9837c96b9f1
Comment 8 Devin Lin 2024-03-06 01:16:17 UTC
This is fixed now on master, but we need to wait until the next KF release until it can be packaged...