lgi-devs / lgi

Dynamic Lua binding to GObject libraries using GObject-Introspection
MIT License
427 stars 69 forks source link

Segmentation fault when using upower and playerctl interfaces #301

Open VentGrey opened 1 year ago

VentGrey commented 1 year ago

Hello lgi development team. I've encounteded an issue with both lua and luajit when trying to use the playerctl and upower interfaces. The output itself is not very descriptive as the command line only reads `Segmentation fault".

I don't even know where to start as it is easy to get lost, I've made the following upower example code to explain:

local upower = require("lgi").require("UPowerGlib")
local devices = upower.Client():get_devices()

The same happens with playerctl:

local lgi = require("lgi")
local Playerctl = lgi.Playerctl
local player = Playerctl.Player{}

print(player:get_title())

I think I have all the needed introspection objects needed. Placing such code inside a GLib main loop doesn't change the output at all. Any ideas on what might be happening?

ntd commented 1 year ago
local upower = require("lgi").require("UPowerGlib")
local devices = upower.Client():get_devices()

Here it works without any segmentation fault (lua 5.4.4, lgi master).