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 697724 - Rai.tv finalaze segmentation fault
Rai.tv finalaze segmentation fault
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: plugins
0.2.x
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2013-04-10 14:48 UTC by Marek Chalupa
Modified: 2013-04-10 17:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to replace g_object_unref () with g_list_free_full () (1.25 KB, patch)
2013-04-10 14:48 UTC, Marek Chalupa
committed Details | Review

Description Marek Chalupa 2013-04-10 14:48:41 UTC
Created attachment 241169 [details] [review]
patch to replace g_object_unref () with g_list_free_full ()

Hey,
I was constantly getting Segmentation fault when I was playing and testing with grilo-test-ui. I was getting this error during shutting down plugins. I ran it with valgrind and the output is following:

==4748==    at 0x3B1E03090B: g_type_check_instance_is_a (in /usr/lib64/libgobject-2.0.so.0.3600.0)
==4748==    by 0x3B1E0141D6: g_object_unref (in /usr/lib64/libgobject-2.0.so.0.3600.0)
==4748==    by 0x17289F4A: grl_raitv_source_finalize (grl-raitv.c:287)
==4748==    by 0x3B1E01437A: g_object_unref (in /usr/lib64/libgobject-2.0.so.0.3600.0)
==4748==    by 0x4C40157: grl_registry_unregister_source (grl-registry.c:728)
==4748==    by 0x4C413F9: grl_registry_unload_plugin (grl-registry.c:1224)
==4748==    by 0x40B48D: shutdown_plugins (main.c:2192)
==4748==    by 0x405E06: shutdown_plugins_cb (main.c:253)
==4748==    by 0x3B1E00F987: g_closure_invoke (in /usr/lib64/libgobject-2.0.so.0.3600.0)
==4748==    by 0x3B1E02099C: ??? (in /usr/lib64/libgobject-2.0.so.0.3600.0)
==4748==    by 0x3B1E028788: g_signal_emit_valist (in /usr/lib64/libgobject-2.0.so.0.3600.0)
==4748==    by 0x3B1E0289D1: g_signal_emit (in /usr/lib64/libgobject-2.0.so.0.3600.0)

Well, I looked into the code and found out that in finalize method are mappings unrefered as they were GObjects but they are GLists.

I made a simple patch and so far I tried it, it works.
Comment 1 Juan A. Suarez Romero 2013-04-10 17:02:38 UTC
commit 10cb4e74de35e2f689afb6e5e8d32cb92e6b1096
Author: Marek Chalupa <mchalupa@redhat.com>
Date:   Wed Apr 10 16:38:48 2013 +0200

    raitv: finalize method fixed.
    
    In grl_raitv_source_finalize () on lines 282 and 287 were
    raitv_[search|browse]_mappings unrefered like they were GObject, but
    they are GLists.
    
    g_object_unref () was therfore replaced by g_list_free_full () with
    g_free (full free because list is made up of structs allocated by g_new
    ()).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697724

 src/raitv/grl-raitv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)