runtime icon indicating copy to clipboard operation
runtime copied to clipboard

[browser][MT] ReleaseJSOwnedObjectByGCHandle: Unexpected synchronous failure

Open maraf opened this issue 1 year ago • 2 comments

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=738612 Build error leg or test failing: build_browser_wasm_linux_Release_LibraryTests_Threading

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "[MONO] ReleaseJSOwnedObjectByGCHandle: Unexpected synchronous failure",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: :mag_right: https://dev.azure.com/dnceng-public/public/_build/results?buildId=738612 Error message validated: [[MONO] ReleaseJSOwnedObjectByGCHandle: Unexpected synchronous failure] Result validation: :white_check_mark: Known issue matched with the provided build. Validation performed at: 7/15/2024 11:56:32 AM UTC

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0

maraf avatar Jul 15 '24 11:07 maraf

ArgumentNullException: Value cannot be null. (Parameter 'key') probably here

https://github.com/dotnet/runtime/blob/7dd68f40ab9ae6f631d79b76f2d9b464f7ecee36/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSProxyContext.cs#L416C30-L416C50

I'm not sure why yet

[07:56:30] info: [FAIL] System.Runtime.InteropServices.JavaScript.Tests.JSImportTest.JsImportArraySegmentOfInt32
[07:56:30] info: System.NullReferenceException : Object reference not set to an instance of an object.
[07:56:30] info:    at System.Runtime.InteropServices.JavaScript.JSMarshalerArgument.ToManaged(ArraySegment`1& )
[07:56:30] info:    at System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper.echo1_ArraySegmentOfInt32(ArraySegment`1 value, Boolean edit)
[07:56:30] info:    at System.Runtime.InteropServices.JavaScript.Tests.JSImportTest.JsImportArraySegmentOfInt32()
[07:56:30] info:    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
[07:56:30] info:    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object , BindingFlags )

[07:56:47] warn: [0x025e3650--IO- 07:56:47.668] [MONO] Process terminated.
[07:56:47] warn: [0x025e3650--IO- 07:56:47.669] [MONO] ReleaseJSOwnedObjectByGCHandle: Unexpected synchronous failure (ManagedThreadId 4): System.ArgumentNullException: Value cannot be null. (Parameter 'key')
                    at System.Collections.Generic.Dictionary`2[[System.Object, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.IntPtr, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Remove(Object key)
                    at System.Runtime.InteropServices.JavaScript.JSProxyContext.ReleaseJSOwnedObjectByGCHandle(IntPtr )
                    at System.Runtime.InteropServices.JavaScript.JavaScriptExports.ReleaseJSOwnedObjectByGCHandle(JSMarshalerArgument* arguments_buffer)
[07:56:47] fail: 
[07:56:47] fail: "<unnamed thread>" tid=0x25e3650 this=0x2440600 , thread handle : 0x25dedb8, state : not waiting
[07:56:47] fail:   at <unknown> <0xffffffff>
[07:56:47] fail:   at (wrapper managed-to-native) System.Environment.FailFast (string,System.Exception,string) [0x00000] in <5ba192def01b42bbbaf411546e531d7c>:0
[07:56:47] fail:   at System.Environment.FailFast (string) [0x00000] in <5ba192def01b42bbbaf411546e531d7c>:0
[07:56:47] fail:   at System.Runtime.InteropServices.JavaScript.JavaScriptExports.ReleaseJSOwnedObjectByGCHandle (System.Runtime.InteropServices.JavaScript.JSMarshalerArgument*) [0x00055] in <4b51ee87204f4122a4af4672959d537e>:0
[07:56:47] fail:   at (wrapper runtime-invoke) <Module>.runtime_invoke_direct_void_JSMarshalerArgument* (object,intptr,intptr,intptr) [0x0002d] in <4b51ee87204f4122a4af4672959d537e>:0

pavelsavara avatar Jul 22 '24 09:07 pavelsavara

maybe GCHandle use-after-free related to https://github.com/dotnet/runtime/issues/104524

pavelsavara avatar Aug 01 '24 15:08 pavelsavara