After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 741634 - youtube: Home-made refcounting?!
youtube: Home-made refcounting?!
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: plugins
git master
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2014-12-17 10:29 UTC by Bastien Nocera
Modified: 2015-08-29 16:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
youtube: Fix non-thread-safe refcounting (1.42 KB, patch)
2015-08-28 14:54 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2014-12-17 10:29:44 UTC
static void 
operation_spec_unref (OperationSpec *os) 
{
  os->ref_count--;
<snip>
static void 
operation_spec_ref (OperationSpec *os) 
{
  GRL_DEBUG ("Reffing spec");
  os->ref_count++;
<snip>

This stuff is horrible, and really not thread-safe. Use a GBoxed instead if you really need refcounting.

(This might be responsible for this crash:
==31263== Invalid read of size 8
==31263==    at 0x6FF0035: g_type_check_instance_is_fundamentally_a (gtype.c:4026)
==31263==    by 0x6FD19E6: g_object_unref (gobject.c:3067)
==31263==    by 0x6CB0C66: complete_in_idle_cb_for_thread (gsimpleasyncresult.c:835)
==31263==    by 0x7257BA2: g_main_dispatch (gmain.c:3125)
==31263==    by 0x7257BA2: g_main_context_dispatch (gmain.c:3750)
==31263==    by 0x7257FA7: g_main_context_iterate.isra.29 (gmain.c:3821)
==31263==    by 0x72582C1: g_main_loop_run (gmain.c:4015)
==31263==    by 0x5055964: gtk_main (gtkmain.c:1208)
==31263==    by 0x40C323: main (main.c:2433)
==31263==  Address 0x2a11c830 is 32 bytes inside a block of size 72 free'd
==31263==    at 0x4C2ACE9: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==31263==    by 0x725D75E: g_free (gmem.c:190)
==31263==    by 0x7274453: g_slice_free1 (gslice.c:1112)
==31263==    by 0x6FEEEA5: g_type_free_instance (gtype.c:1941)
==31263==    by 0x1E8F3079: operation_spec_unref.part.3 (grl-youtube.c:474)
==31263==    by 0x1E8F4560: operation_spec_unref (grl-youtube.c:960)
==31263==    by 0x1E8F4560: search_cb (grl-youtube.c:966)
==31263==    by 0x6CB0BCC: g_simple_async_result_complete (gsimpleasyncresult.c:763)
==31263==    by 0x6CB0C58: complete_in_idle_cb_for_thread (gsimpleasyncresult.c:832)
==31263==    by 0x7257BA2: g_main_dispatch (gmain.c:3125)
==31263==    by 0x7257BA2: g_main_context_dispatch (gmain.c:3750)
==31263==    by 0x7257FA7: g_main_context_iterate.isra.29 (gmain.c:3821)
==31263==    by 0x72582C1: g_main_loop_run (gmain.c:4015)
==31263==    by 0x5055964: gtk_main (gtkmain.c:1208)
==31263==    by 0x40C323: main (main.c:2433)
)
Comment 1 Bastien Nocera 2015-03-06 15:32:34 UTC
To reproduce the crash, do a search for "FPS Russia" in YouTube.
Comment 2 Bastien Nocera 2015-08-28 14:54:23 UTC
Created attachment 310197 [details] [review]
youtube: Fix non-thread-safe refcounting

Which could certainly cause a few bugs.
Comment 3 Victor Toso 2015-08-29 16:30:08 UTC
Review of attachment 310197 [details] [review]:

Indeed.
Crash still happens here *
Comment 4 Bastien Nocera 2015-08-29 16:54:41 UTC
Attachment 310197 [details] pushed as 52efbf6 - youtube: Fix non-thread-safe refcounting
Comment 5 Bastien Nocera 2015-08-29 16:58:01 UTC
(In reply to Victor Toso from comment #3)
> Review of attachment 310197 [details] [review] [review]:
> 
> Indeed.
> Crash still happens here *

It's being tracked in libgdata at: https://bugzilla.gnome.org/show_bug.cgi?id=754244