Bug 504195 - Kirigami WheelHandler crash: std::clamp assertion fails due to invalid scroll range
Summary: Kirigami WheelHandler crash: std::clamp assertion fails due to invalid scroll...
Status: RESOLVED DUPLICATE of bug 503703
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 6.14.0
Platform: Other Linux
: NOR crash
Target Milestone: Not decided
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-14 06:38 UTC by keirofps
Modified: 2025-05-14 06:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Backtrace if the pastebin doesnt work (38.06 KB, text/plain)
2025-05-14 06:39 UTC, keirofps
Details

Note You need to log in before you can comment on or make changes to this bug.
Description keirofps 2025-05-14 06:38:41 UTC
Backtrace log: https://pastebin.com/SPhyhZHY

SUMMARY
When using scroll wheel in system settings, the application crashes with a std::clamp assertion failure triggered in Kirigami's WheelHandler::scrollFlickable() method.

This appears to be caused by std::clamp() being called with an invalid range (__hi < __lo)

STEPS TO REPRODUCE
1. Launch system settings
2. Use scroll wheel
3. Crashes app

OBSERVED RESULT
/usr/include/c++/15.1.1/bits/stl_algo.h:3638: constexpr const _Tp& std::clamp(const _Tp&, const _Tp&, const _Tp&) [with _Tp = int]: Assertion '!(__hi < __lo)' failed.
Backtrace: #7  operator() (__closure=..., oldPos=-0, newPos=60, stepSize=60, property="contentY", animation=...)
    at kirigami/src/wheelhandler.cpp:528
#8  WheelHandler::scrollFlickable (this=0x555555e7f040, pixelDelta=..., angleDelta=..., modifiers=...)
    at kirigami/src/wheelhandler.cpp:548
std::clamp(oldPos, newPos, stepSize);  // invalid: __hi < __lo


EXPECTED RESULT
Scroll wheel scrolling up and down without crash.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Garuda Mokka
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0

ADDITIONAL INFORMATION
Distro: Garuda Mokka
Kernel: 6.14.6-zen1-1-zen (64-bit)
Comment 1 keirofps 2025-05-14 06:39:13 UTC
Created attachment 181271 [details]
Backtrace if the pastebin doesnt work
Comment 2 Antonio Rojas 2025-05-14 06:40:15 UTC

*** This bug has been marked as a duplicate of bug 503703 ***