[Differential] [Changed Subscribers] D3049: Support passing generic QIcon through PlasmaWindow interface

roberts (Lindsay Roberts) noreply at phabricator.kde.org
Thu Oct 13 18:32:09 UTC 2016


roberts added inline comments.

INLINE COMMENTS

> plasmawindowmanagement.cpp:489
> +        n = QT_READ(fd, buf, sizeof buf);
> +        if (n == -1 && (errno == EAGAIN) && ++retryCount < 1000) {
> +            usleep(1000);

EAGAIN comes from reads of O_NONBLOCK fd's, but this seems to be a blocking pipe (no calls to fcntl() or pipe2()).

As such the read call could block the thread for significant or unbounded time - depending on whether QT_READ swallows EINTR - if the other side of the pipe failed to close the fd.

> plasmawindowmanagement.cpp:516
> +        if (readData(pipeFd, content) != 0) {
> +            return QIcon::fromTheme(QStringLiteral("wayland"));
> +        }

pipeFd could leak here.

> plasmawindowmanagement_interface.cpp:406
> +            QDataStream ds(&file);
> +            ds << p->m_icon;
> +            file.close();

Is there anything protecting this from being unsynchronised parallel access to m_icon (and p)?

Simplest solution might be passing the icon by value into the lambda.

REPOSITORY
  rKWAYLAND KWayland

REVISION DETAIL
  https://phabricator.kde.org/D3049

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: graesslin, #plasma_on_wayland, hein
Cc: roberts, plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20161013/e1e1f7c9/attachment.html>


More information about the Plasma-devel mailing list