Bug 486782 - Error opening files for comparison from Visual Studio/Command Line
Summary: Error opening files for comparison from Visual Studio/Command Line
Status: RESOLVED FIXED
Alias: None
Product: kdiff3
Classification: Applications
Component: application (show other bugs)
Version: 1.11.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: michael
URL:
Keywords:
: 489786 490028 495734 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-05-08 15:45 UTC by Sven Moderow
Modified: 2024-11-21 14:33 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 1.12
Sentry Crash Report:


Attachments
error shown when opening kdiff3 from Visual Studio (21.62 KB, image/png)
2024-05-08 15:45 UTC, Sven Moderow
Details
kdiff3 adds special characters (110.19 KB, image/png)
2024-05-27 10:49 UTC, Sven Moderow
Details
example on MacOS (57.47 KB, image/png)
2024-06-26 08:33 UTC, zidad
Details
No Horizontal Scroll Bars (206.92 KB, image/png)
2024-11-18 00:41 UTC, Charlie
Details
Error message context menu (93.90 KB, image/png)
2024-11-20 12:18 UTC, elydgolden
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Moderow 2024-05-08 15:45:45 UTC
Created attachment 169317 [details]
error shown when opening kdiff3 from Visual Studio

SUMMARY


STEPS TO REPRODUCE
1. change source files in Visual Studio
2. compare source files in Visual Studio

OBSERVED RESULT
Files will not open with error. See attachment.
When confirming the error dialog and then conforming the files dialog (without any changes in paths), comparison will open as expected.

EXPECTED RESULT
Open file comparison without any error directly.

SOFTWARE/OS VERSIONS
Windows: 11 Pro
kdiff3: 1.11.0 (64-bit)
Comment 1 Sven Moderow 2024-05-27 10:33:59 UTC
In addition, merging files automatically or manually sometime corrupt the files with strange special character at the beginning and the end of line.
Comment 2 Sven Moderow 2024-05-27 10:49:03 UTC
Created attachment 169871 [details]
kdiff3 adds special characters

"ZWNBSP" characters!?
Comment 3 chuanyu.wang 2024-06-14 02:31:02 UTC
Same error and behavior within Git Extension (v4.2.1). I have installed kdiff3 version 1.11.0.
Comment 4 Sven Moderow 2024-06-14 07:35:30 UTC
I tried downgrading but that worsened things and KDiff did either throw that exception or was not opening at all. So my final conclusion was to uninstall and use another tool.
Comment 5 chuanyu.wang 2024-06-14 07:51:34 UTC
(In reply to Sven Moderow from comment #4)
> I tried downgrading but that worsened things and KDiff did either throw that
> exception or was not opening at all. So my final conclusion was to uninstall
> and use another tool.

Just FYI, I downgraded to version 1.10.7, it works well with Git Extension. But I have to admit that it takes dozens of seconds to launch dkiff3 (OS: windows 11, CPU: i7-1270P).
Comment 6 michael 2024-06-15 20:28:56 UTC
The odd characters were the result of an encoding detection problem that was introduced in 1.11.  Whatever is going with the git extention launch does not seem to happen under arch-linux. Going try and setup a test environment under windows.
Comment 7 zidad 2024-06-26 08:33:33 UTC
Created attachment 171000 [details]
example on MacOS

I have the same problem on MacOS with the latest KDIFF3 release, it corrupts my files on every merge
Comment 8 michael 2024-06-29 22:47:29 UTC
Please  use a separate bug for the file corruption issue. This is solely about the error when opening.
Comment 9 michael 2024-06-29 23:15:00 UTC
Just tagged 1.11.2 if that does not fix the document corruption then a new bug will needed for that. The error doesn't reproduce on my setup  under linux. Maybe a windows specific thing. How is git setup of your machine?
Comment 10 Sven Moderow 2024-07-01 10:01:38 UTC
git config:

[diff]
	tool = vsdiffmerge
	colorMoved = zebra
	colorMovedWS = allow-indentation-change
[merge]
	tool = vsdiffmerge
	guitool = vsdiffmerge
	colorMoved = zebra
	colorMovedWS = allow-indentation-change
	conflictstyle = diff3
[difftool]
	prompt = true
	keepBackup = false
[mergetool]
	prompt = true
	keepBackup = false
	trustExitCode = true
[fetch]
	prune = true
[gui]
	recentrepo = C:/Source/Repos/xyz
[difftool "vsdiffmerge"]
	cmd = \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" //t
	keepBackup = false
[mergetool "vsdiffmerge"]
	cmd = \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\vsdiffmerge.exe\" \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\" //m
	keepBackup = false
	trustExitCode = true
[difftool "kdiff3"]
	cmd = \"C:\\Users\\xyz\\AppData\\Local\\KDiff3\\bin\\kdiff3.exe\" \"$LOCAL\" \"$REMOTE\"
[mergetool "kdiff3"]
	cmd = \"C:\\Users\\xyz\\AppData\\Local\\KDiff3\\bin\\kdiff3.exe\" \"$BASE\" \"$REMOTE\" \"$LOCAL\" -o \"$MERGED\"
Comment 11 Sven Moderow 2024-07-03 08:03:39 UTC
(In reply to zidad from comment #7)
> Created attachment 171000 [details]
> example on MacOS
> 
> I have the same problem on MacOS with the latest KDIFF3 release, it corrupts
> my files on every merge

New ticket for special characters error: https://bugs.kde.org/show_bug.cgi?id=489538
Comment 12 Johannes Lorenz 2024-07-14 19:45:10 UTC
Confirming the bug on Arch Linux, it has also been reported https://bbs.archlinux.org/viewtopic.php?id=295528 . A simple "kdiff3 Makefile Makefile" will show the error, and pressing "OK" when the prepopulated files then opens everything.

The interesting part: When I press Ctrl + C immediately and then restart kdiff3 the same way, it does find the files. I am about to compare the straces of these two events now.
Comment 13 Johannes Lorenz 2024-07-14 19:56:52 UTC
Note, I used kdiff3 1.11.1 .

From comparing the strace, I could not find out the issue.
Comment 14 chuanyu.wang 2024-07-16 05:47:25 UTC
(In reply to michael from comment #9)
> Just tagged 1.11.2 if that does not fix the document corruption then a new
> bug will needed for that. The error doesn't reproduce on my setup  under
> linux. Maybe a windows specific thing. How is git setup of your machine?

The issue is the same in version 1.11.2. I tried it with Windows 11 + GitExtension 4.2.1

[difftool "kdiff3"]
	cmd = \"C:/Program Files/KDiff3/bin/kdiff3.exe\" \"$LOCAL\" \"$REMOTE\"
	path = C:/Program Files/KDiff3/bin/kdiff3.exe
[mergetool "kdiff3"]
	path = C:/Program Files/KDiff3/bin/kdiff3.exe
	cmd = \"C:/Program Files/KDiff3/bin/kdiff3.exe\" \"$BASE\" \"$LOCAL\" \"$REMOTE\" -o \"$MERGED\"
Comment 15 jweems 2024-07-17 20:13:05 UTC
*** Bug 490028 has been marked as a duplicate of this bug. ***
Comment 16 jweems 2024-07-17 20:21:48 UTC
I can confirm this is not a git issue. I get the same error when calling kdiff3 directly from the command line. I opened bug 490082 not realizing it was a duplicate of this one and have more details attached to that bug.
Comment 17 jweems 2024-07-17 20:23:39 UTC
(In reply to jweems from comment #16)
> I can confirm this is not a git issue. I get the same error when calling
> kdiff3 directly from the command line. I opened bug 490082 not realizing it
> was a duplicate of this one and have more details attached to that bug.

the duplicate is bug 490028, I transposed the last 2 numbers in my first reply
Comment 18 michael 2024-08-10 02:37:25 UTC
Git commit dbc690d7c5ae8e1917b214e14f21fedd4200c314 by Michael Reeves.
Committed on 10/08/2024 at 02:36.
Pushed by mreeves into branch '1.11'.

Move SourceData init to constructor for KDiff3App
FIXED-IN: 1.11.3

M  +17   -16   src/kdiff3.cpp
M  +6    -2    src/kdiff3.h
M  +2    -2    src/kdiff3_shell.cpp

https://invent.kde.org/sdk/kdiff3/-/commit/dbc690d7c5ae8e1917b214e14f21fedd4200c314
Comment 19 michael 2024-08-10 02:38:42 UTC
Git commit 9d2a70ea420778ef0a543d463c9ca71a29105b6c by Michael Reeves.
Committed on 10/08/2024 at 02:38.
Pushed by mreeves into branch 'master'.

Move SourceData init to constructor for KDiff3App
FIXED-IN: 1.11.3

M  +17   -16   src/kdiff3.cpp
M  +6    -2    src/kdiff3.h
M  +2    -2    src/kdiff3_shell.cpp

https://invent.kde.org/sdk/kdiff3/-/commit/9d2a70ea420778ef0a543d463c9ca71a29105b6c
Comment 20 michael 2024-08-10 02:42:07 UTC
*** Bug 489786 has been marked as a duplicate of this bug. ***
Comment 21 Arnd 2024-10-11 17:45:07 UTC
I still have this problem with 1.11.4 (Arch Linux), when I open 3 files from the command line. With 2 files it is ok.
Comment 22 elydgolden 2024-10-16 00:13:41 UTC
(In reply to Arnd from comment #21)
> I still have this problem with 1.11.4 (Arch Linux), when I open 3 files from
> the command line. With 2 files it is ok.

Coming from bug 489786 I am also still having this problem when comparing two files from Dolphin in 1.11.4
Comment 23 chuanyu.wang 2024-10-17 06:22:50 UTC
The same issue still exist in version 1.11.4, tested in Windows 11 x64 (Launch kdiff3 from Git Extension 5.0 version).
Comment 24 michael 2024-10-21 18:19:42 UTC
Finally triggered this while looking at an unrelated bug not sure why it was only triggering for three way compare.
Comment 25 michael 2024-10-21 21:12:46 UTC
Git commit 2e3e6e0f16e7865b41ffa5995d157bd4c55360d8 by Michael Reeves.
Committed on 21/10/2024 at 20:44.
Pushed by mreeves into branch 'master'.

Fix bogus error gererated by FileAccess::open

This seems to have been triggered only in command line drive compares.
Also reported to require a three way compare to reliably trigger.
FIXED-IN: 1.11.5

M  +8    -0    src/autotests/FileAccessTest.cpp
M  +4    -2    src/fileaccess.cpp

https://invent.kde.org/sdk/kdiff3/-/commit/2e3e6e0f16e7865b41ffa5995d157bd4c55360d8
Comment 26 michael 2024-10-21 21:13:10 UTC
Git commit f87cf8d03934a5c31c40f16e049dfe0913883f33 by Michael Reeves.
Committed on 21/10/2024 at 20:47.
Pushed by mreeves into branch '1.11'.

Fix bogus error gererated by FileAccess::open

This seems to have been triggered only in command line drive compares.
Also reported to require a three way compare to reliably trigger.
FIXED-IN: 1.11.5

M  +8    -0    src/autotests/FileAccessTest.cpp
M  +4    -2    src/fileaccess.cpp

https://invent.kde.org/sdk/kdiff3/-/commit/f87cf8d03934a5c31c40f16e049dfe0913883f33
Comment 27 michael 2024-11-07 15:06:26 UTC
*** Bug 495734 has been marked as a duplicate of this bug. ***
Comment 28 Sven 2024-11-08 10:10:55 UTC
I still get that error with version 1.11.5 on Windows.
Comment 29 chuanyu.wang 2024-11-11 08:59:31 UTC
The same issue still exist in version 1.11.5, tested in Windows 11 x64 (Launch kdiff3 from Git Extension 5.0 version).
Comment 30 Arnd 2024-11-16 09:31:41 UTC
Also on Arch Linux still same problem with 1.11.5
To reproduce it:
> echo a > a
> echo b > b
> echo c > c
> kdiff3 a b c
Comment 31 michael 2024-11-17 17:38:36 UTC
Mysteriously this no longer happens on my test machine so far. 1.11.5 fixes the only trigger I've been able to find so far. Going to have a closer looker. From what I've gather the GUI should come up with files pre-filled after the error. There seems to be no issue after clicking "ok' on the open dialog which tells something weird is happening with the command line use. I have been using both vs-code/git and direct command line tests. So far I haven't triggered this with 1.11.5 or master
Comment 32 Charlie 2024-11-17 19:56:30 UTC
Version 1.11.5 on Windows 11 (2024H2) is now working again with TortoiseGit!

This version also looks much better on Windows than Version 1.10.* and earlier did. Rendering size is normal (used to be super small), fonts are better, icon spacing is better, weirdness with window drawing is fixed. It actually looks pretty good now. Thanks for all the great updates!
Comment 33 michael 2024-11-17 23:50:08 UTC
Part of that is coming from Qt as well as the windows and mac os versions are built using craft which is periodicly updated with the latest bug fixes. They are also now Qt6 bassed which may have more support for high res monitors than  the legacy Qt5 framework.
Comment 34 Charlie 2024-11-18 00:39:22 UTC
So I spoke a bit to soon - the new version has no horizontal scroll bars nor can you scroll horizontally using the keyboard or trackpad. It seems like horizontal scrolling is totally disabled.
Comment 35 Charlie 2024-11-18 00:41:33 UTC
Created attachment 175896 [details]
No Horizontal Scroll Bars

Notice there are no horizontal scroll bars (Windows 11, Kidff 1.11.5). Nor does scrolling work at all.
Comment 36 michael 2024-11-18 16:38:56 UTC
Go ahead and file a seprate bug for the missing scrollbar. Just a spurious error trigger that is fixed in the 1.12 branch. @Arnd  are you able to verify if your issue is fixed in that branch
Comment 37 Charlie 2024-11-19 02:15:16 UTC
Cool - see https://bugs.kde.org/show_bug.cgi?id=496444
Comment 38 elydgolden 2024-11-20 12:18:22 UTC
Created attachment 175973 [details]
Error message context menu
Comment 39 elydgolden 2024-11-20 12:20:23 UTC
I am still getting an error message when comparing from the dolphin context menu (as in Bug 489786) as of version 1.11.5
Comment 40 Arnd 2024-11-21 08:54:03 UTC
Branch 1.12 seems to work! Thanks
Comment 41 michael 2024-11-21 14:33:42 UTC
The last remaining issues with the command line appears fixed in 1.12. This will now be be released.