Bug 469269 - kdiff3 1.10.1 aborts on "Assertion `!m_modificationTime.isNull()'" when a file or directory with mtime <= 999,999ns from epoch is encountered
Summary: kdiff3 1.10.1 aborts on "Assertion `!m_modificationTime.isNull()'" when a fil...
Status: RESOLVED FIXED
Alias: None
Product: kdiff3
Classification: Applications
Component: application (other bugs)
Version First Reported In: 1.10.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: michael
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-02 15:14 UTC by Justin Keogh
Modified: 2023-05-23 13:40 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Keogh 2023-05-02 15:14:16 UTC
SUMMARY
kdiff3 1.10.1 fails when it encounters a file or directory with an mtime <= 999,999ns from epoch.

STEPS TO REPRODUCE
1. mkdir -p a/c b; touch -m -d '1969-12-31 17:00:00.000999999 -0700' a/c
2. kdiff3 a b

OBSERVED RESULT
$ kdiff3 a b
org.kde.kdiff3.fileAccess: Reading folder:  "/delme/a"
org.kde.kdiff3.fileAccess: Reading folder:  "/delme/a/c"
org.kde.kdiff3.fileAccess: Reading folder:  "/delme/b"
kdiff3: /var/tmp/portage/kde-misc/kdiff3-1.10.1/work/kdiff3-1.10.1/src/fileaccess.cpp:773: QDateTime FileAccess::lastModified() const: Assertion `!m_modificationTime.isNull()' failed.
Aborted
$ python -c "import os; print(os.lstat('a/c').st_mtime_ns)"
999999

Adding a nanosecond, the assert is not triggered:
$ mkdir -p a/c b; touch -m -d '1969-12-31 17:00:00.001000000 -0700' a/c; /usr/bin/kdiff3 a b
org.kde.kdiff3.fileAccess: Reading folder:  "/delme/a"
org.kde.kdiff3.fileAccess: Reading folder:  "/delme/a/c"
org.kde.kdiff3.fileAccess: Reading folder:  "/delme/b"
$ python -c "import os; print(os.lstat('a/c').st_mtime_ns)"
1000000

Filesystem: ext4
Comment 1 michael 2023-05-19 17:27:59 UTC
Git commit 3d27dfd6c3c61e24fadec8797f2ca862fc37e1f7 by Michael Reeves.
Committed on 19/05/2023 at 15:50.
Pushed by mreeves into branch 'master'.

Remove assert failing on missing files
Related: bug 469923
FIX-IN:FIXED-IN:1.10.5

M  +0    -1    src/fileaccess.cpp

https://invent.kde.org/sdk/kdiff3/commit/3d27dfd6c3c61e24fadec8797f2ca862fc37e1f7
Comment 2 michael 2023-05-19 17:28:37 UTC
Git commit 9a5de7262c9cb010e2b4ef3abd3fec869c839f15 by Michael Reeves.
Committed on 19/05/2023 at 15:49.
Pushed by mreeves into branch '1.10'.

Remove assert failing on missing files
Related: bug 469923
FIX-IN:FIXED-IN:1.10.5

M  +0    -1    src/fileaccess.cpp

https://invent.kde.org/sdk/kdiff3/commit/9a5de7262c9cb010e2b4ef3abd3fec869c839f15