Bug 482590 - kdiff3 segfaults when used with git mergetool
Summary: kdiff3 segfaults when used with git mergetool
Status: RESOLVED FIXED
Alias: None
Product: kdiff3
Classification: Applications
Component: application (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: michael
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-06 21:22 UTC by Thiago Sueto
Modified: 2024-03-09 23:13 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago Sueto 2024-03-06 21:22:22 UTC
Attempting to run git mergetool while having kdiff3 installed to resolve conflicts for a rebase causes kdiff3 to segfault with output like this:

```
This message is displayed because 'merge.tool' is not configured.
See 'git mergetool --tool-help' or 'git help config' for more details.
'git mergetool' will now attempt to use one of the following tools:
opendiff kdiff3 tkdiff xxdiff meld tortoisemerge gvimdiff diffuse diffmerge ecmerge p4merge araxis bc codecompare smerge emerge vimdiff nvimdiff
Merging:
README.md

Normal merge conflict for 'README.md':
  {local}: modified file
  {remote}: modified file
Hit return to start merge resolution tool (kdiff3): 
/usr/libexec/git/mergetools/kdiff3: line 11: 22393 Segmentation fault      (core dumped) "$merge_tool_path" --auto --L1 "$MERGED (Base)" --L2 "$MERGED (Local)" --L3 "$MERGED (Remote)" -o "$MERGED" "$BASE" "$LOCAL" "$REMOTE" > /dev/null 2>&1
merge of README.md failed
```

Running kdiff3 separately runs just fine.
Comment 1 michael 2024-03-07 01:29:41 UTC
Do have the version off kdiff3 you are running? I asked because versions prior to 1.10.6 contain multiple race conditions that are triggered on exit. Typically kdiff3 still exits normally but it can crash. I use kdiff3 as my default git merge tool and have not seen this crash before. The only difference I can see off hand is that I have explicitly set:
merge.tool=kdiff3
merge.guitool=kdiff3
diff.tool=kdiff3
diff.guitool=kdiff3

Currently working on 1.11 branch. 1.10.7 is the newest release.
Comment 2 Thiago Sueto 2024-03-07 15:33:15 UTC
My kdiff3 version is: kdiff3 1.11.70 (64 bit)

I'm on openSUSE Krypton with Plasma 6, but isma mentioned experiencing this bug in Plasma 5 before.
Comment 3 michael 2024-03-09 23:10:23 UTC
I was able the reproduce a crash on save. I my case the changes were not automatically saved as the merge contained a conflict the required manual intervention. Will push a fix shortly.
Comment 4 michael 2024-03-09 23:12:30 UTC
Git commit 3426fdc15d5e444d2c22f57164ab3ba7972b8f77 by Michael Reeves.
Committed on 09/03/2024 at 23:11.
Pushed by mreeves into branch '1.11'.

Fix crash on Save during merge

M  +1    -1    src/mergeresultwindow.cpp

https://invent.kde.org/sdk/kdiff3/-/commit/3426fdc15d5e444d2c22f57164ab3ba7972b8f77
Comment 5 michael 2024-03-09 23:13:02 UTC
Git commit bee1ceea9a170a0ac06de55a9fdb499e06403740 by Michael Reeves.
Committed on 09/03/2024 at 23:11.
Pushed by mreeves into branch 'master'.

Fix crash on Save during merge

M  +1    -1    src/mergeresultwindow.cpp

https://invent.kde.org/sdk/kdiff3/-/commit/bee1ceea9a170a0ac06de55a9fdb499e06403740