mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[PR #736] fix: return default_value from get_env<int> on unparsable env values #743
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepEP#743
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepEP/pull/736
Author: @shoemoney
Created: 8/23/2026
Status: 🔄 Open
Base:
main← Head:fix/get-env-uninitialized📝 Commits (1)
8686bd5fix: return default_value from get_env on unparsable env values📊 Changes
1 file changed (+3 additions, -2 deletions)
View changed files
📝
csrc/utils/system.hpp(+3 -2)📄 Description
get_env<int>(csrc/utils/system.hpp) declaredint value;uninitialized and ignored sscanf's return value. Any env value%dcannot parse (true,false,on,off, empty string) returned indeterminate stack memory instead of falling back todefault_value. In practice the garbage is usually non-zero, soEP_BUFFER_DEBUG=falsereads as enabled. This helper backs 20+ env reads across the codebase.The fix initializes
valuetodefault_valueand returnsdefault_valuewhen sscanf does not report a successful conversion.Verified with a standalone host build of the header: before the change,
EP_X=falsewith default 7 returned 1 (uninitialized stack); after, it returns 7,EP_X=42returns 42, and unset still returns the default.Fixes #733
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.