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 790586 - Rhythmbox crashes with SIGSEGV while launching through browser
Rhythmbox crashes with SIGSEGV while launching through browser
Status: RESOLVED OBSOLETE
Product: rhythmbox
Classification: Other
Component: general
HEAD
Other Linux
: Normal critical
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-20 02:23 UTC by gkrithi8
Modified: 2018-05-24 19:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rhythmdb: fix crash while opening songs via browser (1.31 KB, patch)
2017-11-20 02:47 UTC, gkrithi8
none Details | Review
rhythmdb: fix crash while opening songs via browser (1.28 KB, patch)
2017-11-27 13:17 UTC, gkrithi8
none Details | Review

Description gkrithi8 2017-11-20 02:23:40 UTC
This happens when rhythmbox is launched as default app ( via firefox ) and repeating them for more audio files ( which downloads them to the same temporary location /tmp/mozilla_dev0 ).

Downstream ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/rhythmbox/+bug/1725826/comments/10
Comment 1 gkrithi8 2017-11-20 02:47:37 UTC
Created attachment 364021 [details] [review]
rhythmdb: fix crash while opening songs via browser
Comment 2 gkrithi8 2017-11-20 02:53:19 UTC
The issue here is that, we start monitoring the temporary directory used by the browser ( /tmp/mozilla_dev0 for firefox ) and land up in directory change callback ( triggered by subsequent downloads ), even before library_locations is initialized.

One quick question was, why would we monitor /tmp/mozilla_dev0, if we're going to ignore everything outside of dirs in library_locations[].
Comment 3 Jonathan Matthew 2017-11-21 22:19:31 UTC
(In reply to gkrithi8 from comment #2)
> The issue here is that, we start monitoring the temporary directory used by
> the browser ( /tmp/mozilla_dev0 for firefox ) and land up in directory
> change callback ( triggered by subsequent downloads ), even before
> library_locations is initialized.

So library_locations should be initialized earlier.

> One quick question was, why would we monitor /tmp/mozilla_dev0, if we're
> going to ignore everything outside of dirs in library_locations[].

Created files get ignored, changes and deletions of files that are in the library do not get ignored.
Comment 4 Jonathan Matthew 2017-11-21 22:22:01 UTC
Review of attachment 364021 [details] [review]:

This isn't the right approach.
Comment 5 gkrithi8 2017-11-22 01:44:39 UTC
okay
Comment 6 gkrithi8 2017-11-27 09:01:08 UTC
Was thinking of replacing the following line in rhythmdb.c:

g_timeout_add_seconds (10, (GSourceFunc) rhythmdb_sync_library_idle, db);

with one of the following:

1. Add a g_idle_add (rhythmdb_sync_library_idle) -or- g_idle_add_full(rhythmdb_sync_library_idle) with G_PRIORITY_HIGH_IDLE

2. Spawn a g_thread immediately to complete the task.

thoughts ?
Comment 7 Jonathan Matthew 2017-11-27 11:40:38 UTC
I don't think there's any reason to do that.  The delay is deliberate, it's meant to keep the io and mainloop churn from monitoring separate from the library loading process.  10+ years ago when it was added, it made a noticeable difference.

What I'm suggesting is just reading the library locations from gsettings earlier.
Comment 8 gkrithi8 2017-11-27 13:17:42 UTC
Created attachment 364501 [details] [review]
rhythmdb: fix crash while opening songs via browser

We start monitoring the temporary directory used by the browser ( /tmp/mozilla_dev0 for firefox ) and land up in directory change callback ( triggered by subsequent downloads ), even before "library_locations" is initialized. So, we initialize "library_locations" earlier.
Comment 9 GNOME Infrastructure Team 2018-05-24 19:36:35 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/1610.