[Bug 40523] telepathy-gabble crashed with signal 5 in g_return_if_fail_warning()

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Oct 4 15:18:29 CEST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=40523

--- Comment #4 from Will Thompson <will.thompson at collabora.co.uk> 2011-10-04 06:18:28 PDT ---
(In reply to comment #3)
> I don't understand how the first commit helps, but it's fine.

It's so we don't have to skip over “holes” in the array.

If AcknowledgePendingMessages([1, 2, 1, 3]) is called, previously 'nodes' would
end up looking like this:

 [ GList { data = 0x1111 }
 , GList { data = 0x2222 }
 , GList { data = 0x1111 }
 , GList { data = 0x3333 }
 ]

The crash occurred when we tried to free 0x1111 a second time.

If I had just changed the loop to skip duplicates, it would have looked like
this:

 [ GList { data = 0x1111 }
 , GList { data = 0x2222 }
 , uninitialized memory
 , GList { data = 0x3333 }
 ]

Obviously we could use g_new0, but we'd still have to check for, and skip, the
NULLed-out gap in the array.

By switching to a dynamically-sized array, there are no gaps to skip.

> I would just add a DEBUG() in the case it found a dup, to help debug the faulty
> client later.

Added a patch to do this.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the telepathy-bugs mailing list