lgi-devs / lgi-devs/lgi

Segmentation fault when using upower and playerctl interfaces

Open
#301 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
491
Forks
81
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two minimal examples for UPowerGlib and Playerctl under both Lua and LuaJIT, then inspect the corresponding lgi introspection bindings. Compare the behavior with and without a GLib main loop and use the available crash output to narrow the cause. Done means identifying the source of the segmentation fault and confirming that both examples no longer crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.