facebook / facebook/folly

mmap set offset = 4096 will fail

Open
#2,374 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
30.5k
Forks
5.9k
PR merge metrics
No merged PRs in 30d

Description

std::string fileData;
size_t fileSize = sysconf(_SC_PAGESIZE) * 100 + 10;
fileData.reserve(fileSize);
for (size_t i = 0; i < fileSize; i++) {
fileData.push_back(0xff & Random::rand32());
}

File f = File::temporary();
writeStringToFileOrDie(fileData, f.fd());
std::cout << "fileSize" << fileSize << std::endl;
MemoryMapping m(File(f.fd()), 4096, 8193);

Contributor guide

Open the contributing guide

Research direction

Reproduce the provided case using the MemoryMapping entry point with a page offset of 4096 and a length of 8193. Trace where the mapping rejects or mishandles that offset, then verify that the reported case completes successfully without regressing other offset or length behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.