Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

`parallel/test-snapshot-reproducible` fails when ASLR is enabled

未关闭
#63,914 1 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
冷清
技术栈
javascript, linux, node.js

调研方向

从 test/parallel/test-snapshot-reproducible.js 开始,尤其关注第 47 行的 assertion。将 Linux ASLR 设置为 1 或 2,然后使用 ./configure && make 重现问题,接着将生成的 snapshot 与禁用 ASLR 时的结果进行比较。当失败已修复,或已将其缩小为有文档记录的 V8 或环境特定原因,并有明确的下一步时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

snapshot test

Testing main on linux:

# sysctl -w kernel.randomize_va_space=2
$ ./configure && make && ./node test/parallel/test-snapshot-reproducible.js
node:internal/assert/utils:146
  throw error;
  ^

AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected
... Skipped lines

  [
    '#include <cstddef>',
    '#include "env.h"',
    '#include "node_snapshot_builder.h"',
    '#include "v8.h"',
...
    'namespace node {',
+   'static const char v8_snapshot_blob_data[] = {4,0,0,0,1,0,0,0,43,108,-20,-8,-43,-25,-94,-55,49,52,46,54,46,50,48,50,46,51,52,45,110,111,100,101,46,50,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  // 0',
-   'static const char v8_snapshot_blob_data[] = {4,0,0,0,1,0,0,0,-99,103,75,7,-43,-25,-94,-55,49,52,46,54,46,50,48,50,46,51,52,45,110,111,100,101,46,50,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  // 0',
    '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,10,23,0,64,8,25,0,72,114,29,0,8,107,30,0,-120,98,31,0,-40,88,32,0,-85,6,-34,-64,-96,9,23,0,-83,24,96,0,0,0,0,86,0,0,0,96,0,0,0,0,  // 1',
    '0,0,0,0,96,0,0,0,0,0,0,0,0,96,0,0,0,0,-53,1,0,0,96,0,0,0,0,-84,1,0,0,96,0,0,0,0,-64,2,0,0,96,0,0,0,0,0,0,0,0,96,0,0,0,0,-30,0,0,0,11,5,24,98,0,2,  // 2',
    '5,24,34,1,2,5,24,-30,1,2,5,24,-94,2,2,5,24,98,3,2,5,24,34,4,2,5,24,-30,4,2,5,24,-94,5,2,5,24,98,6,2,5,24,34,7,2,5,24,-30,7,2,5,24,-94,8,2,5,24,98,9,2,1,76,7,101,  // 3',
    '15,69,64,97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,98,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,64,96,0,0,0,0,0,0,0,0,7,-123,2,64,96,0,0,0,  // 4',
    '0,8,0,0,0,-127,0,91,64,1,20,83,69,97,0,0,0,0,96,0,0,0,0,0,0,0,1,0,0,0,93,1,20,83,69,97,0,0,0,0,96,0,0,0,0,0,0,0,1,0,0,0,93,1,20,83,69,97,0,0,0,0,96,0,  // 5',
...
    '26,-87,22,26,-11,27,26,93,28,26,101,28,26,105,34,26,69,37,26,73,37,26,77,37,26,81,37,26,85,37,26,89,37,26,93,37,26,97,37,26,101,37,26,-87,43,26,-83,43,26,-71,43,1,20,86,98,0,0,0,0,3,0,0,0,0,  // 42996',
+   '0,0,0,1,0,0,0,0,0,0,0,14,0,0,0,64,91,31,0,6,-71,2,5,24,66,66,4,4,8,95,4,73,33,11,15,0,-3,15,0,8,6,0,0,-3,15,4,96,6,-86,-127,-107,44,127,0,0,24,0,0,0,0,0,0,0,47,  // 42997',
+   '0,0,0,0,0,0,0,0,-107,26,0,8,8,0,0,-107,26,4,64,8,-102,-74,95,5,0,0,0,16,0,0,0,0,0,0,0,0,-99,39,0,8,2,0,0,-99,39,4,-64,2,-102,-74,95,5,0,0,0,48,0,0,0,0,0,0,0,51,  // 42998',
+   '0,0,0,0,0,0,0,52,0,0,0,0,0,0,0,53,0,0,0,0,0,0,0,54,0,0,0,0,0,0,0,0,-67,49,0,8,7,0,0,-67,49,4,64,7,-102,-74,95,5,0,0,0,16,0,0,0,0,0,0,0,0,-123,56,0,8,  // 42999',
+   '9,0,0,-123,56,4,64,9,-101,-74,95,5,0,0,0,16,0,0,0,0,0,0,0,0,-59,79,-128,32,32,0,0,0,0,0,0,0,0,-59,79,-108,32,37,0,0,0,0,0,0,0,0,-59,79,-104,32,38,0,0,0,0,0,0,0,0,-59,  // 43000',
+   '79,-100,32,39,0,0,0,0,0,0,0,0,-91,108,0,8,3,0,0,-91,108,4,96,3,-86,-127,-107,44,127,0,0,24,0,0,0,0,0,0,0,43,0,0,0,0,0,0,0,0,-75,108,0,8,0,0,0,-75,108,4,96,0,-102,-74,95,5,  // 43001',
+   '0,0,0,24,0,0,0,0,0,0,0,45,0,0,0,0,0,0,0,0,-67,108,0,8,5,0,0,-67,108,4,64,5,114,5,54,-2,85,0,0,16,0,0,0,0,0,0,0,0,-51,108,0,8,1,0,0,-51,108,4,96,1,-102,-74,95,5,  // 43002',
-   '0,0,0,1,0,0,0,0,0,0,0,14,0,0,0,64,91,31,0,6,-71,2,5,24,66,66,4,4,8,95,4,73,33,11,15,0,-3,15,0,8,6,0,0,-3,15,4,96,6,-86,33,30,70,127,0,0,24,0,0,0,0,0,0,0,47,  // 42997',
-   '0,0,0,0,0,0,0,0,-107,26,0,8,8,0,0,-107,26,4,64,8,36,-106,100,5,0,0,0,16,0,0,0,0,0,0,0,0,-99,39,0,8,2,0,0,-99,39,4,-64,2,36,-106,100,5,0,0,0,48,0,0,0,0,0,0,0,51,  // 42998',
-   '0,0,0,0,0,0,0,52,0,0,0,0,0,0,0,53,0,0,0,0,0,0,0,54,0,0,0,0,0,0,0,0,-67,49,0,8,7,0,0,-67,49,4,64,7,36,-106,100,5,0,0,0,16,0,0,0,0,0,0,0,0,-123,56,0,8,  // 42999',
-   '9,0,0,-123,56,4,64,9,36,-106,100,5,0,0,0,16,0,0,0,0,0,0,0,0,-59,79,-128,32,32,0,0,0,0,0,0,0,0,-59,79,-108,32,37,0,0,0,0,0,0,0,0,-59,79,-104,32,38,0,0,0,0,0,0,0,0,-59,  // 43000',
-   '79,-100,32,39,0,0,0,0,0,0,0,0,-91,108,0,8,3,0,0,-91,108,4,96,3,-86,33,30,70,127,0,0,24,0,0,0,0,0,0,0,43,0,0,0,0,0,0,0,0,-75,108,0,8,0,0,0,-75,108,4,96,0,36,-106,100,5,  // 43001',
-   '0,0,0,24,0,0,0,0,0,0,0,45,0,0,0,0,0,0,0,0,-67,108,0,8,5,0,0,-67,108,4,64,5,-52,-33,6,76,86,0,0,16,0,0,0,0,0,0,0,0,-51,108,0,8,1,0,0,-51,108,4,96,1,36,-106,100,5,  // 43002',
    '0,0,0,24,0,0,0,0,0,0,0,57,0,0,0,0,0,0,0,11,10,10,10,10',
    '};',
    'static const int v8_snapshot_blob_size = 2752216;',
    'static const uint8_t vm_cache_data[] = {171,6,222,192,82,189,255,151,217,50,0,32,97,100,152,163,213,231,162,201,96,21,0,0,0,0,0,0,0,0,0,0,1,36,81,3,109,1,7,196,96,0,0,0,0,151,2,0,0,1,8,7,33,15,4,4,33,3,112,7,181,1,122,0,  // 0',
    '0,0,0,205,0,0,0,2,4,6,0,179,5,156,36,26,100,22,64,26,76,26,68,26,64,23,220,3,14,0,22,203,2,22,80,26,60,22,112,27,216,3,14,0,22,104,22,203,2,26,124,27,168,9,14,0,22,143,7,26,68,26,76,26,  // 1',

    at Object.<anonymous> (/node/test/parallel/test-snapshot-reproducible.js:47:8)
    at Module._compile (node:internal/modules/cjs/loader:1947:14)
    at Object..js (node:internal/modules/cjs/loader:2087:10)
    at Module.load (node:internal/modules/cjs/loader:1669:32)
    at Module._load (node:internal/modules/cjs/loader:1450:12)
    at wrapModuleLoad (node:internal/modules/cjs/loader:260:19)
    at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
    at node:internal/main/run_main_module:33:47 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: [ <skipped> ],
  expected: [ <skipped> ],
  operator: 'deepStrictEqual',
  diff: 'simple'
}

Node.js v27.0.0-pre

Reproducible locally with gcc 15.3.0 and 16.1.1.
The byteranges that differ are randomized so the exact bytes are different each time. Everything else seems to be consistent.
Completely disabling ASLR (setting kernel/randomize_va_space to 0) makes the test pass. Conservative ASLR (1) still breaks it.

Not exactly sure when this started (maybe some of v8 upgrades?) nor whether it can be fixed (maybe on v8 side?) nor what else causes this (test passes on CI so i assume there's additional factor to it).

主要语言
JavaScript
星标
122k
派生
37.4k
平均合并
4 天 2 小时
30 天内合并 PR
277

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nodejs/node 的其他 Issue

查看 nodejs/node 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。