mhsabbagh/green-recorder

Segmentation fault

sebix opened this issue · 9 comments

sebix commented

Hi,

Using green-recorder 3.1 on openSUSE Tumbleweed with XFCE gives this:

> green-recorder 
You are recording on: x11
Segmentation fault (core dumped)

Any suggests to get it running?

openSUSE has some problems with Python dependinces. I have tried packaging the program for it before but always the behaviour is different than other distributions, already reported a bug with no answer.

sebix commented

What (undocumented) dependencies does green-recorder have?

Could you link the bug report?

There are no special dependencies other than these mentioned in the README file or the Debian control file.

https://bugzilla.opensuse.org/show_bug.cgi?id=1042111

sebix commented

The segmentation fault happens on the line https://github.com/foss-project/green-recorder/blob/fbf7566/green-recorder#L262

builder.add_from_file("/usr/share/green-recorder/ui.glade")

I will try to "bisect" it to find a minimal example.

Using gdb I found this is the trigger for the Segmentation fault:

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007fffefbdb399 in _gtk_style_provider_private_get_settings (provider=0x0) at gtkstyleproviderprivate.c:123
123	gtkstyleproviderprivate.c: No such file or directory.

Normally that error should've been displayed directly in the terminal (as I have seen it on many other distributions), I don't know why openSUSE just outputs segmentation fault.

Anyway: The problem is that the installation script we have depends on a pre-determined installation location for the data files (some distributions use /usr/local/share and some of them use /usr/share), but our program depends on a hardcoded /usr/share path (as you can see from the path of the .ui file), simply because I don't know a why to determine the installation prefix correctly. And since I can choose where to install the program using packages, no problem will occur, UNLESS you are trying to install it using the Python script, which is the case here, and which is also the case right now on my Mint 19 where I can also see the problem.

So there are 2 options to fix this here:

  • Find a way to determine the installation path correctly and use it instead of the hardcoded /usr/share folder.
  • Put the corresponding lines inside a "try: except" so that we can try to import from both paths (/usr/share and /usr/local/share) in case one of them fails. Still will give a problem if we have another distribution which uses a different path, but will solve it for majority of cases.

Unless there's someone with an idea on the first solution, I'll go with the second.

sebix commented

I also got the error when just loading the ui.glade file with a minimal program:

import gi
gi.require_version('Gtk','3.0')
from gi.repository import Gtk, Gdk, GLib
builder = Gtk.Builder()
builder.add_from_file("ui.glade")

It works with Python3 - so I guess it's not a path problem. This is the bug I reported now to the GNOME team of openSUSE: https://bugzilla.opensuse.org/show_bug.cgi?id=1112639

Well then that could be a different problem. But still some distributions do have a different installation prefix, so that file at /usr/share/green-recorder/ui.glade doesn't even exist (it would be installed at /usr/local/share/green-recorder/ui.glade), which is causing the problem.

sebix commented

The package python-gobject-Gdk is needed. I'm in the process of getting it into tumbleweed as official package

This should be fixed in 3.2. (We know read from either /usr/local/share or /usr/share).

Regarding openSUSE, I currently have no plans to support it officially or provide it in the repositories, but the setup.py file should work (If the dependencies issue is solved).