Skip to content

cmd/compile: walkConvInterface produces broken IR [1.19 backport] #56770

Closed

Description

@gopherbot

@cuonglm requested issue #56768 to be considered for backport to the next 1.19 minor release.

@gopherbot please backport this to go1.19

Some static initialization code causes the compiler to crash.

Activity

  1. added
    CherryPickCandidateUsed during the release process for point releases
    compiler/runtimeIssues related to the Go compiler and/or runtime.
    on Nov 16, 2022
  2. added this to the Go1.19.4 milestone on Nov 16, 2022
  3. toothrot commented on Nov 16, 2022

    @toothrot
    Contributor

    @cuonglm Hello! Could you please provide rationale as per https://go.dev/wiki/MinorReleases?

  4. cuonglm commented on Nov 16, 2022

    @cuonglm
    Member

    Hi @toothrot, I did add the rationale in the issue description:

    Some static initialization code causes the compiler to crash.

  5. gopherbot commented on Nov 18, 2022

    @gopherbot
    ContributorAuthor

    Change https://go.dev/cl/451875 mentions this issue: [release-branch.go1.19] cmd/compile: fix broken IR for iface -> eface

  6. cherrymui commented on Nov 23, 2022

    @cherrymui
    Member

    Similar to #56744 , we'd need better understanding to decide whether we should backport this. Thanks.

  7. aclements commented on Nov 30, 2022

    @aclements
    Member

    Maybe other people understand this, but I'm confused by how we weren't covering this code path in walkConvInterface before. It seems like this code path would always result in an ICE, but it's been around since 57668b8 (Aug 2021). Were we actually never taking this code path until the fix for #56727, or is there something I'm missing about that fix that makes this path in walkConvInterface construct bad IR?

  8. cuonglm commented on Nov 30, 2022

    @cuonglm
    Member

    Maybe other people understand this, but I'm confused by how we weren't covering this code path in walkConvInterface before. It seems like this code path would always result in an ICE, but it's been around since 57668b8 (Aug 2021). Were we actually never taking this code path until the fix for #56727, or is there something I'm missing about that fix that makes this path in walkConvInterface construct bad IR?

    Because after walkConvInterface produced bad IR, this bad IR is never typechecked, it's just pass to backend as-is. For OITAB, a generic pointer (*uintpr, *int32 ...) would satisfy the backend.

    There're many places in the walk pass that we produce an ir.Node then call SetTypecheck(1), instead of calling typecheck.{Stmt,Expr} on generated node.

  9. aclements commented on Nov 30, 2022

    @aclements
    Member

    Ah, so just to clarify further, we were taking that code path in walkConvInterface before, but only in places where where we also called SetTypecheck(1)?

  10. cuonglm commented on Dec 1, 2022

    @cuonglm
    Member

    Ah, so just to clarify further, we were taking that code path in walkConvInterface before, but only in places where where we also called SetTypecheck(1)?

    Yes. The problem is more hidden for walkConvInterface, since the bad IR is put into init nodes, so it's harder to trigger the bug. Only until the fix to order slice literal, walkStmtList is called on init nodes, the missing typecheck bug was reveal. Then to fix the missing typecheck bug, typecheck.Stmts was called, which reveal the type mismatch in itab assignment.

  11. modified the milestones: Go1.19.4, Go1.19.5 on Dec 6, 2022
  12. thanm commented on Dec 14, 2022

    @thanm
    Contributor

    discussed at the weekly meeting, approved

  13. added
    CherryPickApprovedUsed during the release process for point releases
    and removed
    CherryPickCandidateUsed during the release process for point releases
    on Dec 14, 2022
  14. gopherbot commented on Dec 28, 2022

    @gopherbot
    ContributorAuthor

    Closed by merging 5758a14 to release-branch.go1.19.

  15. added a commit that references this issue on Dec 28, 2022
    5758a14
  16. locked and limited conversation to collaborators on Dec 28, 2023
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

    CherryPickApprovedUsed during the release process for point releasesFrozenDueToAgecompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions