| Summary: | KCalc segfault, index out of bounds in KCalculator::commit_Input_ | ||
|---|---|---|---|
| Product: | [Applications] kcalc | Reporter: | LaughingMan <lingm+kdebugs> |
| Component: | general | Assignee: | Gabriel Barrantes <gabriel.barrantes.dev> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | gabriel.barrantes.dev, olib141 |
| Priority: | NOR | ||
| Version First Reported In: | 24.05.2 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/utilities/kcalc/-/commit/4776dc3cd662bf704480a0e02cd7a74fdff516db | Version Fixed/Implemented In: | |
| Sentry Crash Report: | https://crash-reports.kde.org/organizations/kde/issues/44094/?project=739 | ||
| Attachments: | Backtrace | ||
|
Description
LaughingMan
2024-08-05 20:28:16 UTC
i could not reproduce it, however I think it can be related to: https://invent.kde.org/utilities/kcalc/-/merge_requests/99 that is already fixed on the next version (24.08) so for now I will leave it as confirmed but shouldn't be a problem. Tested a bit more. It takes a few tries but reproduction steps are:
1. Open KCalc
2. Either type "(" on the keyboard or click the "(" button.
3. Segfault
Reproduces ~50% of the time with the keyboard and ~20% of the time when clicking the button with the mouse.
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kcalc/-/merge_requests/138 (In reply to LaughingMan from comment #2) > Tested a bit more. It takes a few tries but reproduction steps are: > 1. Open KCalc > 2. Either type "(" on the keyboard or click the "(" button. > 3. Segfault > > Reproduces ~50% of the time with the keyboard and ~20% of the time when > clicking the button with the mouse. UB, quite hard to reach for sure, great catch. Git commit 4776dc3cd662bf704480a0e02cd7a74fdff516db by Gabriel Barrantes. Committed on 06/08/2024 at 20:05. Pushed by gabrielbarrantes into branch 'master'. Set error Index for edge cases Set error index to last token as a workaround for cases that escape initial error parsing. This does not sets the exact index where the error is located but for now avoids unexpected seg-fault erros. M +5 -0 kcalc_core.cpp https://invent.kde.org/utilities/kcalc/-/commit/4776dc3cd662bf704480a0e02cd7a74fdff516db > UB, quite hard to reach for sure, great catch.
Thanks for the quick fix!
|