Reproducible crash with get_typeof when using Lua5.4
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Start by reading Image_method:get_typeof(name) and the voperation.call implementation; the issue points to the call to vips_lib.vips_image_get_typeof(self.vimage, name) and reproductions using Image.xyz, new_from_file, and bandjoin. Investigate garbage collection behavior under Lua 5.4 and compare it with Lua 5.2, 5.3, and LuaJIT. Done means the reproductions no longer crash under Lua 5.4 without relying on stopping and restarting garbage collection.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
When executing this script via lua5.4 typeof.lua I get a crash every time with the following typeof.lua script:
local vips = require "vips"
local im = vips.Image.xyz(1,1)
print(im:get_typeof("width"))
It doesn't crash with Lua 5.2, Lua 5.3 or Luajit. It also crashes in the interpreter when I enter the commands on one line like this:
Lua 5.4.8 Copyright (C) 1994-2025 Lua.org, PUC-Rio
> vips = require "vips"
> im = vips.Image.xyz(1,1); print(im:get_typeof("width"))
Ungültiger Maschinenbefehl (Speicherabzug geschrieben)
This issue (like others in the past) can be fixed by stopping and restarting garbage collection during the call to
vips_lib.vips_image_get_typeof(self.vimage, name)
in function Image_method:get_typeof(name). But there must be a better fix for these issues.
The crash also happens when I create the image with a different method that uses voperation.call, i.e.
im = vips.Image.new_from_file("filename.jpg")
or
im = vips.Image.new_from_array {0}
im = im:bandjoin(im)
In the latter example the second line is needed to create the crash. The first line doesn't use voperation.call, but calls vips_image_new_matrix_from_array directly.
I guess there is something wrong regarding garbage collection in voperation.call. It only shows up in Lu5.4 because of the more aggressive garbage collection.
- Vorherrschende Sprache
- Lua
- Sterne
- 151
- Forks
- 10
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus libvips/lua-vips
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
-
question
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 32/100
-
Usage with OpenResty?Offenquestion
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
Alle Issues in libvips/lua-vips
Ähnliche Issues
-
follow-up needs-review
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
ksysoev/duet.nvim#310 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Jaliborc/PetTracker#509 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
-
bug discord triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
fitzforge/polestar#5203 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag