Bug 468906 - Extract Frame Save Dialog crashes when changing directory via input into filename
Summary: Extract Frame Save Dialog crashes when changing directory via input into file...
Status: CONFIRMED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (other bugs)
Version First Reported In: 6.19.0
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2023-04-24 14:50 UTC by Dirk Hagedorn
Modified: 2025-11-14 19:27 UTC (History)
3 users (show)

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


Attachments
Screenshot with explenations (290.28 KB, image/jpeg)
2023-04-28 08:31 UTC, Dirk Hagedorn
Details
Crash-Log_enter-drive-name-only (79.84 KB, text/plain)
2023-05-13 16:44 UTC, emohr
Details
Crash-log_when typing E: into the name field (504.54 KB, text/plain)
2025-08-12 16:13 UTC, emohr
Details
Rough patch fixing the crash (928 bytes, patch)
2025-11-14 19:27 UTC, Jean-Baptiste Mardelle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Hagedorn 2023-04-24 14:50:27 UTC
Noticed in previous versions two I could reproduce it with the fresh 23.04.
I use two partitions: C and F, kdenlive is installed in F:\Programme\kdenlive-23.04.0_standalone (German Win 10 Pro)

STEPS TO REPRODUCE
1.  Create a new project, add a video clip to the timeline, move the cursor inside the clip, the project monitor should display a frame
2.  Right-click on the project monitor and select "Extract Frame"
3.  The Save Dialog appears, the directory path (on top) is at C:/, the Name shows something like "Unknown-f000042.png"
4.  Enter "F:" in the Name's edit field, press Enter

OBSERVED RESULT

The Save Dialog refreshes the directory content with the root content of my partition F:, then freezes, after some seconds Kdenlive crashes completely.

EXPECTED RESULT

The Save Dialog changes to F:/ and keeps on waiting for further actions.

ADDITIONAL INFORMATION

The same freeze/crash happens when entering "F:\" or "F:/" (F: is an existing partition).
The same freeze/crash happens when entering "A:" or for another non-existing drive/partition.

Changing paths via the directory field (on top of the dialog) or by clicking on "Devices" on the left side works fine.


SOFTWARE/OS VERSIONS
Windows 10 Pro (German)
Kdenlive 23.04.0 standalone
Comment 1 emohr 2023-04-27 17:54:28 UTC
Mmh. After “extract frame” I don’t’ have path on top which I can edit. Please upload here a screenshot of this window with the path.
Comment 2 Dirk Hagedorn 2023-04-28 07:12:21 UTC
Please take a look at the screencast at https://youtu.be/Sft_upaaF7g

After entering "F:" in the Name edit field Kdenlive freezes. It takes some seconds, then it crashes (and OBS Studio becomes visible that I used to record the desktop).
Comment 3 Dirk Hagedorn 2023-04-28 08:31:08 UTC
Created attachment 158507 [details]
Screenshot with explenations
Comment 4 Bug Janitor Service 2023-05-13 03:46:05 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 5 emohr 2023-05-13 16:44:01 UTC
Created attachment 158913 [details]
Crash-Log_enter-drive-name-only

Now I can confirm the crash following your steps. Attached the back trace.
Comment 6 Dirk Hagedorn 2023-09-19 06:36:20 UTC
Same behaviour with Kdenlive 23.08.1 (Standalone), it still crashes as shown before
Comment 7 emohr 2023-09-19 17:05:23 UTC
We should in general not allow users to put names with special character into a  file-names field because Windows will crash with such special characters like: \ / : * ? < > │
Comment 8 Dirk Hagedorn 2023-09-19 19:55:44 UTC
(In reply to emohr from comment #7)
> We should in general not allow users to put names with special character
> into a  file-names field because Windows will crash with such special
> characters like: \ / : * ? < > │

It's common practice to enter complete paths (relative or absolute) to change the directory, to input complete file names with path in Windows' Save (and Open) Dialogs. You can even input masks (foo*.bar) to filter the current directory list. I don't see any benefit in using Kdenlive's own save dialog instead of the the system's save dialoge, thus the quickest bugfix was to use the Window's save dialog, I guess.
Comment 9 Dirk Hagedorn 2024-11-08 11:40:47 UTC
Installed kdenlive-24.08.3_standalone, the bug still exists.
Comment 10 emohr 2025-08-12 16:13:24 UTC
Created attachment 183993 [details]
Crash-log_when typing E: into the name field

I checked with the latest master (commit 2640a1d21b).
When I type “E:” into the name field Kdenlive crashes. It seems to be a KF6KIOFileWidgets issue in conjunction with Qt6.
Attached the gdb log
Comment 11 Jean-Baptiste Mardelle 2025-11-14 12:43:42 UTC
Yes, this is a KFileWidget issue. Entering F: and pressing enter in a KFileWidget's Name filed in Saving mode crashes on Windows.
Comment 12 Jean-Baptiste Mardelle 2025-11-14 18:55:10 UTC
Some more details on what happens on Windows:
The bug is in KFileWidget's slotOk(). If the user enters "F:" (without quotes - any drive letter will crash) in the name field, 
the url is set to QUrl("file:///F:") in [1]
Then , in [2] we create a QUrl directory from url by removing the filename, and end up with directory = QUrl("file:///")
The stat job in [3] thinks it is a dir, and the url is set to QUrl("file:///") and the fileName to "F:"
Finally, in [4] we set back the name field to fileName (so "F:") and relaunch slotOk(), creating an endless loop

[1] https://invent.kde.org/frameworks/kio/-/blob/master/src/filewidgets/kfilewidget.cpp#L742
[2] https://invent.kde.org/frameworks/kio/-/blob/master/src/filewidgets/kfilewidget.cpp#L758
[3] https://invent.kde.org/frameworks/kio/-/blob/master/src/filewidgets/kfilewidget.cpp#L767
[4] https://invent.kde.org/frameworks/kio/-/blob/master/src/filewidgets/kfilewidget.cpp#L773
Comment 13 Jean-Baptiste Mardelle 2025-11-14 19:27:37 UTC
Created attachment 186794 [details]
Rough patch fixing the crash

This patch fixes the crash by checking for invalid characters in the filename and preventing such cases. Maybe a regexp or an other better solution exists to check that..