mhsabbagh / green-recorder

A simple screen recorder for Linux desktop. Supports Wayland & Xorg
GNU General Public License v3.0
616 stars 118 forks source link

Segmentation fault #106

Closed sebix closed 5 years ago

sebix commented 5 years ago

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?

mhsabbagh commented 5 years ago

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 5 years ago

What (undocumented) dependencies does green-recorder have?

Could you link the bug report?

mhsabbagh commented 5 years ago

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 5 years ago

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.
mhsabbagh commented 5 years ago

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:

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

sebix commented 5 years ago

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

mhsabbagh commented 5 years ago

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 5 years ago

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

mhsabbagh commented 5 years ago

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).