Bug 413474 - Crash when adding variable into swap file name
Summary: Crash when adding variable into swap file name
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.63.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-26 13:50 UTC by Juraj
Modified: 2019-10-29 21:39 UTC (History)
1 user (show)

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


Attachments
Video example (1.16 MB, video/webm)
2019-10-26 13:50 UTC, Juraj
Details
Backtrace from KDevelop with same crash (17.14 KB, text/plain)
2019-10-26 17:54 UTC, Juraj
Details
Backtrace from KDevelop with same crash (8.53 KB, text/plain)
2019-10-26 18:04 UTC, Juraj
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juraj 2019-10-26 13:50:03 UTC
Created attachment 123493 [details]
Video example

SUMMARY
Kate crashed when adding variable to swap file name.

STEPS TO REPRODUCE
1. Start Kate
2. Go to > Menu > Settings > Configure Kate > [Editor Component] Open/Save > Advanced
3. Make prefix or suffix inputs focused (click on them)
4. Click on the icon '{}' on the right side which shows when the input is focused
5. Select something from the list which popped up (I did Date:Locale)

OBSERVED RESULT
Kate crashes.

EXPECTED RESULT
Kate runs.

SOFTWARE/OS VERSIONS
Operating System: Artix Linux 
KDE Plasma Version: 5.17.1
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1
Kernel Version: 4.19.80-1-lts
OS Type: 64-bit
Processors: 2 × Intel® Pentium® CPU B980 @ 2.40GHz
Memory: 7,6 GiB of RAM


ADDITIONAL INFORMATION
See the video
Comment 1 Juraj 2019-10-26 17:54:21 UTC
Created attachment 123500 [details]
Backtrace from KDevelop with same crash

I have KDevelop compiled from source, hope backtrace can help.
Comment 2 Juraj 2019-10-26 18:04:40 UTC
Created attachment 123501 [details]
Backtrace from KDevelop with same crash
Comment 3 Dominik Haumann 2019-10-28 15:43:39 UTC
Can you try again changing 

281 const auto name = QStringLiteral("%{") + var.name() + QLatin1Char('}');

to

 const QString name = QStringLiteral("%{") + var.name() + QLatin1Char('}');
Comment 4 Juraj 2019-10-28 16:08:36 UTC
(In reply to Dominik Haumann from comment #3)
> Can you try again changing 
> 
> 281 const auto name = QStringLiteral("%{") + var.name() + QLatin1Char('}');
> 
> to
> 
>  const QString name = QStringLiteral("%{") + var.name() + QLatin1Char('}');

That does the trick.
No crash and it adds variables into the text field.

Thank you.
Comment 5 Christoph Cullmann 2019-10-28 19:32:27 UTC
Git commit f6e72a23052339253daa79095391625cf01c96f1 by Christoph Cullmann.
Committed on 28/10/2019 at 19:32.
Pushed by cullmann into branch 'master'.

fix crash

M  +3    -1    src/utils/katevariableexpansionhelpers.cpp

https://commits.kde.org/ktexteditor/f6e72a23052339253daa79095391625cf01c96f1
Comment 6 Dominik Haumann 2019-10-28 19:34:39 UTC
Thanks for the quick testing Juraj.