Skip to content

Running redis-server under elfuse fails because /proc/self/smaps is unavailable #258

Description

@sunxiaoguang

Background

I tried to run redis-server as a Linux guest workload under elfuse. Redis failed during startup and exited intentionally:

31 Jul 2026 03:43:51.806 # Failed to test the kernel for a bug that could lead to data corruption during background save. Your system could be affected, please report this error.
31 Jul 2026 03:43:51.806 # Redis will now exit to prevent data corruption. Note that it is possible to suppress this warning by setting the following config: ignore-warnings ARM64-COW-BUG

Root cause

Redis performs its ARM64 copy-on-write safety check by reading /proc/self/smaps. elfuse currently exposes /proc/self/maps, but does not provide a Linux-compatible /proc/self/smaps (and the corresponding /proc/<pid>/smaps path), so Redis cannot inspect the mapping and dirty-page information it expects. Redis treats a failed check as unsafe and terminates to avoid possible data corruption during background saves.

This makes Redis unusable under elfuse even when the underlying system is not affected by the reported kernel bug.

Expected behavior

elfuse should provide a parseable, Linux-shaped /proc/self/smaps implementation, with the same VMA view and snapshot semantics as /proc/self/maps. The implementation should expose the fields required by Redis's COW check and derive the available values from elfuse's tracked guest VMAs and fork state. Values that cannot be observed precisely by the emulator should be documented as coarse compatibility values rather than presented as host page-accounting data.

Proposed scope

  • Generate /proc/self/smaps and /proc/<pid>/smaps from the tracked guest VMA list.
  • Emit Linux-compatible VMA headers and the standard smaps fields, including VmFlags.
  • Preserve fork-related COW information sufficiently for Redis's ARM64 safety check.
  • Keep /proc/self/maps and /proc/self/smaps consistent and ensure output is not truncated for larger VMA sets.
  • Add regression coverage that parses the synthetic smaps output and exercises the fork/COW accounting path.

smaps_rollup and exact host page-residency accounting are out of scope unless a consumer requires them.

Acceptance criteria

  1. redis-server starts successfully when run as a Linux workload under elfuse.
  2. Redis no longer reports the failed ARM64-COW-BUG kernel test solely because /proc/self/smaps is missing or malformed.
  3. Guest reads of /proc/self/smaps and /proc/<pid>/smaps return complete, parseable records for all tracked VMAs.
  4. Existing procfs and /proc/self/maps behavior remains compatible.
  5. Automated tests cover normal mappings, forked children, writable private anonymous mappings, and large VMA snapshots.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions