Skip to content

ILLink produces invalid IL metadata with -b switch and Save assembly mode #86462

Closed

Description

@filipnavara

As part of testing dotnet/macios#18268 we hit an odd case where invalid IL is produced as the output of ILLink, resulting in later crash when post-processing the data with ILStrip. There's actually several issues at play here:

Repro:

Observations:

  • Tested with .NET 7.0.302 and .NET 8.0 Preview 5 linkers. The issue exists in both. On .NET 8 the original test case produces different linker input and doesn't hit the problem, but the underlying bug still exists.
  • Removing the -b switch from linker.rsp makes the problem go away

cc @rolfbjarne @ivanpovazan

Activity

  1. added
    area-Tools-ILLink
    on May 18, 2023
  2. ghost added
    untriaged
    on May 18, 2023
  3. filipnavara commented on May 18, 2023

    @filipnavara
    Author
  4. filipnavara commented on May 19, 2023

    @filipnavara
    MemberAuthor

    I realized that I forgot to include the .pdb in the repro package. That's essential for the error to occur. Here's a fixed one:
    extra-typeref-linker.zip

  5. filipnavara commented on May 19, 2023

    @filipnavara
    MemberAuthor

    This fixes the output for me: filipnavara@7cca2fa

    Unit tests will be easier to write once #86474 lands.

  6. filipnavara commented on May 22, 2023

    @filipnavara
    MemberAuthor

    This is similar to this old issue btw: dotnet/linker#399

  7. filipnavara commented on Jun 8, 2023

    @filipnavara
    MemberAuthor

    @vitek-karas This should be rather trivial to fix. I suppose that I can take a stab at it if you are busy...

  8. vitek-karas commented on Jun 9, 2023

    @vitek-karas
    Member

    I'm definitely busy with other commitments... maybe @sbomer can take a look.
    Or if you want to tackle it - we would be happy to help of course.

  9. sbomer commented on Jun 9, 2023

    @sbomer
    Member

    Would love it if you were able to contribute a fix. :) Otherwise I can take a look next week.

  10. self-assigned this
    on Jun 12, 2023
  11. ghost added
    in-pr
    on Jun 14, 2023
  12. ghost removed
    in-pr
    on Jun 16, 2023
  13. ghost removed
    untriaged
    on Jun 16, 2023
  14. ghost locked as resolved and limited conversation to collaborators on Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-Tools-ILLink

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions