Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove built-in COM interop support from Mono runtime #97789

Merged
merged 13 commits into from
Feb 8, 2024

Conversation

jkoritzinsky
Copy link
Member

This support is always disabled, so let's delete it.

Fixes #97703

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.

Thanks!

@jkoritzinsky
Copy link
Member Author

Looks like I need to make the AOT compiler resilient to encountering a [ComImport] type. I'll take a look tomorrow at that.

We need to allow ComImport types to be loaded as ComImport interfaces can also be implemented entirely in managed code, but we can block objects of ComImport-based types from being created.
@lambdageek
Copy link
Member

Linux arm64 libraries test crash is possibly related:

Thread 11 (Thread 0xffffb2e620e0 (LWP 34) ".NET Long Runni"):
#0  0x0000ffffbd926800 in __GI___wait4 (pid=pid@entry=35, stat_loc=stat_loc@entry=0xffffb2e5d450, options=0, options@entry=-1293561008, usage=usage@entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
#1  0x0000ffffbd926758 in __GI___waitpid (pid=pid@entry=35, stat_loc=stat_loc@entry=0xffffb2e5d450, options=options@entry=-1293561008) at ./posix/waitpid.c:38
#2  0x0000ffffbd4c147c in dump_native_stacktrace (signal=<optimized out>, mctx=<optimized out>) at /__w/1/s/src/mono/mono/mini/mini-posix.c:843
#3  mono_dump_native_crash_info (signal=<optimized out>, mctx=mctx@entry=0xffffb2e5deb0, info=<optimized out>) at /__w/1/s/src/mono/mono/mini/mini-posix.c:870
#4  0x0000ffffbd472218 in mono_handle_native_crash (signal=0xffffbd31027b "SIGSEGV", mctx=0xffffb2e5deb0, info=0xffffb2e5e210) at /__w/1/s/src/mono/mono/mini/mini-exceptions.c:2967
#5  0x0000ffffbd3dfb1c in mono_sigsegv_signal_handler_debug (_dummy=11, _info=0xffffb2e5e210, context=0xffffb2e5e290, debug_fault_addr=0x20) at /__w/1/s/src/mono/mono/mini/mini-runtime.c:3888
#6  <signal handler called>
#7  mono_object_handle_isinst (obj=..., klass=klass@entry=0x0, error=error@entry=0xffffb2e5f4e0) at /__w/1/s/src/mono/mono/metadata/object.c:6807
#8  0x0000ffffbd5f212c in mono_object_isinst_checked (obj_raw=0xffffbca2a1e0, klass=0x0, error=error@entry=0xffffb2e5f4e0) at /__w/1/s/src/mono/mono/metadata/object.c:6790
#9  0x0000ffffbd5c2ee4 in mono_marshal_isinst_with_cache (obj=0xffffbca2a1e0, klass=0x0, cache=0xffff9005a820) at /__w/1/s/src/mono/mono/metadata/marshal.c:4445
#10 0x0000ffffbcd6ff7c in ?? ()
#11 0x0000ffff94003580 in ?? ()

Note mono_marshal_isinst_with_cache is getting called from JITed code with a NULL klass` argument.

@jkoritzinsky
Copy link
Member Author

@lambdageek There's a known issue for that failure #90019.

Looking at one of the logs from one of the other instances, it looks like the same symptom

#6  <signal handler called>
#7  mono_object_handle_isinst (obj=..., klass=0x0, error=0xf15fb198) at /__w/1/s/src/mono/mono/metadata/object.c:6884
#8  0xf77991e8 in mono_object_isinst_checked (obj_raw=0xf6a6ece0, klass=0x0, error=0xf15fb198) at /__w/1/s/src/mono/mono/metadata/object.c:6867
#9  0xf7763eb8 in mono_marshal_isinst_with_cache (obj=0xf6a6ece0, klass=0x0, cache=0xf1728fb0) at /__w/1/s/src/mono/mono/metadata/marshal.c:4356
#10 0xf6df0220 in ?? ()

As you're more familiar with this code than I, I'll defer to you.

@lambdageek
Copy link
Member

Oh yes, that's the same crash. I didn't recognize the test suite. I think of 90019 as somehow being related to generic collections (perhaps some kind of generic sharing race condition). But yes, it's the same issue.

:shipit:

@jkoritzinsky jkoritzinsky merged commit 7f4702a into dotnet:main Feb 8, 2024
109 of 111 checks passed
@jkoritzinsky jkoritzinsky deleted the no-mono-com branch February 8, 2024 18:57
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2024
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] remove runtime support for cominterop
3 participants