Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 935224 - kde-misc/kdiff3 fails with "Unknown error"
Summary: kde-misc/kdiff3 fails with "Unknown error"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Bernard Cafarelli
URL: https://bugs.kde.org/show_bug.cgi?id=...
Whiteboard:
Keywords: PullRequest, UPSTREAM
Depends on:
Blocks:
 
Reported: 2024-06-30 11:42 UTC by Paul Osmialowski
Modified: 2024-08-11 06:54 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info output, greater than copy-paste limit (emerge.info,22.24 KB, text/plain)
2024-06-30 11:42 UTC, Paul Osmialowski
Details
patch to revert the windows10 fix (fix_935224.patch,872 bytes, patch)
2024-07-17 21:01 UTC, Malcolm Lashley
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Osmialowski 2024-06-30 11:42:19 UTC
This is the same issue as described here: https://bbs.archlinux.org/viewtopic.php?id=295528 So far no workable solution is known. This is a regression, but since I haven't been using it for a couple of months, I have no idea on what circumstances it appeared.
Comment 1 Paul Osmialowski 2024-06-30 11:42:53 UTC
Created attachment 896646 [details]
emerge --info output, greater than copy-paste limit
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-30 11:44:26 UTC
Can you describe the problem yourself inline here too, including some steps to reproduce?
Comment 3 Paul Osmialowski 2024-06-30 11:50:41 UTC
I'm starting kdiff3 as such:

$ kdiff3 file1.txt file2.txt

both files in the current directory (namely, in my home directory).

The kdiff3 window opens as usual, but no file content is being displayed. At the same time, a popup window appears with the message:

Opening of these files failed:

- /home/myusername/file1.txt
  Opening /home/myusername/file1.txt failed. Unknown error

- /home/myusername/file2.txt
  Opening /home/myusername/file2.txt failed. Unknown error

I've deleted all of the kdiff3* files in the /home/myusername/.config directory (including kdiff3rc file), it didn't help.
Comment 4 Andreas Sturmlechner gentoo-dev 2024-06-30 12:14:51 UTC
Version?
Comment 5 Paul Osmialowski 2024-06-30 12:19:49 UTC
$ emerge -pv kdiff3

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 15.10 s (backtrack: 0/20).

[ebuild   R    ] kde-misc/kdiff3-1.11.1:5::gentoo  USE="handbook -debug" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

$ ldd `which kdiff3`
	linux-vdso.so.1 (0x00007ffed0a6d000)
	libKF5XmlGui.so.5 => /usr/lib64/libKF5XmlGui.so.5 (0x00007f397a3e4000)
	libQt5PrintSupport.so.5 => /usr/lib64/libQt5PrintSupport.so.5 (0x00007f397a371000)
	libKF5ConfigWidgets.so.5 => /usr/lib64/libKF5ConfigWidgets.so.5 (0x00007f397a302000)
	libKF5KIOCore.so.5 => /usr/lib64/libKF5KIOCore.so.5 (0x00007f397a15f000)
	libKF5Crash.so.5 => /usr/lib64/libKF5Crash.so.5 (0x00007f397a154000)
	libKF5I18n.so.5 => /usr/lib64/libKF5I18n.so.5 (0x00007f397a0ff000)
	libKF5CoreAddons.so.5 => /usr/lib64/libKF5CoreAddons.so.5 (0x00007f397a034000)
	libKF5ConfigCore.so.5 => /usr/lib64/libKF5ConfigCore.so.5 (0x00007f3979fcb000)
	libKF5WidgetsAddons.so.5 => /usr/lib64/libKF5WidgetsAddons.so.5 (0x00007f3979e6e000)
	libQt5Widgets.so.5 => /usr/lib64/libQt5Widgets.so.5 (0x00007f3979828000)
	libQt5Gui.so.5 => /usr/lib64/libQt5Gui.so.5 (0x00007f3979258000)
	libQt5Core.so.5 => /usr/lib64/libQt5Core.so.5 (0x00007f3978d12000)
	libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/13/libstdc++.so.6 (0x00007f3978a24000)
	libm.so.6 => /usr/lib64/libm.so.6 (0x00007f3978944000)
	libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/13/libgcc_s.so.1 (0x00007f397891f000)
	libc.so.6 => /usr/lib64/libc.so.6 (0x00007f3978739000)
	libKF5GlobalAccel.so.5 => /usr/lib64/libKF5GlobalAccel.so.5 (0x00007f3978717000)
	libQt5Network.so.5 => /usr/lib64/libQt5Network.so.5 (0x00007f3978575000)
	libKF5ItemViews.so.5 => /usr/lib64/libKF5ItemViews.so.5 (0x00007f3978538000)
	libKF5IconThemes.so.5 => /usr/lib64/libKF5IconThemes.so.5 (0x00007f39784f2000)
	libKF5GuiAddons.so.5 => /usr/lib64/libKF5GuiAddons.so.5 (0x00007f39784ae000)
	libKF5ConfigGui.so.5 => /usr/lib64/libKF5ConfigGui.so.5 (0x00007f3978487000)
	libQt5Xml.so.5 => /usr/lib64/libQt5Xml.so.5 (0x00007f3978445000)
	libQt5DBus.so.5 => /usr/lib64/libQt5DBus.so.5 (0x00007f39783b6000)
	libKF5Codecs.so.5 => /usr/lib64/libKF5Codecs.so.5 (0x00007f3978379000)
	libKF5AuthCore.so.5 => /usr/lib64/libKF5AuthCore.so.5 (0x00007f3978364000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f397a6d5000)
	libKF5Service.so.5 => /usr/lib64/libKF5Service.so.5 (0x00007f39782c2000)
	libacl.so.1 => /usr/lib64/libacl.so.1 (0x00007f39782b7000)
	libmount.so.1 => /usr/lib64/libmount.so.1 (0x00007f397824b000)
	libQt5X11Extras.so.5 => /usr/lib64/libQt5X11Extras.so.5 (0x00007f3978242000)
	libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f3978104000)
	libudev.so.1 => /usr/lib64/libudev.so.1 (0x00007f39780c3000)
	libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007f3978050000)
	libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007f3978016000)
	libz.so.1 => /usr/lib64/libz.so.1 (0x00007f3977ffa000)
	libharfbuzz.so.0 => /usr/lib64/libharfbuzz.so.0 (0x00007f3977ecc000)
	libdouble-conversion.so.3 => /usr/lib64/libdouble-conversion.so.3 (0x00007f3977eb5000)
	libicui18n.so.74 => /usr/lib64/libicui18n.so.74 (0x00007f3977ba1000)
	libicuuc.so.74 => /usr/lib64/libicuuc.so.74 (0x00007f39779b9000)
	libpcre2-16.so.0 => /usr/lib64/libpcre2-16.so.0 (0x00007f3977927000)
	libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007f39777de000)
	libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00007f397778d000)
	libproxy.so.1 => /usr/lib64/libproxy.so.1 (0x00007f3977788000)
	libssl.so.3 => /usr/lib64/libssl.so.3 (0x00007f39776f0000)
	libcrypto.so.3 => /usr/lib64/libcrypto.so.3 (0x00007f397731f000)
	libQt5Svg.so.5 => /usr/lib64/libQt5Svg.so.5 (0x00007f39772c5000)
	libKF5Archive.so.5 => /usr/lib64/libKF5Archive.so.5 (0x00007f3977287000)
	libQt5WaylandClient.so.5 => /usr/lib64/libQt5WaylandClient.so.5 (0x00007f3977148000)
	libwayland-client.so.0 => /usr/lib64/libwayland-client.so.0 (0x00007f3977139000)
	libdbus-1.so.3 => /usr/lib64/libdbus-1.so.3 (0x00007f39770ec000)
	libKF5DBusAddons.so.5 => /usr/lib64/libKF5DBusAddons.so.5 (0x00007f39770cd000)
	libblkid.so.1 => /usr/lib64/libblkid.so.1 (0x00007f3977074000)
	libcryptsetup.so.12 => /usr/lib64/libcryptsetup.so.12 (0x00007f3976ff5000)
	libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f3976fca000)
	libcap.so.2 => /usr/lib64/libcap.so.2 (0x00007f3976fbe000)
	libGLdispatch.so.0 => /usr/lib64/libGLdispatch.so.0 (0x00007f3976f42000)
	libGLX.so.0 => /usr/lib64/libGLX.so.0 (0x00007f3976f0f000)
	libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007f3976e48000)
	libgraphite2.so.3 => /usr/lib64/libgraphite2.so.3 (0x00007f3976e23000)
	libicudata.so.74 => /usr/lib64/libicudata.so.74 (0x00007f39750c3000)
	libpcre2-8.so.0 => /usr/lib64/libpcre2-8.so.0 (0x00007f3975023000)
	libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00007f3974f5f000)
	libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00007f3974f30000)
	libcom_err.so.2 => /usr/lib64/libcom_err.so.2 (0x00007f3974f2a000)
	libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00007f3974f1c000)
	libkeyutils.so.1 => /usr/lib64/libkeyutils.so.1 (0x00007f3974f15000)
	libresolv.so.2 => /usr/lib64/libresolv.so.2 (0x00007f3974f02000)
	libpxbackend-1.0.so => /usr/lib64/libproxy/libpxbackend-1.0.so (0x00007f3974ef7000)
	libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007f3974e9b000)
	libbz2.so.1 => /usr/lib64/libbz2.so.1 (0x00007f3974e88000)
	liblzma.so.5 => /usr/lib64/liblzma.so.5 (0x00007f3974e59000)
	libzstd.so.1 => /usr/lib64/libzstd.so.1 (0x00007f3974d91000)
	libwayland-cursor.so.0 => /usr/lib64/libwayland-cursor.so.0 (0x00007f3974d88000)
	libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007f3974d3d000)
	libxkbcommon.so.0 => /usr/lib64/libxkbcommon.so.0 (0x00007f3974cf6000)
	libffi.so.8 => /usr/lib64/libffi.so.8 (0x00007f3974cea000)
	libsystemd.so.0 => /usr/lib64/libsystemd.so.0 (0x00007f3974bed000)
	libuuid.so.1 => /usr/lib64/libuuid.so.1 (0x00007f3974be3000)
	libdevmapper.so.1.02 => /usr/lib64/libdevmapper.so.1.02 (0x00007f3974b89000)
	libjson-c.so.5 => /usr/lib64/libjson-c.so.5 (0x00007f3974b76000)
	libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f3974b71000)
	libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007f3974b67000)
	libbrotlidec.so.1 => /usr/lib64/libbrotlidec.so.1 (0x00007f3974b59000)
	libgio-2.0.so.0 => /usr/lib64/libgio-2.0.so.0 (0x00007f3974975000)
	libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007f397494c000)
	libgcrypt.so.20 => /usr/lib64/libgcrypt.so.20 (0x00007f397482f000)
	liblz4.so.1 => /usr/lib64/liblz4.so.1 (0x00007f3974808000)
	libbrotlicommon.so.1 => /usr/lib64/libbrotlicommon.so.1 (0x00007f39747e5000)
	libgmodule-2.0.so.0 => /usr/lib64/libgmodule-2.0.so.0 (0x00007f39747de000)
	libgpg-error.so.0 => /usr/lib64/libgpg-error.so.0 (0x00007f39747b5000)
$
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-30 12:28:10 UTC
It must die at https://invent.kde.org/sdk/kdiff3/-/blob/master/src/fileaccess.cpp#L930 (two points in that function where it could happen).
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-30 12:32:01 UTC
Does it fail for any files? What are file1.txt and file2.txt?

If I do, say, `touch a b` in /tmp (on tmpfs), I get:
```
$ kdiff3 a b
org.kde.kdiff3: Loading A:  "/tmp/a"
org.kde.kdiff3: Loading B:  "/tmp/b"
org.kde.kdiff3: Diff: A <-> B
org.kde.kdiff3: Linediff: A <-> B
org.kde.kdiff3: Enter: calcDiff3LineListUsingAB
org.kde.kdiff3: Leave: calcDiff3LineListUsingAB
```

with a window opened and a message saying "Files A and B are binary equal."
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-30 12:32:28 UTC
I get a crash if I echo "hi" > b. Looking...
Comment 9 Paul Osmialowski 2024-06-30 12:34:43 UTC
These are just regular text files. I've also tried to compare two C codes and two MLIR codes, with the same effect. Then I masked this version (1.11.1) and downgraded kdiff3 to 1.10.7 and this version just works.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-30 12:38:51 UTC
(In reply to Paul Osmialowski from comment #9)
> These are just regular text files. I've also tried to compare two C codes
> and two MLIR codes, with the same effect. Then I masked this version
> (1.11.1) and downgraded kdiff3 to 1.10.7 and this version just works.

Ah, thanks, that's useful information. I'll compare the two now.

The issue I mention above is https://bugs.kde.org/show_bug.cgi?id=487338.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-30 12:39:28 UTC
(In reply to Paul Osmialowski from comment #9)
> These are just regular text files. I've also tried to compare two C codes
> and two MLIR codes, with the same effect. Then I masked this version
> (1.11.1) and downgraded kdiff3 to 1.10.7 and this version just works.

(A minimal reproducing example, along with `stat` output for the two files would still be useful.)
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-30 12:43:34 UTC
(In reply to Paul Osmialowski from comment #9)
> These are just regular text files. I've also tried to compare two C codes
> and two MLIR codes, with the same effect. Then I masked this version
> (1.11.1) and downgraded kdiff3 to 1.10.7 and this version just works.

diff is https://invent.kde.org/sdk/kdiff3/-/compare/1.10.7...1.11.1?from_project_id=423&straight=false (800 commits!)
Comment 13 Andreas Sturmlechner gentoo-dev 2024-07-06 22:09:26 UTC
(In reply to Sam James from comment #10)
> The issue I mention above is https://bugs.kde.org/show_bug.cgi?id=487338.
Looks like that one got fixed.
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-06 22:13:10 UTC
As for the remaining bug here, please file a bug upstream at bugs.kde.org -- I can't reproduce it.
Comment 15 Malcolm Lashley 2024-07-17 21:01:02 UTC
I had the same issue. I bisected to:

commit f6aca74944482c1bf5f2df653945a2fb5d2bf660 (HEAD)
Author: Michael Reeves <reeves.87@gmail.com>
Date:   Sun Sep 24 13:06:29 2023 -0400

    Delay updateAvailabilities until focus change is competed
    
    BUG:462693
    FIXED-IN:1.10.6

And indeed reverting that on top of git-HEAD works, as does dropping the revert in /etc/portage/patches/... and rebuilding kde-misc/kdiff3-1.11.2

https://bugs.kde.org/show_bug.cgi?id=462693 seems to be a Windows fix, I don't understand Qt/kde internals enough to go further- but for the short term, I see no reason not to patch it out in Gentoo (or at least for the reporter to try the same.)
Comment 16 Malcolm Lashley 2024-07-17 21:01:54 UTC
Created attachment 897902 [details, diff]
patch to revert the windows10 fix
Comment 17 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-18 04:29:55 UTC
Given I can't reproduce it, could you please file a bug on bugs.kde.org explaining:
* how to reproduce it;
* the bisect result?

Thanks.

If you don't want to do that at this time, please try to construct some set of steps to create files (or just upload them here) which have the bad behaviour when kdiff3'd.
Comment 18 Malcolm Lashley 2024-07-23 22:37:38 UTC
I believe this is a /race-condition/, and thus my previous bisect would have been inaccurate... I repeated with 3 launches per test - and landed here:

mlashley@duality /var/tmp/portage/kdiff3 ((fb3b7e66...)|BISECTING) $ git bisect bad
fb3b7e66d097f41e1e43f9ffe3e94eb48623a48e is the first bad commit
commit fb3b7e66d097f41e1e43f9ffe3e94eb48623a48e (HEAD)
Author: Michael Reeves <reeves.87@gmail.com>
Date:   Wed May 17 23:18:50 2023 -0400

    Move InitView call to KDiff3App::completeInit

 src/kdiff3.cpp | 2 ++
 src/pdiff.cpp  | 4 +---
 2 files changed, 3 insertions(+), 3 deletions(-)


(I will update the kde bug when I recover my password there...)
Comment 19 Andreas Sturmlechner gentoo-dev 2024-08-10 08:22:43 UTC
Could you test the commit referenced in the newly linked upstream bug?
Comment 20 Larry the Git Cow gentoo-dev 2024-08-11 06:54:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=615c87830b4d962683154eb82d3ff7a319a622e6

commit 615c87830b4d962683154eb82d3ff7a319a622e6
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2024-08-10 20:59:40 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2024-08-11 06:53:31 +0000

    kde-misc/kdiff3: Fix "unknown error"
    
    KDE-bug: https://bugs.kde.org/show_bug.cgi?id=486782
    
    Closes: https://bugs.gentoo.org/935224
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 .../kdiff3/files/kdiff3-1.11.2-unknown-error.patch | 132 +++++++++++++++++++++
 kde-misc/kdiff3/kdiff3-1.11.2-r2.ebuild            |  52 ++++++++
 2 files changed, 184 insertions(+)