Skip to content

Conversation

@fanyang-mono
Copy link
Member

@fanyang-mono fanyang-mono commented Aug 29, 2023

Fixes: #90955

This is an existing bug for both JIT and AOT. Basically, the issue was that the offset from one layer above wasn't carried on when calculating offset for nested struct fields. I've added a test to lock down this behavior and verified that the test failed without this change.

@fanyang-mono
Copy link
Member Author

This should be backported to .NET8/7/6.

Copy link
Member

@lambdageek lambdageek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test can be simplified - you don't need any methods in the struct definitions - just fields.

The test can also go into src/tests/Interop/StructMarshalling/PInvoke/ and can be updated like the other .csproj files in that directory to use the .cpp file to implement a C++ function that takes the right kind of argument struct.

@fanyang-mono
Copy link
Member Author

Newly added test failed on wasm with interpreter. Investigating it now.

@fanyang-mono
Copy link
Member Author

The wasm apps created for runtime tests weren't including c++ file/library needed by the test. See details in #64127. Disabled newly added test on wasm.

@fanyang-mono
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@fanyang-mono
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@fanyang-mono
Copy link
Member Author

Library test failures were related to #91410.

@fanyang-mono
Copy link
Member Author

/backport to release/8.0

@github-actions
Copy link
Contributor

Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/6041888778

@fanyang-mono
Copy link
Member Author

/backport to release/7.0-staging

@fanyang-mono
Copy link
Member Author

/backport to release/6.0-staging

@github-actions
Copy link
Contributor

Started backporting to release/7.0-staging: https://github.com/dotnet/runtime/actions/runs/6041900557

@github-actions
Copy link
Contributor

Started backporting to release/6.0-staging: https://github.com/dotnet/runtime/actions/runs/6041901510

@github-actions
Copy link
Contributor

@fanyang-mono backporting to release/7.0-staging failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix offset calculation for nested struct
Applying: Add a test for nested struct with pinvoke
Applying: Move and update test with real c++ implementation
Applying: Exclude newly added test from wasm
Using index info to reconstruct a base tree...
M	src/tests/issues.targets
Falling back to patching base and 3-way merge...
Auto-merging src/tests/issues.targets
CONFLICT (content): Merge conflict in src/tests/issues.targets
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0004 Exclude newly added test from wasm
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@github-actions
Copy link
Contributor

@fanyang-mono an error occurred while backporting to release/7.0-staging, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@github-actions
Copy link
Contributor

@fanyang-mono backporting to release/6.0-staging failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix offset calculation for nested struct
Using index info to reconstruct a base tree...
M	src/mono/mono/mini/mini-amd64.c
Falling back to patching base and 3-way merge...
Auto-merging src/mono/mono/mini/mini-amd64.c
Applying: Add a test for nested struct with pinvoke
Applying: Move and update test with real c++ implementation
Applying: Exclude newly added test from wasm
Using index info to reconstruct a base tree...
M	src/tests/issues.targets
Falling back to patching base and 3-way merge...
Auto-merging src/tests/issues.targets
CONFLICT (content): Merge conflict in src/tests/issues.targets
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0004 Exclude newly added test from wasm
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@github-actions
Copy link
Contributor

@fanyang-mono an error occurred while backporting to release/6.0-staging, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Mono] Regression: amd64 AOT: condition `class1 != ARG_CLASS_NO_CLASS' not met

2 participants