Closed Bug 1336939 Opened 3 years ago Closed 3 years ago

child_process spawn() {encoding: null} does not work in Firefox 51.0.1

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: romanov4400, Unassigned)

References

Details

(Keywords: regression)

Attachments

(1 file)

759 bytes, application/javascript
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce:

Example code:
const { spawn } = require('sdk/system/child_process');
var proc = spawn("cmd");


Actual results:

Iternal JavaScript TypeError "result is not an object" in system/child_process/subprocess.js:93



Expected results:

No error

In Firefox 51.0.1 x32 works fine
Sorry, mistake in version number. 
Broken in 51.0.1
It works in 51.0.0
Summary: sdk/system/child_process spawn() does not work in Firefox 51.0.1 x64 → sdk/system/child_process spawn() does not work in Firefox 51.0.1
Callback in Task.spawn executed before variable "result" has been assigned in subprocess.js:162
(In reply to romanov4400 from comment #2)
> Callback in Task.spawn executed before variable "result" has been assigned
> in subprocess.js:162

This shouldn't actually be possible unless something throws an error before a value is assigned to `result`, and the only way that should be able to happen is if the `options.stdin` callback is a function, and throws an error.

In any case, this seems to work as expected for me. Can you provide a complete testcase extension, please?
Attached file index.js
Test extension code.
'encoding': null in options causes this error
Update: I'm get  TypeError "result is not an object" only when debugging child_process module.
Without debugging, I get error in anither line, sdk/system/child_process/subprocess.js:108: TypeError: buffer is not iterable
Line 108: 
return String.fromCharCode(...buffer);
I'd suggest that you switch to using Subprocess.jsm directly. The child_process module is deprecated, and has does not have sufficient tests to be considered stable.
Keywords: regression
Summary: sdk/system/child_process spawn() does not work in Firefox 51.0.1 → child_process spawn() {encoding: null} does not work in Firefox 51.0.1
https://bugzilla.mozilla.org/show_bug.cgi?id=1399562
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.