{"record":{"id":"94950709ab6d807d","repo":"deepseek-ai/deepseek-harness","slug":"subprocess-e2b-unsafe-published-process-group-id","errorCode":null,"errorMessage":"subprocess-e2b: unsafe published process-group id ${pid}","messagePattern":"subprocess-e2b: unsafe published process-group id (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/e2b/subprocess-e2b/src/process.ts","lineNumber":502,"sourceCode":"  private async waitForProcessGroupId(sandbox: Sandbox, completion: Promise<CommandResult>): Promise<number> {\n    const commandSettled = completion.then(\n      () => true,\n      () => true,\n    )\n    while (true) {\n      // TODO(e2b-publication-cancel): Join cancellation to the existing\n      // termination transaction before aborting an in-flight SDK file read.\n      const raw = await sandbox.files.read(this.paths.pid)\n      const value = raw.trim()\n      if (value.length > 0) {\n        const pid = Number(value)\n        if (!/^[1-9][0-9]*$/.test(value) || !Number.isSafeInteger(pid)) {\n          throw new Error(`subprocess-e2b: remote wrapper published invalid process-group id ${JSON.stringify(value)}`)\n        }\n        // A same-UID sandbox process can rewrite this file; refuse ids whose\n        // negative form addresses every process (`kill -- -1`) or init's group.\n        if (pid <= 1) {\n          throw new Error(`subprocess-e2b: unsafe published process-group id ${pid}`)\n        }\n        return pid\n      }\n      const settled = await Promise.race([commandSettled, waitTick(this.pollMs).then(() => false)])\n      if (settled) throw new Error('subprocess-e2b: remote command exited before publishing its process-group id')\n    }\n  }\n\n  private async waitForCommand(\n    sandbox: Sandbox,\n    handle: CommandHandle,\n    completion: Promise<CommandResult>,\n  ): Promise<SubprocessOutcome> {\n    const settlement = completion.then<CommandSettlement, CommandSettlement>(\n      result => ({ kind: 'result', result }),\n      (error: unknown) => ({ kind: 'error', error }),\n    )\n    const hasPipeOutput = this.spec.stdio.stdout === 'pipe' || this.spec.stdio.stderr === 'pipe'","sourceCodeStart":484,"sourceCodeEnd":520,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/e2b/subprocess-e2b/src/process.ts#L484-L520","documentation":"Error \"subprocess-e2b: unsafe published process-group id ${pid}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/e2b/subprocess-e2b/src/process.ts:502 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}