{"record":{"id":"3d8cd7dfafeac4b2","repo":"nodejs/node","slug":"present-value-is-s","errorCode":null,"errorMessage":"Present value is %s","messagePattern":"Present value is (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"deps/v8/tools/run_perf.py","lineNumber":1089,"sourceCode":"      with open('/proc/sys/kernel/randomize_va_space', 'r') as f:\n        return int(f.readline().strip())\n    except Exception:\n      logging.exception('Failed to get current ASLR settings.')\n      raise\n\n  @staticmethod\n  def SetASLR(value):\n    try:\n      with open('/proc/sys/kernel/randomize_va_space', 'w') as f:\n        f.write(str(value))\n    except Exception:\n      logging.exception(\n          'Failed to update ASLR to %s. Are we running under sudo?', value)\n      raise\n\n    new_value = CustomMachineConfiguration.GetASLR()\n    if value != new_value:\n      raise Exception('Present value is %s' % new_value)\n\n  @staticmethod\n  def GetCPUCoresRange():\n    try:\n      with open('/sys/devices/system/cpu/present', 'r') as f:\n        indexes = f.readline()\n        r = list(map(int, indexes.split('-')))\n        if len(r) == 1:\n          return list(range(r[0], r[0] + 1))\n        return list(range(r[0], r[1] + 1))\n    except Exception:\n      logging.exception('Failed to retrieve number of CPUs.')\n      raise\n\n  @staticmethod\n  def GetCPUPathForId(cpu_index):\n    ret = '/sys/devices/system/cpu/cpu'\n    ret += str(cpu_index)","sourceCodeStart":1071,"sourceCodeEnd":1107,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/v8/tools/run_perf.py#L1071-L1107","documentation":"Thrown by CustomMachineConfiguration.SetASLR in run_perf.py after writing a value to /proc/sys/kernel/randomize_va_space and reading it back: the read-back value differs from what was requested, so the kernel rejected or ignored the write. ASLR is pinned for benchmark reproducibility, so a mismatch aborts the run.","triggerScenarios":"SetASLR(value) is called (typically to disable ASLR for stable perf numbers); the write succeeds without exception but GetASLR() returns a different value. Common when not running as root (write silently fails or is buffered), when a security module (lockdown, GRKERNSEC) blocks the change, or inside a container/VM where /proc/sys is read-only.","commonSituations":"Running ./run_perf.py without sudo; running inside Docker/containerd where /proc/sys/kernel/randomize_va_space is mounted read-only or virtualized; kernel hardening that pins ASLR.","solutions":["Run the perf harness as root (sudo) so the write to /proc/sys/kernel/randomize_va_space takes effect.","If in a container, run with --privileged or mount /proc/sys read-write and confirm the host kernel allows the change.","Check for kernel lockdown / SELinux / AppArmor policies that block randomize_va_space writes and relax them for the benchmark host.","Manually verify with: sudo bash -c 'echo 0 > /proc/sys/kernel/randomize_va_space' then cat the file to confirm it stuck."],"exampleFix":"# before\n./run_perf.py --d8-path=out/Release/d8 suite.json\n# after\nsudo ./run_perf.py --d8-path=out/Release/d8 suite.json","handlingStrategy":"validation","validationCode":"import os\ndef can_set_aslr() -> bool:\n    p = '/proc/sys/kernel/randomize_va_space'\n    if not os.path.isfile(p):\n        return False\n    if os.access(p, os.W_OK):\n        return True\n    return os.geteuid() == 0  # will be writable once privileged","typeGuard":"null","tryCatchPattern":"try:\n    CustomMachineConfiguration.SetASLR(0)\nexcept Exception as e:\n    logging.warning('ASLR could not be pinned (%s); perf numbers may be noisy. Re-run with sudo / privileged container.', e)","preventionTips":["Run perf benchmarks as root or in a privileged container.","Pre-check writability of /proc/sys/kernel/randomize_va_space before the run.","Disable ASLR manually (sudo sysctl kernel.randomize_va_space=0) and confirm before launching the harness."],"tags":["v8","perf-test","aslr","privilege","linux"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}