GNOME Bugzilla – Bug 440400
sound-juicer crashes when "editing profiles"
Last modified: 2007-09-19 08:37:41 UTC
The bug has been opened on https://bugs.launchpad.net/ubuntu/+source/sound-juicer/+bug/115953 "Binary package hint: sound-juicer clicking on EDIT PROFILES from the SoundJuicer pref-panel, it crashes SoundJuicer completely. Please note that I have both the ubuntu and the universe version of UGLY gstreamer packages installed. ..." Debug backtrace for the crash:
+ Trace 135492
Downgrading to 2.16.1 fixes the bug
Created attachment 94639 [details] [review] patch for svn head The attached patch fixes the crash mentioned above. Description of problem/bug: an initial profile is set in 'sj_extractor_init', but is not referenced. After that, 'profile_changed_cb' is called from 'main'. Within 'profile_changed_cb', 'g_object_set' is used to set the current profile. This in turn calls 'sj_extractor_set_property' in which the initial profile is unreferenced and the reference count of this profile becomes zero. Thus it is freed. This leads to the crash mentioned in this bug report. The patch also fixes the problem reported in bug #469252 (at least for me).
*** Bug 474778 has been marked as a duplicate of this bug. ***
The patch is probably right, but if the _ref is necessary it should also be done in src/sj-main.c:profile_changed_cb() before the g_object_set and an _unref afterwards, no? gm_audio_profile_lookup() returns the profiles directly from an internal hashtable and doesn't ref it before returning so couldn't it happen in theory, that the profile is unreffed already from another thread before giving it to g_object_set? Adding a ref after the lookup could still break though in that case but would at least be more save ;)
Whatever, the patch should probably committed ASAP to have it in the next 2.20 release.
The UI isn't threaded so there is no problem in sj-main.c. Committed the patch to HEAD.
Great, thanks :)