GNOME Bugzilla – Bug 779924
gnome-games crash with SIGSEGV in retro_core_set_callbacks()
Last modified: 2017-03-20 13:36:46 UTC
gnome-games 3.23.91 locally built on Ubuntu 17.04 Beta If you have /usr/lib/x86_64-linux-gnu/libretro/nestopia.libretro but don't have nestopia installed and click on a .nes game in GNOME Games, GNOME Games will crash. This probably won't happen unless there's a packaging bug, right? But maybe it shouldn't crash anyway.
+ Trace 237244
Created attachment 347821 [details] [review] retro: Check if module file exists before getting its path
Created attachment 347822 [details] [review] core-descriptor: Check if module file exists in get_module_file()
Review of attachment 347822 [details] [review]: ::: retro-gtk/retro-core-descriptor.vala @@ +93,1 @@ + return module_file.query_exists () ? module_file : null; Looks good to me: either we have a File object pointing to a file, or null. :) I would rather split this though, for readability's sake and to better blend into the rest of the codebase: var module = get_module (); var module_file = dir.get_child (module); if (!module_file.query_exists ()) return null; return module_file;
Review of attachment 347822 [details] [review]: Oh also, it would be nice to have an explanation of the motivation for this change in the log.
Review of attachment 347821 [details] [review]: The shortlog is a tiny bit long, maybe "retro: Check existence of module file" and then detail what is done in the rest of the log. ::: src/retro/retro-runner.vala @@ +260,1 @@ module_path = module_file.get_path (); A small nitpick: a newline would be nice there, it would help readability after the "throw" line which breaks the execution flow.
Jeremy: do these patches (one for retro-gtk, the other for gnome-games) fix your problem?
Created attachment 347929 [details] [review] core-descriptor: Check existence of module file in get_module_file() File.get_child(string name) returns a File even if no file with such name exists. Hence, check if this File points to anything else return null.
Created attachment 347939 [details] [review] retro: Check existence of module file Retro.CoreDescriptor.get_module_file() returns null when module file is not found. Null check module file before getting its path for Retro.Core.
Yes, the patches (347929 and 347939) fix my issue. Thanks!
Review of attachment 347929 [details] [review]: Thanks! :)
Review of attachment 347939 [details] [review]: Thanks!
Comment on attachment 347929 [details] [review] core-descriptor: Check existence of module file in get_module_file() Attachment 347929 [details] pushed as c5dc74c - core-descriptor: Check existence of module file in get_module_file()
Attachment 347939 [details] pushed as 431a74e - retro: Check existence of module file