Skip to content

Fix address and stride calculation bug in mincore_benchmark. - #1023

Draft
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_984208847
Draft

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_984208847

Conversation

@copybara-service

Copy link
Copy Markdown

Fix address and stride calculation bug in mincore_benchmark.

mincore was called with invalid memory address 0 (NULL), causing every syscall
to return ENOMEM (-1). In addition, length was already in bytes (size * kHardwarePageSize),
so advancing memory += length * kHardwarePageSize caused a double-multiplication
error that skipped 1 GiB on the first step for size >= 64.

Allocate an anonymous mmap region and advance the scan offset by length.

mincore was called with invalid memory address 0 (NULL), causing every syscall
to return ENOMEM (-1). In addition, length was already in bytes (size * kHardwarePageSize),
so advancing memory += length * kHardwarePageSize caused a double-multiplication
error that skipped 1 GiB on the first step for size >= 64.

Allocate an anonymous mmap region and advance the scan offset by length.

PiperOrigin-RevId: 984208847
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant