GNOME Bugzilla – Bug 694418
double free after bd07f714 "Add a function doing a service rescan"
Last modified: 2019-02-22 09:29:55 UTC
I just updated to 0.14.0 and can reproduce the following crash very easily, (just by starting dleyna media-service-upnp). I can see several ResourceBrowsers being created, and then after 5 secs when refresh_cache() gets called, bad things often (but not always) happen on one of them. The backtrace is typical but not the only one I've seen. It started with commit bd07f714386, although I'm not totally sure how this happens... I've not updated the other components yet so gupnp is 0.19.4.
+ Trace 231543
I suppose I'll have to replace the g_hash_table_insert with g_hash_table_replace. There was some issue with the former function fixed in GLib-2.35.6 (http://git.gnome.org/browse/glib/commit/?id=bb1df4d01b25e6e12ff30adcd3b07b37c4837bc0). I guess you are not using the bleeding-edge GLib as it wasn't backported into stable 2.34 or 2.32 branches.
Good catch. I'm on Debian unstable (8 months in release freeze now) so definitely not bleeding edge: glib is 2.34. I can test this since it's so easy for me to reproduce, just a minute....
Created attachment 237148 [details] [review] Use g_hashtable_add() instead of g_hash_table_insert() Yep, you are correct. Attaching a patch that fixes this for me.
Fixed. Bumped GLib dep to 2.32.