Bug 389639 - katepart's "View changes" does not work
Summary: katepart's "View changes" does not work
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: part (show other bugs)
Version: 17.08.1
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-30 11:05 UTC by Dinescu Stefan
Modified: 2019-08-24 15:40 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 Dinescu Stefan 2018-01-30 11:05:55 UTC
On some machines, trying to "View changes" in the katepart message dialog will not work.
I could find "QWindowsPipeWriter::write failed" in DBGView.

Steps to reproduce: 
1. Open a file and modify it
2. Kill kate process
3. Reopen kate and the file
4. In the message dialog ("The file was not closed properly"), press "View changes"
Comment 1 Dinescu Stefan 2018-01-30 11:11:48 UTC
>	Qt5Core.dll!QWindowsPipeWriter::write(const QByteArray & ba) Line 193	C++
 	Qt5Core.dll!QProcessPrivate::writeToStdin() Line 822	C++
 	Qt5Core.dll!QProcessPrivate::_q_canWrite() Line 1111	C++
 	Qt5Core.dll!QMetaObject::activate(QObject * sender, int signalOffset, int local_signal_index, void * * argv) Line 3754	C++
 	Qt5Core.dll!QTimer::timerEvent(QTimerEvent * e) Line 257	C++
 	Qt5Core.dll!QObject::event(QEvent * e) Line 1228	C++
 	Qt5Widgets.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3718	C++
 	Qt5Widgets.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3680	C++
 	Qt5Core.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1018	C++
 	Qt5Core.dll!QEventDispatcherWin32::event(QEvent * e) Line 1040	C++
 	Qt5Widgets.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3718	C++
 	Qt5Widgets.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3680	C++
 	Qt5Core.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1018	C++
 	Qt5Core.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1678	C++
 	qwindows.dll!00007ffe7eeef9bf()	Unknown
 	Qt5Core.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned __int64 wp, __int64 lp) Line 236	C++
 	user32.dll!00007ffecc18bc50()	Unknown
 	user32.dll!00007ffecc18b5cf()	Unknown
 	Qt5Core.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 627	C++
 	qwindows.dll!00007ffe7eeef999()	Unknown
 	Qt5Core.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 211	C++
 	Qt5Core.dll!QCoreApplication::exec() Line 1291	C++
 	kate.exe!00007ff6c3ad5b28()	Unknown
 	kate.exe!00007ff6c3b1d574()	Unknown
 	kate.exe!00007ff6c3b1c5e2()	Unknown
 	kernel32.dll!BaseThreadInitThunk()	Unknown
 	ntdll.dll!RtlUserThreadStart()	Unknown


At line 193 in qwindowspipewriter.cpp, handle is 0xffffffffffffffff.

In qprocess_win.cpp:822 the stdinchannel contains:
-		stdinChannel	{file= process=0x0000000000000000 <NULL> notifier=0x0000000000000000 <NULL> ...}	QProcessPrivate::Channel
+		file		QString
+		process	0x0000000000000000 <NULL>	QProcessPrivate *
+		notifier	0x0000000000000000 <NULL>	QSocketNotifier *
+		reader	0x000002c0899bb720 {handle=0xffffffffffffffff overlapped={pipeWriter=0x000002c0899bb720 {handle=0xffffffffffffffff ...} } ...}	QWindowsPipeReader * {QWindowsPipeWriter}
+		writer	0x000002c0899bb720 {handle=0xffffffffffffffff overlapped={pipeWriter=0x000002c0899bb720 {handle=0xffffffffffffffff ...} } ...}	QWindowsPipeWriter *
+		pipe	0x000002c08987f890 {0xffffffffffffffff, 0xffffffffffffffff}	void *[2]
		type	0	unsigned int
		closed	true	bool
		append	false	bool
Comment 2 Kåre Särs 2018-01-30 12:43:07 UTC
Thanks for the report!

This is unfortunately a "known feature" of the windows port :( The "View changes" button functionality depends on diff.exe and kompare.exe to create a diff and show it to the user. The current installer does not ship neither diff nor kompare.

The solution to the problem is to port/compile these to Windows and make sure they work together with Kate.
Comment 3 Dinescu Stefan 2018-01-30 13:12:21 UTC
Thanks! I will add those programs to my PATH.
Comment 4 Christoph Cullmann 2019-08-24 15:40:34 UTC
Git commit 3b028b14e1a2318770f2a33bdd69ffeb25774266 by Christoph Cullmann.
Committed on 24/08/2019 at 15:39.
Pushed by cullmann into branch 'master'.

properly check if diff command can be started for swap file diffing

avoids that writing to failed-to-start process leads to segfault

M  +20   -18   src/swapfile/kateswapdiffcreator.cpp
M  +3    -4    src/swapfile/kateswapdiffcreator.h

https://commits.kde.org/ktexteditor/3b028b14e1a2318770f2a33bdd69ffeb25774266