Summary: | Krita with Qt 5.9.1 on Windows randomly fails to send data to gmic-qt | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | Alvin Wong <alvin> |
Component: | G'Mic for Krita | Assignee: | Krita Bugs <krita-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | NOR | ||
Version: | git master (please specify the git hash!) | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
Latest Commit: | https://commits.kde.org/krita/a0eef62be22fe6e30293a840fd3cb580fe79772f | Version Fixed In: | |
Attachments: |
DebugView output
Test program for testing QLocalSocket communication Test program for testing QLocalSocket communication (qmake file) |
Description
Alvin Wong
2017-07-21 14:17:05 UTC
An additional note, my Krita is compiled with Qt 5.9.1 Git commit eaa459e3c28951ef3b280271d8f370a848f92e16 by Alvin Wong. Committed on 21/07/2017 at 16:17. Pushed by alvinwong into branch 'krita/3.2'. Do not wait indefinitely for socket in QMic plugin This works around a possible lockups with gmic-qt. Instead of waiting for the socket forever, it should only freeze for a aximum of 8 seconds. M +14 -5 plugins/extensions/qmic/QMic.cpp https://commits.kde.org/krita/eaa459e3c28951ef3b280271d8f370a848f92e16 Git commit 2c9c9cb2709f700d195bd0cfffd939f4a61b69e0 by Alvin Wong. Committed on 21/07/2017 at 16:16. Pushed by alvinwong into branch 'master'. Do not wait indefinitely for socket in QMic plugin This works around a possible lockups with gmic-qt. Instead of waiting for the socket forever, it should only freeze for a aximum of 8 seconds. M +12 -3 plugins/extensions/qmic/QMic.cpp https://commits.kde.org/krita/2c9c9cb2709f700d195bd0cfffd939f4a61b69e0 I made some changes to stop the lockups, but it just hides the actual bug, gmic-qt will sometimes not able to receive the image data properly and cause other errors. This will appear in DebugView occasionally and gmic-qt will show some error or an empty image (PID 8608 is gmic-qt). [11308] Sending "key_{bb238f3f-6f95-4a63-ae5b-5c5e60fb4c0c},4c61796572203136,3600,2400\n" [11308] Failed to write response: QLocalSocket::UnknownSocketError [11308] Remote not disconnected: QLocalSocket::UnknownSocketError [11308] QLocalSocket::waitForDisconnected() is not allowed in UnconnectedState [8608] Stale request [8608] gmic-qt: empty answer! [8608] QImage::scaled: Image is a null image Look for "Failed to write response" and "Stale request". I was not able to reproduce this at all with 3.2.0 beta 2 (which uses Qt 5.6.1). Created attachment 106940 [details]
Test program for testing QLocalSocket communication
Created attachment 106941 [details]
Test program for testing QLocalSocket communication (qmake file)
Here are several commits in Qt that *might* be related to the issue? But I haven't tested reverting them. QLocalSocket/Win: use QRingBuffer::append https://github.com/qt/qtbase/commit/1675d9a1b23794592a55746dfebd6f40478fde03 QLocalSocket/Win: Use QIODevice's internal write buffer https://github.com/qt/qtbase/commit/082ee835b0e09f77e0e1bd061323a1b70178d202 QLocalSocket/Win: Fix access to deleted pipeWriter https://github.com/qt/qtbase/commit/4d7313a466dd775e58705924f72525d4838c70fe Tracing with gdb, it seems to be that whenever it failed to send the data, it's QDataStream::writeBytes returning on qtbase\src\corelib\io\qdatastream.cpp:1348 1348 CHECK_STREAM_WRITE_PRECOND(*this) But upon inspection, QDataStream::dev is not null, which means it shouldn't have returned. Now I'm rather confused. Git commit a0eef62be22fe6e30293a840fd3cb580fe79772f by Alvin Wong. Committed on 30/07/2017 at 10:49. Pushed by alvinwong into branch 'master'. Work around possible gmic-qt write issues with Qt 5.7+ M +5 -0 plugins/extensions/qmic/QMic.cpp https://commits.kde.org/krita/a0eef62be22fe6e30293a840fd3cb580fe79772f Worked around, so I'll call this fixed. Delaying the real "fix" until someone decide to improve on the IPC code in the Qmic plugin... |