Bug 39200 - Avoid using a NULL hash table
Summary: Avoid using a NULL hash table
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-farstream (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Olivier Crête
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords: patch
: 34816 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-07-13 11:45 UTC by vincent
Modified: 2011-07-14 13:43 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description vincent 2011-07-13 11:45:49 UTC
A couple of fixes to using a NULL hash table (two different places) which would trigger upon cancelling a call we'd just started.

http://cgit.collabora.com/git/user/vincent/telepathy-farstream/log/?h=conf

Also a cosmetic patch that's not worth a bug entry by itself.
Comment 1 Olivier Crête 2011-07-13 12:43:29 UTC
@@ -231,6 +231,30 @@ tf_call_channel_dispose (GObject *object)
...
+      while (g_hash_table_iter_next (&iter, &key, &value))
+        {
+          TfCallContent *content = TF_CALL_CONTENT (value);
+          if (content)
+            tf_call_content_on_call_channel_gone (content);

Why do you have a if (content) here? In which case could the value be NULL ?
Comment 2 Olivier Crête 2011-07-13 12:54:42 UTC
The other patches are committed
Comment 3 vincent 2011-07-13 13:41:15 UTC
Reflex safety I guess, I do not have a particular reason to believe it could be NULL.

Branch rebased, amended to remove that check, and repushed.
Comment 4 Olivier Crête 2011-07-13 14:08:42 UTC
Now that I think more about it, maybe it shoudl just call g_object_run_dispose(content); and make sure every entry point and async callback in the CallContent object checks if the object is still valid.
Comment 5 vincent 2011-07-14 04:12:42 UTC
Branch updated with a version that forces dispose on the content, and adds checks to avoid the last ref holder crashing.
I don't like this much tbh.

Note that for added fun, calling g_simple_async_result_complete in got_content_media_properties will cause that dispose to be called, so the content becomes invalid in the middle of that function. This is guarded for in process_codec_offer now.
Comment 6 Olivier Crête 2011-07-14 13:34:33 UTC
*** Bug 34816 has been marked as a duplicate of this bug. ***
Comment 7 Olivier Crête 2011-07-14 13:43:47 UTC
merged


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.