Skip to content

__fastfail() when in-proc COM server handles an exception #122346

@mediawolf

Description

@mediawolf

Description

Client (net10) crashes with _failfast(), when invoking a IDispatch method of in-proc COM server (net462), which handles an internal exception.

Reproduction Steps

Server DLL (net462)

[ComVisible(true)]
[ProgId("MyCompany.MyObject")]
[Guid("CF824E95-642E-4F8D-8CD1-F67BC588B107")]
[ClassInterface(ClassInterfaceType.AutoDispatch)]
public sealed class MyObject
{
    public void Invoke1()
    {
        try
        {
            throw new KeyNotFoundException("XYZ");
        }
        catch (Exception e)
        {
        }
    }
}

Registration with RegAsm.exe Server.dll /codebase /verbose.

Client EXE (net10)

var myObjectType = Type.GetTypeFromCLSID(new Guid("CF824E95-642E-4F8D-8CD1-F67BC588B107"), throwOnError: true)!;
dynamic obj = Activator.CreateInstance(myObjectType)!;
obj.Invoke1(); // crashes the application in .NET 10

Expected behavior

Invoke1() succeeds as it does in .NET 8.

Actual behavior

Invoke1() crashes the application:

Unhandled exception at 0x00007FFA59701266 (ntdll.dll) in Client.exe: Unknown __fastfail() status code: 
0x0000000000000030.

Regression?

Works in .NET 8.

Known Workarounds

No response

Configuration

Windows 11
8.0.404
9.0.308
10.0.100

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions