{"record":{"id":"5b5f227a12cf9a78","repo":"deepseek-ai/deepseek-harness","slug":"startupinfow-layout-mismatch-koffi-computed-sta","errorCode":null,"errorMessage":"STARTUPINFOW layout mismatch: koffi computed ${STARTUPINFOW.size}, header probe says ${abi.STARTUPINFOW_SIZE}","messagePattern":"STARTUPINFOW layout mismatch: koffi computed (.+?), header probe says (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/sandbox/sandbox-windows-acl/src/ffi.ts","lineNumber":173,"sourceCode":"  wShowWindow: 'uint16',\n  cbReserved2: 'uint16',\n  lpReserved2: koffi.pointer('uint8'),\n  hStdInput: PVOID,\n  hStdOutput: PVOID,\n  hStdError: PVOID,\n})\n\n/** koffi PROCESS_INFORMATION layout; its size is asserted against abi.PROCESS_INFORMATION_SIZE at load. */\nexport const PROCESS_INFORMATION = koffi.struct('PROCESS_INFORMATION', {\n  hProcess: PVOID,\n  hThread: PVOID,\n  dwProcessId: 'uint32',\n  dwThreadId: 'uint32',\n})\n\n/* v8 ignore start -- layout-mismatch guards fire only on ABI breakage; verify/abi-probe.cpp pins both sizes. */\nif (STARTUPINFOW.size !== abi.STARTUPINFOW_SIZE) {\n  throw new Error(`STARTUPINFOW layout mismatch: koffi computed ${STARTUPINFOW.size}, header probe says ${abi.STARTUPINFOW_SIZE}`)\n}\nif (PROCESS_INFORMATION.size !== abi.PROCESS_INFORMATION_SIZE) {\n  throw new Error(`PROCESS_INFORMATION layout mismatch: koffi computed ${PROCESS_INFORMATION.size}, header probe says ${abi.PROCESS_INFORMATION_SIZE}`)\n}\n/* v8 ignore stop */\n\n/**\n * Allocate one pointer-sized slot (for `T **` out-parameters).\n * @returns the allocated slot pointer.\n */\nexport function allocPtrSlot(): NativePtr {\n  const value: unknown = koffi.alloc(PVOID, 1)\n  return value as NativePtr\n}\n\n/**\n * Allocate one uint32 slot.\n * @returns the allocated slot pointer.","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/sandbox/sandbox-windows-acl/src/ffi.ts#L155-L191","documentation":"Error \"STARTUPINFOW layout mismatch: koffi computed ${STARTUPINFOW.size}, header probe says ${abi.STARTUPINFOW_SIZE}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/sandbox/sandbox-windows-acl/src/ffi.ts:173 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rebuild or update the addon/koffi so the STARTUPINFOW struct size matches the header ABI probe."],"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"}