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

2014-04-26 Thread Fraser Adams (JIRA)
Fraser Adams created PROTON-569:
---

 Summary: 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)


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

2014-04-26 Thread Fraser Adams (JIRA)

 [ 
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)


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

2014-04-26 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PROTON-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13982035#comment-13982035
 ] 

ASF subversion and git services commented on PROTON-569:


Commit 1590244 from [~fadams] in branch 'proton/trunk'
[ https://svn.apache.org/r1590244 ]

PROTON-569: Initialise pipe file descriptors to -1 in messenger prior to 
calling pn_pipe

 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)