https://bugs.kde.org/show_bug.cgi?id=522378
Bug ID: 522378
Summary: Kate loads and edits files but produces zero length
files with save -- even if no change was made.
Classification: I don't know
Product: kde
Version First unspecified
Reported In:
Platform: RedHat Enterprise Linux
OS: Linux
Status: REPORTED
Severity: critical
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Running on Fedora 43. Kate 26.04.2.
kate was working fine. I was developing a simple Rust program to test the
simple calling of function with two arguments (a string and an integer). Rust
compliler was complaining about my function definition. I was making changes
with Kate. At some point it complained that I needed to add a "main function"
to "main.rs". I looked at the program in Kate and there was a "main" function.
I thought there must be some mistake in the code before the "main" function and
started to delete some of this code. Soon I discovered that the "Kate Save
operation" was writing a zero length output file.
Summary:
Kate and KWrite silently save documents as 0-byte (empty) files. No error
dialog appears; the application reports the save as successful (modified
indicator clears normally). Confirmed via strace that no write/pwrite64 syscall
ever touches the document's file descriptor during the save operation, even
though the file is correctly opened, truncated, and closed.
Environment:
Fedora 43 (fresh install, ~2 weeks old at time of report)
kate-26.04.2-1.fc43 (also reproduced on kate-25.12.3-1.fc43 before update)
kf6-ktexteditor-6.27.0-1.fc43
qt6-qtbase-6.10.3-1.fc43
KDE Plasma on Wayland (also reproduced under XCB/X11 via QT_QPA_PLATFORM=xcb)
/home is Btrfs
Steps to reproduce:
Open Kate or KWrite, create or open any text file
Type any content, or even with zero edits to an already-loaded file
Save (Ctrl+S) or Save As
Resulting file on disk is 0 bytes; UI shows no error
Diagnostic work done (I worked through this systematically with the help of an
AI assistant — Claude — to rule out other causes before concluding this is a
KTextEditor bug):
Not Snap/Flatpak — confirmed native Fedora RPM packages
Not disk space, mount options, or permissions — plain shell writes (echo,
touch) to the same file/directory succeed normally
Not SELinux — getenforce shows Enforcing, but no AVC denials logged; context
matches between shell-created and GUI-created files
Not user profile/config — reproduced identically on a brand-new, never-used
user account
Not display protocol — reproduced under both Wayland and XCB
(QT_QPA_PLATFORM=xcb)
Not locale — locale shows valid en_US.UTF-8 settings throughout
Not fapolicyd — not installed on this system
Not plugin-related — reproduced with all save-affecting plugins (LSP Client,
Formatting, etc.) disabled
Not corruption — dnf reinstall kate kate-libs kf6-ktexteditor qt6-qtbase (fresh
packages from repo) does not resolve it
GNOME Text Editor and Gedit (GTK/GtkSourceView-based, unrelated codebase) save
correctly on the same files/filesystem, ruling out filesystem or kernel-level
causes
strace -f -e trace=openat,write,pwrite64,close shows: openat(...,
O_WRONLY|O_CREAT|O_TRUNC...) followed immediately by close(), with no
intervening write/pwrite64 call referencing that file descriptor. Meanwhile,
Kate's own internal config files (session state, recent files, plugin settings)
write correctly via the same trace, on different file descriptors, in the same
run.
A second Fedora 43 machine, installed roughly a year ago and not yet updated to
the same package versions, does not exhibit this bug — suggesting a regression
introduced in a recent kate/kf6-ktexteditor/qt6-qtbase build.
Impact: Real risk of silent data loss — there is no error message indicating
the save failed.
Is there a temporary work around or another version of Kate to allow my work to
continue? I have an older installation that works just fine, but it is a
desktop and I need the laptop. Both are Fedora 43 using KDE Kate,
***
If you're not sure this is actually a bug or valid feature request, instead
post about it at https://discuss.kde.org
If you're reporting a crash, attach a backtrace with debug symbols; see
https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
Please remove this comment after reading and before submitting - thanks!
***
DESCRIPTION
STEPS TO REPRODUCE
1.
2.
3.
OBSERVED RESULT
EXPECTED RESULT
SOFTWARE/OS VERSIONS
Operating System (available in the Info Center app, or by running `kinfo` in a
terminal window):
KDE Plasma Version:
KDE Frameworks Version:
Qt Version:
ADDITIONAL INFORMATION
--
You are receiving this mail because:
You are watching all bug changes.