Skip to content

x/tools/go/pointer: sound models of sync/atomic Pointer[T] and Value #56918

@BarrensZeppelin

Description

@BarrensZeppelin

It would be nice to have sound pointer analysis models of the atomic primitives that contain pointers.
Currently the pointer analysis unsoundly ignores their use.

A failing test pointer analysis test go/pointer/testdata/atomic_value.go could be:

//go:build ignore
// +build ignore

package main

import "sync/atomic"

var g1 int

func main() {
	var v atomic.Value
	print(v.Load()) // @types
	v.Store(&g1)
	x := v.Load().(*int)
        // Fails because the points-to set of x is empty.
	print(x) // @pointsto command-line-arguments.g1
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.help wanted

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions