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 757570 - core: Do not crash if the plugins folder is missing
core: Do not crash if the plugins folder is missing
Status: RESOLVED FIXED
Product: rygel
Classification: Applications
Component: librygel-core
git master
Other Linux
: Normal normal
: ---
Assigned To: rygel-maint
rygel-maint
Depends on:
Blocks:
 
 
Reported: 2015-11-04 09:04 UTC by tarnyko
Modified: 2015-11-21 12:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
core-do-not-crash-if-plugins-folder-is-missing.patch (1.36 KB, patch)
2015-11-04 09:04 UTC, tarnyko
none Details | Review
core-do-not-crash-if-plugins-folder-is-missing.patch (1.46 KB, patch)
2015-11-04 09:06 UTC, tarnyko
none Details | Review
core-do-not-crash-if-plugins-folder-is-missing.patch (1.46 KB, patch)
2015-11-05 13:34 UTC, tarnyko
committed Details | Review

Description tarnyko 2015-11-04 09:04:09 UTC
Created attachment 314794 [details] [review]
core-do-not-crash-if-plugins-folder-is-missing.patch

Hi,

Currently, Rygel crashes if the "lib/rygel-X.Y/plugins" folder is not found at startup.

Please consider the attached patch, which permits Rygel to issue an appropriate warning and exit gracefully instead.
Comment 1 tarnyko 2015-11-04 09:06:11 UTC
Created attachment 314796 [details] [review]
core-do-not-crash-if-plugins-folder-is-missing.patch
Comment 2 Leon Anavi 2015-11-04 09:14:28 UTC
Hi, thank you for up streaming this patch. As you know I have also experienced it :) 

Btw several days ago I did a fix to the generated by Vala code in my Yocto/OE recipes: 
https://github.com/konsulko/tizen-distro/blob/master/meta-tizen/meta-open-ivi/recipes-connectivity/rygel/files/exit-if-plugins-directory-is-not-found.patch

Best regards,
Leon
Comment 3 Jens Georg 2015-11-05 11:33:05 UTC
Review of attachment 314796 [details] [review]:

+1

::: src/librygel-core/rygel-recursive-module-loader.vala
@@ +70,3 @@
+            warning ("Failed to open plugins folder: '%s'",
+                     this.base_path);
+            return;

Missing newline before return and the warning should be marked translatable but otherwise it's fine.
Comment 4 Jens Georg 2015-11-05 11:33:39 UTC
Review of attachment 314796 [details] [review]:

+1
Comment 5 Jens Georg 2015-11-05 11:35:34 UTC
(In reply to Leon Anavi from comment #2)
> Hi, thank you for up streaming this patch. As you know I have also
> experienced it :) 
> 
> Btw several days ago I did a fix to the generated by Vala code in my
> Yocto/OE recipes: 
> https://github.com/konsulko/tizen-distro/blob/master/meta-tizen/meta-open-
> ivi/recipes-connectivity/rygel/files/exit-if-plugins-directory-is-not-found.
> patch
> 
> Best regards,
> Leon

Exiting there is about as harsh as aborting I think. As tarnyko pointed out on IRC, rygel will exit anyway if it can't find any plugins.
Comment 6 Leon Anavi 2015-11-05 11:40:36 UTC
(In reply to Jens Georg from comment #5)
> (In reply to Leon Anavi from comment #2)
> > Hi, thank you for up streaming this patch. As you know I have also
> > experienced it :) 
> > 
> > Btw several days ago I did a fix to the generated by Vala code in my
> > Yocto/OE recipes: 
> > https://github.com/konsulko/tizen-distro/blob/master/meta-tizen/meta-open-
> > ivi/recipes-connectivity/rygel/files/exit-if-plugins-directory-is-not-found.
> > patch
> > 
> > Best regards,
> > Leon
> 
> Exiting there is about as harsh as aborting I think. As tarnyko pointed out
> on IRC, rygel will exit anyway if it can't find any plugins.

Yes, but in my opinion it is important to notify the user that rygel exits because it cannot find any plugins. Therefore I believe tarnyko's patch will be useful.

Best regards,
Leon
Comment 7 tarnyko 2015-11-05 13:23:34 UTC
(In reply to Jens Georg from comment #5)

> Exiting there is about as harsh as aborting I think. As tarnyko pointed out
> on IRC, rygel will exit anyway if it can't find any plugins.

Hi Jens,

IMHO, as Rygel already has the logic required to detect that no plugins have been loaded and exit gracefully (in "rygel-main.vala"), requiring an empty "plugins" folder sorts of defeats the purpose of this logic (because if you have a "plugins" folder, you generally have at least one plugin inside, and the logic is never used).

Regards, Manuel
Comment 8 tarnyko 2015-11-05 13:34:05 UTC
Created attachment 314917 [details] [review]
core-do-not-crash-if-plugins-folder-is-missing.patch

Updated patch with regards to Jens's comment #3.

@Jens: thanks for the +1 !