deepseek-ai / deepseek-ai/3FS

Potential Race Condition in Memory Allocator Initialization

Open
#315 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
10.2k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Code:
https://github.com/deepseek-ai/3FS/blob/main/src/memory/common/GlobalMemoryAllocator.cc#L76C2-L76C4

Image

Issue Details:
Instruction reordering: gAllocatorInited = true may execute before std::call_once
Memory visibility: gAllocatorInited is not atomic, causing visibility issues across cores
Race condition: Other threads may see gAllocatorInited = true while the allocator is still uninitialized

May be this is an issue.

Contributor guide

No contributing guide indexed for this repository

Research direction

Read src/memory/common/GlobalMemoryAllocator.cc around line 76, then trace the initialization path and every use of gAllocatorInited. Check whether std::call_once provides the required ordering and whether other threads can observe the flag before the allocator is ready. Done means confirming the race or showing that initialization and visibility are safe, with a focused regression test if the issue is reproduced.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.