Skip to content

feat(instrument): Use compiler escape analysis via gcflags -m (Option F) #25

@kolkov

Description

@kolkov

Summary

Integrate Go compiler escape analysis output to achieve 100% accuracy.

Approach

go build -gcflags="-m" main.go
./main.go:10:5: moved to heap: x           # INSTRUMENT
./main.go:15:13: new(int) does not escape  # SKIP

Implementation Plan

  1. Parse go build -gcflags="-m" output
  2. Extract file:line -> escapes mapping
  3. Skip instrumentation for non-escaping variables
  4. Create toolexec wrapper for seamless integration

Expected Results

  • False Positives: 0% (was ~5-10%)
  • TSAN Parity: 100% (was ~75%)
  • Code Added: ~100-200 lines

Research

  • docs/dev/research-reports/PROFESSIONAL_INTEGRATION_STRATEGY.md
  • docs/dev/research-reports/COMPILER_VENDORING_APPROACH.md

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions