https://bugs.kde.org/show_bug.cgi?id=453124

--- Comment #3 from Fabian Vogt <fab...@ritter-vogt.de> ---
Each call to readData allocates > 4KiB on stack, which with recursion that deep
might blow the limits of the thread.
Can you somehow increase the thread's default stack size to ~2MiB?

The function could be improved to avoid recursion (and unbounded delay), can
you try that?

diff --git a/src/client/plasmawindowmanagement.cpp
b/src/client/plasmawindowmanagement.cpp
index 0098c728..903e5342 100644
--- a/src/client/plasmawindowmanagement.cpp
+++ b/src/client/plasmawindowmanagement.cpp
@@ -631,16 +631,14 @@ static int readData(int fd, QByteArray &data)
     int n;
     while (true) {
         n = QT_READ(fd, buf, sizeof buf);
-        if (n == -1 && (errno == EAGAIN) && ++retryCount < 1000) {
+        f (n > 0) {
+            data.append(buf, n);
+        } else if (n == -1 && (errno == EAGAIN) && ++retryCount < 1000) {
             usleep(1000);
         } else {
             break;
         }
     }
-    if (n > 0) {
-        data.append(buf, n);
-        n = readData(fd, data);
-    }
     return n;
 }

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

Reply via email to