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

Calling WebRTCPeerConnection.CreateDataChannel in C# throws External component has thrown an exception. #71

Closed
JonathanPicques opened this issue Nov 21, 2022 · 2 comments

Comments

@JonathanPicques
Copy link
Contributor

Godot version

4.0.beta.5

Plugin version

for beta5

System information

Windows 10 64bits

Issue description

Calling WebRTCPeerConnection.CreateDataChannel in C# throws External component has thrown an exception.

Steps to reproduce

Simply writing this in _Ready will cause a crash:

var peerConnection = new WebRTCPeerConnection();
var peerDataChannel = peerConnection.CreateDataChannel("chat", new Godot.Collections.Dictionary {
    {"id", 1},
    {"negotiated", true},
});

Minimal reproduction project

WebRTCBug.zip

@JonathanPicques
Copy link
Contributor Author

Still happens in beta8, but with a more verbose output:

Godot Engine v4.0.beta8.mono.official.45cac42c0 - https://godotengine.org
Vulkan API 1.3.224 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 2080

2022-12-15 22:32:33.456 DEBUG [21292] [rtc::impl::Init::doInit@120] Global initialization
2022-12-15 22:32:33.460 DEBUG [16256] [rtc::impl::Certificate::Generate@223] Generating certificate (OpenSSL)
ERROR: Condition "_instance_bindings != nullptr" is true.
   at: set_instance_binding (core/object/object.cpp:1706)
ERROR: Parameter "strong_gchandle.value" is null.
   at: setup_csharp_script_binding (modules/mono/csharp_script.cpp:1218)
ERROR: Condition "!script_binding.inited" is true. Returning: { nullptr }
   at: godotsharp_internal_unmanaged_get_instance_binding_managed (modules/mono/glue/runtime_interop.cpp:231)
ERROR: Parameter "strong_gchandle.value" is null.
   at: setup_csharp_script_binding (modules/mono/csharp_script.cpp:1218)
ERROR: Condition "!script_binding.inited" is true. Returning: { nullptr }
   at: godotsharp_internal_unmanaged_instance_binding_create_managed (modules/mono/glue/runtime_interop.cpp:244)
ERROR: FATAL: Condition "!rc_owner" is true.
   at: _instance_binding_reference_callback (modules/mono/csharp_script.cpp:1304)
Fatal error. System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
   at Godot.NativeInterop.NativeFuncs.godotsharp_ref_destroy(Godot.NativeInterop.godot_ref ByRef)
   at Godot.NativeInterop.godot_ref.Dispose()
   at Godot.NativeCalls.godot_icall_2_1142(IntPtr, IntPtr, System.String, Godot.NativeInterop.godot_dictionary)
   at Godot.WebRTCPeerConnection.CreateDataChannel(System.String, Godot.Collections.Dictionary)
   at Bug._Ready()
   at Godot.Node.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name ByRef, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant ByRef)
   at Godot.CanvasItem.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name ByRef, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant ByRef)
   at Godot.Node2D.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name ByRef, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant ByRef)
   at Bug.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name ByRef, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant ByRef)
   at Godot.Bridge.CSharpInstanceBridge.Call(IntPtr, Godot.NativeInterop.godot_string_name*, Godot.NativeInterop.godot_variant**, Int32, Godot.NativeInterop.godot_variant_call_error*, Godot.NativeInterop.godot_variant*)

@Faless
Copy link
Collaborator

Faless commented Nov 16, 2023

Same as #116 , closing in favor of that issue which has more info.
Possibly fixed by godotengine/godot#84947

@Faless Faless closed this as completed Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants