You are viewing a plain text version of this content. The canonical link for it is here.
Posted to proton@qpid.apache.org by "Fraser Adams (JIRA)" <ji...@apache.org> on 2014/04/26 18:14:15 UTC

[jira] [Resolved] (PROTON-569) Initialise pipe file descriptors to -1 in messenger prior to calling pn_pipe

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

Fraser Adams resolved PROTON-569.
---------------------------------

    Resolution: Fixed

> Initialise pipe file descriptors to -1 in messenger prior to calling pn_pipe
> ----------------------------------------------------------------------------
>
>                 Key: PROTON-569
>                 URL: https://issues.apache.org/jira/browse/PROTON-569
>             Project: Qpid Proton
>          Issue Type: Bug
>            Reporter: Fraser Adams
>            Priority: Minor
>
> In messenger the pipe file descriptors are not initialised prior to the call to pn_pipe. In most cases this isn't an issue as the call to pipe should do something, however there is no check made for pn_pipe failing and indeed the control pipe/interrupt stuff is essentially not an essential part of messenger so that is reasonable. The issue I've seen though is for the JavaScript bindings I'm working on, in emscripten the pipe call essentially does nothing and just returns -1, the problem however is that the uninitialised pipe file descriptors are zero, in other words m->ctrl[0] = 0, which is the filedescriptor for stdin!!!
> I kept on getting PN_INTR errors until I worked out what was going on.
> See also https://github.com/kripken/emscripten/issues/2313
> Simply doing
>     m->ctrl[0] = -1;
>     m->ctrl[1] = -1;
> before 
>     pn_pipe(m->io, m->ctrl);
> Makes things behave as expected.



--
This message was sent by Atlassian JIRA
(v6.2#6252)