{"record":{"id":"430cf78b3c34227b","repo":"vllm-project/vllm","slug":"engine-start-index-engine-count-overflows","errorCode":null,"errorMessage":"engine start index + engine count overflows","messagePattern":"engine start index \\+ engine count overflows","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/src/server/src/config.rs","lineNumber":272,"sourceCode":"                    bail!(\n                        \"managed frontend engine count ({engine_count}) must equal data parallel size ({})\",\n                        self.data_parallel_size\n                    );\n                }\n            }\n            TransportMode::Bootstrapped {\n                engine_start_index,\n                engine_count,\n                ..\n            } => {\n                if *engine_count == 0 {\n                    bail!(\"engine count must be at least 1\");\n                }\n                let engine_start_index = usize::try_from(*engine_start_index)\n                    .map_err(|_| anyhow::anyhow!(\"engine start index does not fit usize\"))?;\n                let engine_end_index =\n                    engine_start_index.checked_add(*engine_count).ok_or_else(|| {\n                        anyhow::anyhow!(\"engine start index + engine count overflows\")\n                    })?;\n                if engine_end_index > self.data_parallel_size {\n                    bail!(\n                        \"connected engine range [{engine_start_index}, {engine_end_index}) exceeds data parallel size {}\",\n                        self.data_parallel_size\n                    );\n                }\n            }\n        }\n\n        Ok(())\n    }\n\n    /// Return the number of engines implied by the configured transport mode.\n    pub fn engine_count(&self) -> usize {\n        match &self.transport_mode {\n            TransportMode::HandshakeOwner { engine_count, .. }\n            | TransportMode::Bootstrapped { engine_count, .. } => *engine_count,","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/rust/src/server/src/config.rs#L254-L290","documentation":"Thrown by Config::validate() in Bootstrapped mode when engine_start_index + engine_count overflows usize (checked_add returns None). This guards against wraparound before the range is compared against data_parallel_size.","triggerScenarios":"Bootstrapped configuration with a huge start index or count (e.g. start near usize::MAX with count >= 1), almost always from uninitialized/garbage values or unit confusion rather than intent.","commonSituations":"Defaulting a config field to a sentinel like usize::MAX/-1 cast to usize; deserialization of a truncated or corrupted config; passing a 64-bit value where a smaller one was intended.","solutions":["Set engine_start_index + engine_count to a small realistic range within data_parallel_size.","Validate the computed slice bounds in the launcher before passing them to the frontend.","Inspect the raw config source for corrupted or sentinel values (e.g. usize::MAX)."],"exampleFix":"# before\nengine_start_index = 18446744073709551615, engine_count = 1\n\n# after\nengine_start_index = 0, engine_count = 4","handlingStrategy":"validation","validationCode":"let end = usize::try_from(start)\n    .ok()\n    .and_then(|s| s.checked_add(count));\nassert!(end.is_some(), \"engine range overflows\");","typeGuard":"fn engine_range_fits(start: i64, count: usize) -> bool {\n    usize::try_from(start).map_or(false, |s| s.checked_add(count).is_some())\n}","tryCatchPattern":null,"preventionTips":["Reject sentinel values (usize::MAX, -1 casts) at config parse time.","Bound start and count by data_parallel_size before combining them.","Log assignments for each frontend before launch."],"tags":["configuration","transport","bootstrap","overflow","rust","vllm","startup"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}