Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
When using Mono 22.214.171.124 with DBus-sharp on Windows. DBus signal hangs until next DBus signal i requested.
It works fine on Mono 4.8 and before.
I use exact same dbus-daemon.exe and DBus-sharp. It is only Mono that has changed in the setup.
I don't really have much to go on I will update when I find more.
I see this on Mono 126.96.36.199 on windows: (Works fine with Mono 4.8 and less):
Message: Duplicate type name within an assembly.
at System.Reflection.Emit.ModuleBuilder.DefineType (System.String name, System.Reflection.TypeAttributes attr, System.Type parent, System.Type interfaces, System.Reflection.Emit.PackingSize packingSize, System.Int32 typesize) [0x00053] in /home/mkj/Projects/AppBox/rpm/BUILD/mono-5.0.0/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs:275
at System.Reflection.Emit.ModuleBuilder.DefineType (System.String name, System.Reflection.TypeAttributes attr, System.Type parent, System.Type interfaces) [0x00000] in /home/mkj/Projects/AppBox/rpm/BUILD/mono-5.0.0/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs:292
at System.Reflection.Emit.ModuleBuilder.DefineType (System.String name, System.Reflection.TypeAttributes attr, System.Type parent) [0x00000] in /home/mkj/Projects/AppBox/rpm/BUILD/mono-5.0.0/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs:246
at DBus.TypeImplementer.GetImplementation (System.Type declType) [0x0006b] in <1eb41289591d4a0ba6dbf0ab492738da>:0
at DBus.BusObject.GetObject (DBus.Connection conn, System.String bus_name, DBus.ObjectPath object_path, System.Type declType) [0x00001] in <1eb41289591d4a0ba6dbf0ab492738da>:0
at DBus.Connection.GetObject (System.Type type, System.String bus_name, DBus.ObjectPath path) [0x0002b] in <1eb41289591d4a0ba6dbf0ab492738da>:0
at DBus.Connection.GetObject[T] (System.String bus_name, DBus.ObjectPath path) [0x00001] in <1eb41289591d4a0ba6dbf0ab492738da>:0
at OpenMedicus.SecurityBusService.GetSecurityBus () [0x00007] in /home/mkj/Projects/XMedicus/libxcaresecuritybus/SecurityBusService.cs:47
at OpenMedicus.Home.DisplayStream (System.IO.TextReader stream) [0x0001f] in /home/mkj/Projects/XMedicus/libxcaresettings/Home.cs:37
at OpenMedicus.Setting..ctor (Gtk.Builder builder, System.String name) [0x0005e] in /home/mkj/Projects/XMedicus/libxcaresettings/Settings.cs:45
at OpenMedicus.Setting..ctor (OpenMedicus.IConnectionManager cm) [0x00000] in /home/mkj/Projects/XMedicus/libxcaresettings/Settings.cs:53
at OpenMedicus.Shell.ShowSettings () [0x00012] in /home/mkj/Projects/XMedicus/libxcareshell/Shell.cs:1793
at OpenMedicus.Shell.OnEditPreferencesCallback (System.Object obj, System.EventArgs a) [0x0000f] in /home/mkj/Projects/XMedicus/libxcareshell/Shell.cs:3627
It would be helpful to know the Type:FullName of the type T that's being passed to DBus.Connection.GetObject<T>(...).
Also are you interacting with DBus from multiple threads? It seems like this could happen if two threads both call ModuleBuilder.DefineType.
(Ideally of course if you could provide a small self-contained example that reproduces the problem that would be fantastic).
The Fullname should be used, please see
Should be the latest DBus-sharp source code I use.
I don't Request from different threads. I only use async/await, so there should be no threads.
It works fine with Mono 4.8.
Aleksey, do you have enough info to reproduce?
Using async means that multiple tasks could potentially try to interact with System.Reflection.Emit at the same type which could lead to the error that you see.
This looks like incorrect locking in dbus-sharp. Please report it at https://github.com/mono/dbus-sharp/issues
Looking at TypeImplementer.cs:59 it looks like multiple tasks that call TypeImplementer:GetImplementation will both try to call DefineType with the same name. (They'll synchronize on getImplLock on line 55, but then both will get NULL from the map and continue to line 59. getImplLock is only protecting concurrent access to the map variable, not to ModuleBuilder.DefineType).