child_process: ERR_INVALID_ARG_TYPE on .kill()
Personne n'a encore pris cette issue.
- Langage dominant
- JavaScript
- Étoiles
- 122k
- Forks
- 37.3k
- Merge moyen
- 4 j 2 h
- PR mergées (30 j)
- 283
Description
- Version: Electron v4.2.12 - Node v10.11.0
- Platform: Windows 10 64-bit
- Subsystem: child_process
We are getting the following stack trace when killing a child_process:
root ERROR TypeError [ERR_INVALID_ARG_TYPE]: The "err" argument must be of type number. Received type undefined
at validateNumber (internal/validators.js:130:11)
at Object.getSystemErrorName (util.js:1435:3)
at errnoException (internal/errors.js:303:21)
at ChildProcess.kill (internal/child_process.js:430:26)
From what I can make of it, it seems to be caused by the following code:
https://github.com/nodejs/node/blob/v10.x/lib/internal/child_process.js#L425-L439
var err = this._handle.kill(signal);
if (err === 0) {
/* Success. */
this.killed = true;
return true;
}
if (err === UV_ESRCH) {
/* Already dead. */
} else if (err === UV_EINVAL || err === UV_ENOSYS) {
/* The underlying platform doesn't support this signal. */
throw errnoException(err, 'kill');
} else {
/* Other error, almost certainly EPERM. */
this.emit('error', errnoException(err, 'kill'));
}
Somehow, err seems to be undefined, making us land in the last else branch, but then errnoException doesn't know what to make out of it and throws the error that we see.
The issue only happens in Electron, so it might not be entirely related to Node, but I was wondering if this err value is expected to be undefined in some circumstance?
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par la plage référencée dans lib/internal/child_process.js et suivez la valeur err depuis this._handle.kill(signal) à travers internal/errors.js, util.js et internal/validators.js. Reproduisez l’échec de .kill() sous Windows avec les versions d’Electron et de Node indiquées, puis déterminez la condition de plateforme qui produit undefined et documentez ou testez le comportement attendu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript
- Domaine
- operating-systems
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Active
- Clarté
- À clarifier
- Accessibilité débutants
- 42/100