Bug 444405 - Okteta crashes after using the Strings tool and switching files
Summary: Okteta crashes after using the Strings tool and switching files
Status: RESOLVED FIXED
Alias: None
Product: okteta
Classification: Applications
Component: general (show other bugs)
Version: 0.26.6
Platform: Neon Linux
: NOR crash
Target Milestone: ---
Assignee: Friedrich W. H. Kossebau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-26 05:06 UTC by Nagy Tibor
Modified: 2021-12-29 00:32 UTC (History)
0 users

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


Attachments
Backtrace (7.17 KB, text/vnd.kde.kcrash-report)
2021-10-26 05:06 UTC, Nagy Tibor
Details
Screen capture (614.99 KB, video/mp4)
2021-10-27 05:28 UTC, Nagy Tibor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nagy Tibor 2021-10-26 05:06:25 UTC
Created attachment 142889 [details]
Backtrace

SUMMARY
When using the Strings tool and switching between files there's a high chance of Okteta segfaulting. Just a gut feeling but I think this may occur because Okteta retains the search results on the Strings docker after closing the file those results refer to.

STEPS TO REPRODUCE
1. Open a binary file with some strings in it.
2. Open Tools -> Strings.
3. Select everything in the file and click Extract on the Strings docker.
4. Double click a search result to select it in the hex view.
5. Close the file. Notice how the strings docker still retains the search results from the file that has just been closed. This may be the the root cause of the problem.
6. Open an another file. There's a high chance of Okteta crashing in this step.
7. If the previous step didn't crash, go to the Strings docker and randomly hammer the length spinbox and the results list to trigger the crash. Do not click the Extract button again.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.23
KDE Plasma Version: 5.23.1
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.3
Graphics Platform: X11
Comment 1 Friedrich W. H. Kossebau 2021-10-27 04:48:49 UTC
Thanks for the report.

That the strings tool keeps the extracted strings around is on purpose, as there was interest to have them them available independent of whether the document is still loaded.

There is explicit code to handle the document having been closed, but seems there is a flaw. Could not yet reproduce the crash, but the backtrace you provided matches what you describe, so serves as starting point to analyze the code.
Comment 2 Nagy Tibor 2021-10-27 05:28:10 UTC
Created attachment 142930 [details]
Screen capture

Here's a screen capture of the steps I described above. May help reproducing the crash if something were ambiguous.
Comment 3 Friedrich W. H. Kossebau 2021-10-27 05:50:19 UTC
Thanks for the screen capture. Meanwhile found the flaw in the code, and also managed to force myself such crashes.

So fix is already sketched and should land soonish. Given all the new reports I should see to do a release in the next weeks afterwards then, at least before end of year.
Comment 4 Friedrich W. H. Kossebau 2021-12-29 00:32:16 UTC
Git commit 607390315750815b0009b95ecd65699e2a1d110a by Friedrich W. H. Kossebau.
Committed on 25/11/2021 at 17:52.
Pushed by kossebau into branch '0.26'.

String extraction tool: fix crash with marked strings in closed view

FIXED-IN: 0.26.7

M  +6    -1    kasten/controllers/view/stringsextract/stringsextracttool.cpp

https://invent.kde.org/utilities/okteta/commit/607390315750815b0009b95ecd65699e2a1d110a