Bug 457417

Summary: Crash when trying to close a file after close project
Product: [Applications] kate Reporter: X. Li <fayfarta>
Component: applicationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: christoph
Priority: NOR    
Version First Reported In: 22.04.1   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In: 22.08.0
Sentry Crash Report:

Description X. Li 2022-08-02 14:48:43 UTC
SUMMARY
While we can use 'project' side window to manage a folder, if we close a project when there're still some file in that project left opening, and then try to close that file, we got a crash.


STEPS TO REPRODUCE
1. Open a folder.
2. In project side window, click a file to open it.
3. Click the close button in project side window to close the folder. 
4. Click the close button at the file tab's right edge. (any other equivalent operation like using :bd command in vi mode leads to the same result)

OBSERVED RESULT

Kate crashed.
Kate will only crash when we're trying to close a file in the recently closed project. It won't crash if the file is not related to the project.

EXPECTED RESULT

Opened file closed.

SOFTWARE/OS VERSIONS
Windows: Windows 10 21H2
KDE Plasma Version: 5.94.0
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.2 

ADDITIONAL INFORMATION
Language: zh_CN
Kate installed from Microsoft Store.
Comment 1 Christoph Cullmann 2022-08-25 19:42:07 UTC
Could you try if the latest build here

https://binary-factory.kde.org/view/Windows%2064-bit/job/Kate_Nightly_win64/

Fixes it? You can just use the ZIP and execute Kate from it after extraction without installation.
Comment 2 X. Li 2022-08-26 02:38:32 UTC
(In reply to Christoph Cullmann from comment #1)
> Could you try if the latest build here
> 
> https://binary-factory.kde.org/view/Windows%2064-bit/job/Kate_Nightly_win64/
> 
> Fixes it? You can just use the ZIP and execute Kate from it after extraction
> without installation.

Thanks for your reply.

It looks like the latest build has redesigned its project module. It no longer has a 'Open Folder' command. Previous repro steps are no longer available.
 
I've tried to open some files, the 'Documents' side window then show opened file names and their folders. If I choose to right click a folder and select 'Close' in the popup menu,  the folder and all opened files in it will be closed as well. No crashes.

Right now I cannot find any method to create a project. The 'Project' menu looks like empty and no controls available in 'Project' side window.

That's all I can tell so far. Would you plz tell me if I've missed something? Thank you.
Comment 3 Christoph Cullmann 2022-08-26 07:46:00 UTC
Hi, yeah, we had there some regression.

Which build did you try? I would hope the latest 1676 should have this fixed.
Comment 4 X. Li 2022-08-26 08:24:27 UTC
(In reply to Christoph Cullmann from comment #3)
> Hi, yeah, we had there some regression.
> 
> Which build did you try? I would hope the latest 1676 should have this fixed.
I tried build 1675. Now build 1676 has got 'Open Folder' command again. When I was trying to close a project, it requires all related opening files been closed as well. No other crash found. So the problem should have been fixed. Thank you :)
Comment 5 Christoph Cullmann 2022-08-26 08:54:31 UTC
Nice, we will update the store version soon, too, nice that the issue is solved, crashes during work is always ugly...

Thanks for testing it!
Comment 6 X. Li 2022-08-26 16:23:57 UTC
(In reply to Christoph Cullmann from comment #5)
> Nice, we will update the store version soon, too, nice that the issue is
> solved, crashes during work is always ugly...
> 
> Thanks for testing it!

It's a pleasure that I can help. Thank you for your efforts as well :)