Windows 0.9.0: `conhost --headless` exits at once when stdin is "ignore", so the adb server (and emulators) never start
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 68/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- node.js, typescript
Piste de recherche
Start by reading dist/ports/windows-command.js and the childStdio logic in dist/ports/node-process-runner.js; the issue reproduces the behavior with child_process.spawn. Check the Android emulator launch in dist/drivers/android/emulator.js too, since it uses the same wrapper. Reproduce with stdin set to ignore and pipe, then verify adb and the emulator stay running with file logging.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
On a Windows worker, 0.9.0 never starts its adb server, so the Android driver is skipped and the worker offers no Android devices. It worked on the same machine with 0.8.0.
"module":"daemon.driver-discovery","message":"Skipped Android driver: adb server unavailable",
"fields":{"port":5038,"reason":"start-failed","summary":"Refusing to run the android driver: Simlock's adb server did not start listening on port 5038 within 10000ms"}
simlock catalog then prints No platforms available., and ~\.simlock\logs\adb-server.log holds only conhost's title escape sequence (ESC]0;C:\Windows\System32\conhost.exe).
Seen on Windows 11 (Windows_NT 10.0.26300 x64), Simlock 0.9.0, agent-device 0.21.44, SDK platform-tools 37.0.0, emulator 36.5.11, worker started by the logon scheduled task (simlock daemon start) and joined to a gateway.
Why
A child with outlivesCaller: true is wrapped by headlessLaunch (dist/ports/windows-command.js) as conhost.exe --headless <command> ...args (ADR 0086, #1759). A child that logs to a file gets stdio: ["ignore", logFd, logFd] (childStdio in dist/ports/node-process-runner.js). With stdin set to ignore, conhost.exe --headless exits immediately (exit 0) without ever starting the program it was given. The adb server is launched this way, so it never listens, and the driver gives up after 10 s.
The emulator is launched the same way (dist/drivers/android/emulator.js, outlivesCaller: true, stdio: { file: logPath }), so fixing only the adb launch would move the failure to emulator boot.
Reproduction
Node child_process.spawn with the same options Simlock uses:
conhost.exe --headless <sdk>\platform-tools\adb.exe -P 5038 nodaemon server,stdio: ["ignore", fd, fd]: exits 0 after ~31 ms, nothing listens on 5038, and the log holds only the conhost escape sequence (byte for byte what the worker'sadb-server.logholds).- Same adb, spawned directly with the same stdio: listening on 127.0.0.1:5038 after ~112 ms.
conhost.exe --headless cmd.exe /c "echo hi && ping -n 2 127.0.0.1": with stdinignore, exits 0 after ~23 ms with no output; with stdinpipe, runs ~1 s and printshi.
Port 5038 was free and in no excluded port range; another (unrelated) adb server on 5037 plays no part.
Possible fix
Give the wrapped child a stdin that stays open (for example "pipe", left unwritten) whenever headlessLaunch applies, or skip the conhost wrapper for children that log to a file.
- Langage dominant
- TypeScript
- Étoiles
- 730
- Forks
- 44
- Merge moyen
- 16 h 13 min
- PR mergées (30 j)
- 387
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
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.
Autres issues de callstackincubator/simlock
-
The SIGKILL escalation test passes without escalation when its child starts later than 100 msOuvertebug:new
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
callstackincubator/simlock#1986 ·
Les mainteneurs répondent en général sous 1 jour
-
bug:new
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
callstackincubator/simlock#1979 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
process-runner.test.ts fails four tests when a child starts 1 to 3 s latePeut-être pris @V3RON l’a pris aujourd’hui. Ouvertebug:new
callstackincubator/simlock#1985 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
bug:new
Difficulté 3/5 1-2 jours Accessibilité débutants 74/100
callstackincubator/simlock#1984 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
iOS runCommand passes timeoutMs to spawn, which ignores it, and its comment relies on that backstopOuvertebug:new
Difficulté 3/5 1-2 jours Accessibilité débutants 57/100
callstackincubator/simlock#1980 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de callstackincubator/simlock
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
audacity/audacity.github.io#118 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
crxjs/chrome-extension-tools#1261 ·
-
Resources: Update work of fuzhouPeut-être pris @rmt-svc l’a pris aujourd’hui. Ouverteresources
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
railmapgen/rmp-gallery#4245 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
mike-north/AgentMonitors#717 ·
Les mainteneurs répondent en général sous 1 jour