You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by "Changkun Ou (JIRA)" <ji...@apache.org> on 2018/09/20 18:00:03 UTC

[jira] [Resolved] (GUACAMOLE-608) Daemon process may encounter dead loop

     [ https://issues.apache.org/jira/browse/GUACAMOLE-608?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Changkun Ou resolved GUACAMOLE-608.
-----------------------------------
    Resolution: Won't Fix

The write call is correctly invoked in the __write_all function. See a detailed behavior of write():

https://github.com/apache/guacamole-server/pull/179#issuecomment-422514340

> Daemon process may encounter dead loop
> --------------------------------------
>
>                 Key: GUACAMOLE-608
>                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-608
>             Project: Guacamole
>          Issue Type: Bug
>          Components: guacd
>    Affects Versions: 0.9.14, 1.0.0
>            Reporter: Changkun Ou
>            Priority: Minor
>
> {{guacd}} involves a {{__write_all}} function to write instruction as much as possible, see https://github.com/apache/guacamole-server/blob/7c191d7be0441a1cb64c90ab62d6535f3798eacb/src/guacd/connection.c#L67
> However system call {{write}} may return 0 and set {{errno}}, which is not verified in the function.
> A possible case: {{write}} keeps return 0 and nothing writes to buffer, therefore the daemon process encounters a dead loop, furthermore, it leads CPU rate up to 99%.
> A possible fix is:
> {code:none}
> int written = write(fd, buffer, length);
> if (written < 0 || errno > 0)
>     return -1;
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)