subprocess_worker_win fails initPipes when stderr:"ignore"

UNCONFIRMED
Unassigned

Status

()

UNCONFIRMED
2 years ago
2 years ago

People

(Reporter: gorf4673, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36

Steps to reproduce:

Testing application launch for Bug 1270359 - Implement runtime.connectNative for Windows

Prior to changes for Bug 1272522 - Handle native app output on stderr

execution where options doesn't include stderr

        let subprocessOpts = {
          command: hostInfo.manifest.path,
          arguments: [hostInfo.path],
          workdir: OS.Path.dirname(hostInfo.manifest.path),
        };
        return Subprocess.call(subprocessOpts);


Leads to initPipes where Failed to create pipe is raised in initPipes



Actual results:

Received error in Browser Console 
Failed to create pipe  NativeMessaging.jsm:207
this.NativeApp</this.startupPromise<()  NativeMessaging.jsm:207


debugging worker subprocess_worker_win.js 

broke at start of initPipes  where error is raised
input  stderr has value of "ignore"

      let ok = libc.DuplicateHandle(curProc, srcHandle, curProc, handle.address(),
                                    0, true /* inheritable */,
                                    win32.DUPLICATE_SAME_ACCESS);

      their_pipes[2] = ok && win32.Handle(handle);

ok:false
their_pipes[2]:false




Expected results:

Subprocess should have launched. 
Assume it should have ignored stderror output.

Comment 1

2 years ago
Same for me (FF 51.0b6 32-bit). Try the snippet below -> works with stderr, throws exception without (caused by libc.DuplicateHandle returning false like gorf4673 stated)!!

var subprocess = require('sdk/system/child_process/subprocess');
p = subprocess.call({
  command: "C:\\Windows\\Notepad.exe",
  arguments: '',
  stdin: (stream) => {
    var processID = require('sdk/system/runtime').processID;
    console.log('my pid=' + processID);
  },
  stdout: function (data) {
    console.log(data);
  },
  stderr: function (data) {
    console.log(data);
  },
  done: function (result) {
    console.log('Message host stream closed.');
  }
});
p.wait();
You need to log in before you can comment on or make changes to this bug.