Skip to content

rustlantis: make uninit reference invalidation transitive #1158

Closed

Description

@uurl

Problem

PlaceGraph::mark_place_uninit currently removes the outgoing Deref edge only when the place being marked uninitialized is itself a pointer:

// If this is a pointer, we have to remove the Deref edge, but not for other projections
// FIXME: this should be transitive

This leaves stale Deref edges when an aggregate containing references or raw pointers is marked uninitialized.

For example, if a tuple contains nested pointer values, marking the tuple uninitialized clears its storage but does not invalidate the pointer relationships represented by those nested nodes.

Expected behavior

When a place is marked uninitialized, outgoing Deref edges belonging to pointer/reference values contained transitively in that place should also be removed.

Incoming Deref edges from pointer/reference values outside the place should
not be removed by this operation. Those pointers retain their graph relationship
to the place, while their validity reflects the pointee becoming uninitialized.

Suggested approach

Traverse the structural subfields of the place independently from the existing memory-initialization traversal and remove outgoing Deref edges from every pointer/reference node encountered.

A separate traversal is needed because the current memory traversal stops once it reaches a node backed by a RunPointer.

Acceptance criteria

  • Marking a nested aggregate uninitialized removes outgoing Deref edges from contained references.
  • The same applies to contained raw pointers.
  • Incoming Deref edges from pointer/reference values outside the aggregate are preserved.
  • Existing initialization/uninitialization behavior remains unchanged.
  • A regression test covers the transitive case.

Activity

  1. added
    bug
    fuzzer
    on Aug 24, 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

    bugfuzzer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions