Ticket #304 (closed defect: fixed)

Opened 2 years ago

Last modified 20 months ago

avahi-gobject ga_entry_group_attach() fails

Reported by: dignan Owned by: lennart
Milestone: Avahi 0.6.26 Component: avahi-glib
Keywords: Cc:

Description

I am writing a Rhythmbox plugin in Vala which uses avahi-gobject. However I ran into this bug and generated a C testcase from a Vala testcase I created with some help from people in #vala.

Basically, if you create a Client, then create an Entry Group, then try to attach the client to the Entry Group, avahi-gobject crashes fatally.

Attachments

testcase.c (2.1 kB) - added by dignan 2 years ago.
C test case
testcase.vala (321 bytes) - added by dignan 2 years ago.
Vala testcase (easier to read)

Change History

Changed 2 years ago by dignan

C test case

Changed 2 years ago by dignan

Vala testcase (easier to read)

Changed 20 months ago by sjoerd

The assertion is hit because you need to start the client before attaching groups to it using ga_client_start. I guess to make it more clear we could throw a warning earlier:

diff --git a/avahi-gobject/ga-entry-group.c b/avahi-gobject/ga-entry-group.c index 0f0ab74..4fa56dc 100644 --- a/avahi-gobject/ga-entry-group.c +++ b/avahi-gobject/ga-entry-group.c @@ -574,6 +574,7 @@ gboolean ga_entry_group_attach(GaEntryGroup? * group,

GaClient? * client, GError ** error) {

GaEntryGroupPrivate? *priv = GA_ENTRY_GROUP_GET_PRIVATE(group);

+ g_return_val_if_fail (client->avahi_client, FALSE);

g_assert(priv->client == NULL priv->client == client); g_assert(priv->group == NULL);

If we want to be even we could set a proper GError, but i'm not sure it's worth it.

Changed 20 months ago by lennart

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to Avahi 0.6.26

I have now merged Sjoerd's patch. Thanks!

Note: See TracTickets for help on using tickets.