lgi-devs / lgi

Dynamic Lua binding to GObject libraries using GObject-Introspection
MIT License
440 stars 70 forks source link

_resolve can cause luajit to segmentation fault #308

Open dagle opened 1 year ago

dagle commented 1 year ago

Calling _resolve(true) with luajit 2.1.0beta3 seems to make luajit to segfault for some components. It seems to be _parent that causes problem, and calling _resolve(false) on a _parent object causes a segfault (haven't been able to find anything else causing this). This how ever doesn't seem to happen for all libraries. But I found at least 10 typelibs on my system that caused the problems.

local lgi = require 'lgi'
local gmime = lgi.require('GMime', "3.0")

gmime.init()
gmime:_resolve(true)

while true do
end

Running gdb I get: undefined symbol: g_mime_object_type_registry_shutdown. That function is only used during shutdown of gmime and shouldn't be called at all, feel like something wrong is happening before that.

I tried using luajit 2.0.5 and instead of a crash, I get a infinite loop instead.

With lua 5.4 the code works correctly and loads everything correctly.