[frameworks-kio] [Bug 481311] KDirOperator freezing when trying to parse a folder with more than 178 files

2024-02-24 Thread Jean-Baptiste Mardelle
https://bugs.kde.org/show_bug.cgi?id=481311

--- Comment #3 from Jean-Baptiste Mardelle  ---
The bug can also easily be reproduced using the KIO test kdirlister_gui:
https://invent.kde.org/frameworks/kio/-/blob/master/tests/kdirlistertest_gui.cpp?ref_type=heads

This test opens a window and proposes to browse a few folders by clicking a
button, between "Home, Root, ...".
Just put like 300 files in your home folder, click the "home" button and it
will freeze. The number of files required to reproduce the freeze seems to vary
between 140 and 300

Debug output:

[9712] ::: CREATING LISTJOB WITH PREFIX:  ""
[9712] :::KIO ::: COONNECTING JOB...
[9712] !! KIO CONNECTING ENTRIES
[9712]  CONNECTION SEND COMMD:  85 ,  "\x00\x00\x00\x00"
[9712]  CONNECTION SEND COMMD:  48 , 
"\xFF\xFF\xFF\xFF\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
[9712] ::: KIO  STARTING LIST JOB
[9712]  CONNECTION SEND COMMD:  71 , 
"\x00\x00\x00\x14""file:///C:/Users/XXX"
[9712]  SENT COMMAND:  85 , SUCC:  true
[9712] XXX READ SOCKET START X
[9712] ::: KIO SOCKET Got 14 bytes
[9712]  SENT COMMAND:  48 , SUCC:  true
[9712] QLocalSocket(0x151b46d8ca0) Want to read 4 bytes , AVAIL:  4
[9712]  SENT COMMAND:  71 , SUCC:  true
[9712]   KIO   COMMAND EMITED 
[9712] AAA WORKER ACCEPTED a
[9712] COMMAND RCVD A
[9712] 0x151b90ab120 Command 85 added to the queue
[9712]   KIO COMPARING TO HEADER:  0  >=  10
[9712]  SHOULD READ ANOTHER:  false
[9712] XXX READ SOCKET DONE X
[9712] XXX READ SOCKET START X
[9712] ::: KIO SOCKET Got 58 bytes
[9712] QLocalSocket(0x151b46d8ca0) Want to read 14 bytes , AVAIL:  48
[9712] XXX READ SOCKET START X
[9712]   KIO   COMMAND EMITED 
[9712] ::: KIO SOCKET Got 0 bytes
[9712] COMMAND RCVD A
[9712] ::: KIO ::: WAIT FOR MORE DATA...
[9712] 0x151b90ab120 Command 48 added to the queue
[9712]   KIO COMPARING TO HEADER:  34  >=  10
[9712]  SHOULD READ ANOTHER:  true
[9712] ::: KIO SOCKET Got 34 bytes
[9712] QLocalSocket(0x151b46d8ca0) Want to read 24 bytes , AVAIL:  24
[9712]   KIO   COMMAND EMITED 
[9712] COMMAND RCVD A
[9712] 0x151b90ab120 Command 71 added to the queue
[9712]   KIO COMPARING TO HEADER:  0  >=  10
[9712]  SHOULD READ ANOTHER:  false
[9712] XXX READ SOCKET DONE X
[9712]  CONNECTION SEND COMMD:  106 , 
"\x00\x00\x00\x0B\x01\x00\x00\x06\x00\x00\x00\x02\x00.\x02\x00\x00\r\x00\x00\x00\x00\x00\x00@\x00\x02\x00\x00\t\x00\x00\x00\x00\x00\x00\x01\xC0\x02\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\n\x00\x00\x00\x00""e\xDA\xE4r\x01\x00\x00\x03\x00\x00\x00\x00\x01\x00\x00\x05\x00\x00\x00\x00\x06\x00\x00\x0B\x00\x00\x00\x00""e\xDA\xE4r\x06\x00\x00\f\x00\x00\x00\x00""d|r\xA4\x02\x00\x00\x1B\x00\x00\x00\x00\x00\x00\x00\x02\x02\x00\x00\x1C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0B\x01\x00\x0
(...removed like 60 similar lines...)
6\x02\x00\x00\x1B\x00\x00\x00\x00\x00\x00\x00\x02\x02\x00\x00\x1C\x00\x00\x00\x00\x00\x00\x00\x00"
[9712] XXX READ SOCKET START X
[9712] ::: KIO SOCKET Got 32768 bytes
[9712] QLocalSocket(0x151b90d27e0) Want to read 33194 bytes , AVAIL:  32758
[9712]   KIO   Jumbo packet of 33194 bytes
[9712]  KIO ADJUSTED READ BUFF SIZE:  33195  ==  32758
[9712]   KIO COMPARING:  32758  >=  33194
[9712]  SHOULD READ ANOTHER:  false
[9712] XXX READ SOCKET DONE X
[9712] XXX READ SOCKET START X
[9712] ::: KIO SOCKET Got 32768 bytes
[9712] QLocalSocket(0x151b90d27e0) Want to read 33194 bytes , AVAIL:  32768
[9712]   KIO   Jumbo packet of 33194 bytes
[9712]  KIO ADJUSTED READ BUFF SIZE:  33195  ==  32768
[9712]   KIO COMPARING:  32768  >=  33194
[9712]  SHOULD READ ANOTHER:  false
[9712] XXX READ SOCKET DONE X

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kio] [Bug 481311] KDirOperator freezing when trying to parse a folder with more than 178 files

2024-02-23 Thread Jean-Baptiste Mardelle
https://bugs.kde.org/show_bug.cgi?id=481311

--- Comment #2 from Jean-Baptiste Mardelle  ---
Also I wonder if it could be related to the Qt6 container type size change as
mentioned in:
https://invent.kde.org/frameworks/kio/-/merge_requests/1141#note_606633

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kio] [Bug 481311] KDirOperator freezing when trying to parse a folder with more than 178 files

2024-02-23 Thread Jean-Baptiste Mardelle
https://bugs.kde.org/show_bug.cgi?id=481311

--- Comment #1 from Jean-Baptiste Mardelle  ---
For the record, I can reproduce the bug on Windows with a very basic Qt
Application embedding a KFileWidget:
https://invent.kde.org/multimedia/kdenlive/-/snippets/3016

Also, the following patch - although I am not really sure if it is a proper fix
- fixes the problem and allows browsing a folder with > 800 files without
problem.

_
diff --git a/src/core/connectionbackend_p.h b/src/core/connectionbackend_p.h
index 39c3504c4..ae86eaaa5 100644
--- a/src/core/connectionbackend_p.h
+++ b/src/core/connectionbackend_p.h
@@ -40,7 +40,7 @@ private:
 bool signalEmitted;

 static const int HeaderSize = 10;
-static const int StandardBufferSize = 32 * 1024;
+static const int StandardBufferSize = 64 * 1024;

 Q_SIGNALS:
 void disconnected();
_

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kio] [Bug 481311] KDirOperator freezing when trying to parse a folder with more than 178 files

2024-02-14 Thread Bug Janitor Service
https://bugs.kde.org/show_bug.cgi?id=481311

Bug Janitor Service  changed:

   What|Removed |Added

   Keywords||qt6

-- 
You are receiving this mail because:
You are watching all bug changes.