Skip to content

[vm] AppJIT snapshot loses ImmutableBit of objects #55136

Closed
@dcharkes

Description

@dcharkes

I believe we don't set the ImmutableBit when deserializing from appjit snapshots.

void Deserializer::InitializeHeader(ObjectPtr raw,
intptr_t class_id,
intptr_t size,
bool is_canonical) {
ASSERT(Utils::IsAligned(size, kObjectAlignment));
uword tags = 0;
tags = UntaggedObject::ClassIdTag::update(class_id, tags);
tags = UntaggedObject::SizeTag::update(size, tags);
tags = UntaggedObject::CanonicalBit::update(is_canonical, tags);
tags = UntaggedObject::AlwaysSetBit::update(true, tags);
tags = UntaggedObject::NotMarkedBit::update(true, tags);
tags = UntaggedObject::OldAndNotRememberedBit::update(true, tags);
tags = UntaggedObject::NewBit::update(false, tags);
raw->untag()->tags_ = tags;
}

This leads to objects being copied instead of being shared on SendPort.send.

cc @mkustermann

Edit: Can be exercised with https://dart-review.googlesource.com/c/sdk/+/354902/17..18 and tools/build.py -mdebug create_platform_sdk runtime && tools/test.py -n vm-appjit-linux-debug-x64 lib/isolate/illegal_msg_mirror_test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.triagedIssue has been triaged by sub team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions