Skip to content

MIR inlining does not handle SourceScopeLocalData #66137

Closed

Description

@Aaron1011

During the MIR inlining pass, we add scopes from the callee to Body.source_scopes in the caller. However, we do not update source_scope_local_data, which causes any inlined scopes to have no entry in the caller source_scope_local_data. This causes an ICE in Miri when we try to generate a stacktrace - however, the ICE occurs in rustc code, so it's possible that we might run across this without Miri.

Activity

  1. changed the title [-]MIR inlinging does not handle `SourceScopeLocalData`[/-] [+]MIR inlining does not handle `SourceScopeLocalData`[/+] on Nov 5, 2019
  2. added
    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
    C-bugCategory: This is a bug.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Nov 5, 2019
  3. added
    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)
    on Nov 6, 2019
  4. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    on Nov 6, 2019
  5. eddyb commented on Nov 6, 2019

    @eddyb
    Contributor

    Sounds like a simple enough omission, but I'm surprised this doesn't break any of our mir-opt tests.

  6. Aaron1011 commented on Nov 6, 2019

    @Aaron1011
    ContributorAuthor

    I don't think this is E-Easy - source_scope_local_data is crate local, and it's not immediately obvious to me what the correct beehvaior is for cross-crate inlining.

  7. Dylan-DPC-zz commented on Nov 13, 2019

    @Dylan-DPC-zz
  8. added a commit that references this issue on Nov 13, 2019
    dadd817
  9. eddyb commented on Nov 13, 2019

    @eddyb
    Contributor

    @Aaron1011 Oh, I thought the concern was entirely about same-crate, sorry!

    I think the fix in that case is to move the ClearCrossCrate inward, i.e. change SourceScopeData to contain a ClearCrossCrate<SourceScopeLocalData> - I don't think the size of SourceScopeData is critical (but we should run perf anyway).

  10. Aaron1011 commented on Nov 14, 2019

    @Aaron1011
    ContributorAuthor

    @eddyb: SourceScopeData doesn't contain SourceScopeLocalData. Your change would require wrapping both fields of SourceScopeLocalData in ClearCrossCrate, since SourceScopeLocalData is stored in an IndexVec in Body.source_scope_local_data

  11. Aaron1011 commented on Nov 14, 2019

    @Aaron1011
    ContributorAuthor

    Oops, I misread your proposal - you were talking about changing SourceScopeData to contain a SourceScopeLocalData. I'll try that.

  12. oli-obk commented on Dec 29, 2019

    @oli-obk
    Contributor

    This was fixed in #66789 as far as I can tell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions