Skip to content

Failure in Regressions/coreclr/GitHub_35000/test35000/test35000.sh #47294

Closed

Description

@sandreenko

There was exposed by #46665, the test is failing with:

((srcStackByteOffset % TARGET_POINTER_SIZE) == 0) && "NYI: does not support shuffling of such args"

added here #46665 (comment)

the test is creating a delegate with types:

this, int, int, int, int, int, int, int, int, object g

and then call a method declared as:

this int a, int b, int c, int d, int e, int f, int g, int h

so the first 8 arguments are passed in registers and we are left with:

int, int

vs

int, obj

on the stack.
and offset for the second argument is different: 4 for int, 8 for obj and we can't generate a move for it nowadays.

Activity

  1. ghost added
    untriaged
    on Jan 21, 2021
  2. sandreenko commented on Jan 21, 2021

    @sandreenko
    ContributorAuthor

    PTAL @janvorli @sdmaclea @mangod9 not sure if it worth our immediate attention but we probably should discuss a long-term solution.

  3. sandreenko commented on Jan 21, 2021

    @sandreenko
    ContributorAuthor
  4. mangod9 commented on Jan 21, 2021

    @mangod9
    Member

    hmm.. interesting. What is the behavior currently, does it fail to invoke the delegate, or crash when h is accessed?

  5. janvorli commented on Jan 21, 2021

    @janvorli
    Member

    This likely won't be trivial to fix. The whole shuffle thunk generator logic relies on the fact that the entries being shuffled between stack and register slots are of the same size. We've had couple of hard to diagnose bugs there caused by incorrect ordering of the moves. I've ended up rewriting the code completely.

  6. sandreenko commented on Jan 21, 2021

    @sandreenko
    ContributorAuthor

    hmm.. interesting. What is the behavior currently, does it fail to invoke the delegate, or crash when h is accessed?

    so before the VM changes were merged the test was working correctly because VM was using not-apple ABI and allocation both arguments at 8 offsets. We could write a test where the target is a C++ method so it would fail without VM changes. In this case it would be wrong execution because the target method would read garbage instead of the real argument value.

    with the last VM changes merged it fails with an assert, if we build release VM then we will generate a wrong move.

  7. mangod9 commented on Jan 22, 2021

    @mangod9
    Member

    is there anyway to detect and fail gracefully than possibly corrupting state?

  8. sandreenko commented on Jan 22, 2021

    @sandreenko
    ContributorAuthor

    So it is detected here:

    _ASSERT(((srcStackByteOffset % TARGET_POINTER_SIZE) == 0) && "NYI: does not support shuffling of such args");

    and here:
    _ASSERT((dstStackByteOffset % TARGET_POINTER_SIZE) == 0 && "NYI: does not support shuffling of such args");

    do we have a throwing mechanism for VM?

  9. janvorli commented on Jan 22, 2021

    @janvorli
    Member

    It should be a fail-fast, there is no way to recover from such a situation. And we need to fix it, any user code can hit this depending on arguments to delegates. Please note that even though the file is called comdelegate.cpp, it is used for all delegates.

  10. removed
    untriaged
    on Jan 22, 2021
  11. added this to the 6.0.0 milestone on Jan 22, 2021
  12. sdmaclea commented on Feb 25, 2021

    @sdmaclea
    Contributor

    These tests also now failing with the same assert

    JIT/Stress/ABI/pinvokes_d/pinvokes_d.sh
    JIT/Stress/ABI/pinvokes_do/pinvokes_do.sh
    
  13. added
    disabled-test
    on Apr 7, 2021
  14. sdmaclea commented on Apr 7, 2021

    @sdmaclea
    Contributor

    These tests are disabled

    <!-- Hard failures -->
    <ExcludeList Include="$(XunitTestBinBase)/Regressions/coreclr/GitHub_35000/test35000/*">
    <Issue>https://github.com/dotnet/runtime/issues/47294</Issue>
    </ExcludeList>
    <ExcludeList Include="$(XunitTestBinBase)/JIT/Stress/ABI/pinvokes_d/*">
    <Issue>https://github.com/dotnet/runtime/issues/47294</Issue>
    </ExcludeList>
    <ExcludeList Include="$(XunitTestBinBase)/JIT/Stress/ABI/pinvokes_do/*">
    <Issue>https://github.com/dotnet/runtime/issues/47294</Issue>
    </ExcludeList>

  15. sdmaclea commented on May 5, 2021

    @sdmaclea
    Contributor

    @mangod9 This is one other Apple Silicon functional issue.

  16. mangod9 commented on May 5, 2021

    @mangod9
    Member

    Ok, thanks. Looks like its already included in "ToDo" on the project dashboard.

  17. ghost added
    in-pr
    on May 25, 2021
  18. ghost removed
    in-pr
    on Jun 8, 2021
  19. ghost locked as resolved and limited conversation to collaborators on Jul 8, 2021
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

    arch-arm64area-VM-coreclrdisabled-testos-macos-bigsur (macOS11)

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions