Skip to content

Reproducible snapshot error #304

Closed
Closed

Description

@targos

Seems arm-specific: https://github.com/nodejs/node-v8/actions/runs/19205829620/job/54900847817

@joyeecheung

=== release test-snapshot-reproducible ===
Path: parallel/test-snapshot-reproducible
Error: --- stderr ---
node:internal/assert/utils:146
  throw error;
  ^

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

+ [
+   {
+     offset: '0x2ffec0',
+     slice1: '06000400000000000300000059ab0000',
+     slice2: '060004000000000003000000b8aa0000'
+   },
+   {
+     offset: '0x476eb0',
+     slice1: '00000059ab0000580701106100000000',
+     slice2: '000000b8aa0000580701106100000000'
+   }
+ ]
- []

    at Object.<anonymous> (/home/runner/work/node-v8/node-v8/node/test/parallel/test-snapshot-reproducible.js:69:8)
    at Module._compile (node:internal/modules/cjs/loader:1760:14)
    at Object..js (node:internal/modules/cjs/loader:1892:10)
    at Module.load (node:internal/modules/cjs/loader:1480:32)
    at Module._load (node:internal/modules/cjs/loader:1299:12)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
    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: [
    {
      offset: '0x2ffec0',
      slice1: '06000400000000000300000059ab0000',
      slice2: '060004000000000003000000b8aa0000'
    },
    {
      offset: '0x476eb0',
      slice1: '00000059ab0000580701106100000000',
      slice2: '000000b8aa0000580701106100000000'
    }
  ],
  expected: [],
  operator: 'deepStrictEqual',
  diff: 'simple'
}

Node.js v26.0.0-pre
--- stdout ---
0x0: Write magic 143da19
0x4: Write metadata
0x35: Write snapshot blob
0x258bfc: Write IsolateDataSerializeInfo
0x25a299: Write EnvSerializeInfo
0x25b1c0: Write CodeCacheInfo
0x0: Write magic 143da19
0x4: Write metadata
0x35: Write snapshot blob
0x258bfc: Write IsolateDataSerializeInfo
0x25a299: Write EnvSerializeInfo
0x25b1c0: Write CodeCacheInfo
Command: out/Release/node /home/runner/work/node-v8/node-v8/node/test/parallel/test-snapshot-reproducible.js

===
=== 1 tests failed
===

Failed tests:
out/Release/node /home/runner/work/node-v8/node-v8/node/test/parallel/test-snapshot-reproducible.js

Activity

  1. targos commented on Nov 15, 2025

    @targos
    MemberAuthor

    Still happening.
    Looking at https://github.com/nodejs/node-v8/actions/workflows/test-linux.yml:

  2. targos commented on Nov 15, 2025

    @targos
    MemberAuthor

    I suspect v8/v8@db44401
    It was relanded on Oct 28, reverted on Oct 29, and relanded again on Oct 30.

  3. targos commented on Dec 2, 2025

    @targos
    MemberAuthor
  4. joyeecheung commented on Dec 2, 2025

    @joyeecheung
    Member

    Looks like the code cache reproducibility is altered by some recent change, going to take a look when I get back to a powerful enough build machine..

  5. targos commented on Dec 13, 2025

    @targos
    MemberAuthor
  6. joyeecheung commented on Dec 16, 2025

    @joyeecheung
    Member

    Looks like it broke the code cache reproducibility somehow

    < Write<builtins::CodeCacheInfo>() id = internal/errors, length=97160, hash=3258954470
    > Write<builtins::CodeCacheInfo>() id = internal/errors, length=97160, hash=2884610497
    
  7. targos commented on Dec 17, 2025

    @targos
    MemberAuthor

    It's more complex than this. If I revert that commit on the V8 14.4 update branch, the test still fails.

  8. joyeecheung commented on Dec 17, 2025

    @joyeecheung
    Member

    I noticed that the debug build has been failing on canary, this gyp change should fix it: https://github.com/joyeecheung/node/tree/fix-debug - where should I submit this?

  9. joyeecheung commented on Dec 17, 2025

    @joyeecheung
    Member

    Also opened nodejs/node#61101 to help diffing the snapshots

  10. joyeecheung commented on Dec 17, 2025

    @joyeecheung
    Member

    It seems the diffing object is a class boilerplate, or it appears to be its static_properties_template

    0x224633025a69: [ClassBoilerplate] in OldSpace
     - map: 0x0ec5791c1f89 <Map[64](CLASS_BOILERPLATE_TYPE)>
     - arguments_count: 3
     - static_properties_template: 0x224633025969 <DescriptorArray[4]>
     - static_elements_template: 0x0ec5791c8f99 <NumberDictionary[7]>
     - static_computed_properties: 0x0ec5791c0dd1 <FixedArray[0]>
     - instance_properties_template: 0x224633025a31 <DescriptorArray[1]>
     - instance_elements_template: 0x0ec5791c8f99 <NumberDictionary[7]>
     - instance_computed_properties: 0x0ec5791c0dd1 <FixedArray[0]>
    

    I have a feeling that it might be the same as the bug fixed by https://chromium-review.googlesource.com/c/v8/v8/+/7252791, only that this happens to the descriptor array instead of transition array. Looknig..

  11. joyeecheung commented on Dec 17, 2025

    @joyeecheung
    Member

    I can fix it locally with this:

    diff --git a/deps/v8/src/objects/objects.cc b/deps/v8/src/objects/objects.cc
    index aa3c306212..5e8a1ed3c9 100644
    --- a/deps/v8/src/objects/objects.cc
    +++ b/deps/v8/src/objects/objects.cc
    @@ -3997,6 +3997,9 @@ void DescriptorArray::Initialize(Tagged<EnumCache> empty_enum_cache,
       set_enum_cache(empty_enum_cache, SKIP_WRITE_BARRIER);
       set_flags(FastIterableBits::encode(FastIterableState::kUnknown),
                 kRelaxedStore);
    +#if TAGGED_SIZE_8_BYTES
    +  set_optional_padding(0);
    +#endif
       MemsetTagged(GetDescriptorSlot(0), undefined_value,
                    number_of_all_descriptors() * kEntrySize);
     }

    Going to upstream it

  12. targos commented on Dec 18, 2025

    @targos
    MemberAuthor

    I noticed that the debug build has been failing on canary, this gyp change should fix it: https://github.com/joyeecheung/node/tree/fix-debug - where should I submit this?

    You can directly cherry-pick and push it to canary-base

  13. joyeecheung commented on Dec 18, 2025

    @joyeecheung
    Member

    You can directly cherry-pick and push it to canary-base

    Done, thanks for the pointer

  14. joyeecheung commented on Dec 18, 2025

    @joyeecheung
    Member
  15. added a commit that references this issue on Dec 22, 2025
  16. targos commented on Dec 22, 2025

    @targos
    MemberAuthor

    Thanks for the investigation and fix @joyeecheung !

  17. added a commit that references this issue on Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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