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.
This appears to be a bug in kirigami.
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()?
(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
I do not experience this issue, potentially it is a difference with Qt versions? I am using 6.6
(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?
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
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
This is fixed now on master, but we need to wait until the next KF release until it can be packaged...