Cannot generate proxy for two dbus interface with the same names but in difference namespaces

Bug #377672 reported by Matt Guo
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
NDesk D-Bus
Confirmed
High
Unassigned
ndesk-dbus (Ubuntu)
Fix Released
Undecided
Iain Lane

Bug Description

E.g.
I firstly declare:

namespace org.gnome.Tomboy
{
     [Interface ("org.gnome.Tomboy.RemoteControl")]
     public interface IRemoteControl {...}
}

namespace org.gnome.Tasque
{
     [Interface ("org.gnome.Tasque.RemoteControl")]
     public interface IRemoteControl {...}
}

Then if I later get both org.gnome.Tomboy.IRemoteControl and org.gnome.Tasque.IRemoteControl with "bus.GetObject<T> (busName, path)", an exception will thrown and saying:

Unhandled Exception: System.ArgumentException: Duplicate type name within an assembly.
  at System.Reflection.Emit.ModuleBuilder.DefineType (System.String name, TypeAttributes attr, System.Type parent, System.Type[] interfaces, PackingSize packingSize, Int32 typesize) [0x0002b] in /usr/src/packages/BUILD/mono-2.4/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs:270
  at System.Reflection.Emit.ModuleBuilder.DefineType (System.String name, TypeAttributes attr, System.Type parent, System.Type[] interfaces) [0x00000] in /usr/src/packages/BUILD/mono-2.4/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs:290
  at System.Reflection.Emit.ModuleBuilder.DefineType (System.String name, TypeAttributes attr, System.Type parent) [0x00000] in /usr/src/packages/BUILD/mono-2.4/mcs/class/corlib/Assembly/AssemblyInfo.cs:1
  at NDesk.DBus.TypeImplementer.GetImplementation (System.Type declType) [0x00000]
  at NDesk.DBus.BusObject.GetObject (NDesk.DBus.Connection conn, System.String bus_name, NDesk.DBus.ObjectPath object_path, System.Type declType) [0x00000]
  at NDesk.DBus.Connection.GetObject (System.Type type, System.String bus_name, NDesk.DBus.ObjectPath path) [0x00000]
  at NDesk.DBus.Connection.GetObject[IRemoteControl] (System.String bus_name, NDesk.DBus.ObjectPath path) [0x00000]

Revision history for this message
Matt Guo (matt-mattguo) wrote :

Solution: in "ndesk-dbus-0.6.0/src/TypeImplementer.cs", Ln37, (or search "declType.Name")
change declType.Name to declType.FullName
Then this bug is gone.

Revision history for this message
Robert Dyer (psybers) wrote :

I can confirm both the bug and the solution. Thanks Matt!

Changed in ndesk-dbus:
status: New → Confirmed
Revision history for this message
Alex Launi (alexlauni) wrote :

I can also confirm this small fix fixes the bug.

Robert Dyer (psybers)
Changed in ndesk-dbus (Ubuntu):
status: New → Confirmed
assignee: nobody → Iain Lane (laney)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ndesk-dbus - 0.6.0-3

---------------
ndesk-dbus (0.6.0-3) unstable; urgency=low

  * debian/patches/10_namespace-support.dpatch: Backport patch from upstream
    bug#377672 to fix a crash in the case where we were dealing with
    interfaces which had the same name in different namespaces. Thanks to Matt
    Guo for the fix (LP: #377672)
  * debian/control, debian/rules: Use mono-csc as compiler, bump mono-devel
    versioned build-dep to one which provides this
  * debian/control, debian/README.source: Standards-Version 3.8.3; add
    README.source

 -- Iain Lane <email address hidden> Tue, 20 Oct 2009 07:57:28 +0100

Changed in ndesk-dbus (Ubuntu):
status: Confirmed → Fix Released
alp (atoker)
Changed in ndesk-dbus:
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.