Open pozix604 opened 4 months ago
run withdarktable -d lua
and see where the dt.print_log statements stop. That's where the problem is in your script
EDIT:
The last line of the backtrace tells you the problem, Segmentation fault
. You tried to access something that wasn't allocated.
It appears that you are trying to learn lua scripting for darktable. The best resource for how to is the existing scripts.
As the author of several thousand of these crashes I can tell you that it was a bug in my code every time.
Ran your script. Selected/tmp
for the output directory. Selected 4 images and exported. Got message on the screen no image to export.
You didn't handle the selected images and therefore when you tried to manipulate the non existing images darktable seg faulted.
You don't need initialize
and finalize
unless you are trying to do something tricky.
Look at contrib/gimp.lua
for how to use the exporter and then access the exported images after export.
Look at https://github.com/wpferguson/extra-dt-lua-scripts/blob/master/postsharpen.lua for an example that uses initialize (I called it setup). contrib/EnfuseAdvanced
uses initialize
and finalize
.
Hi @wpferguson. Thanks for looking into it.
What do you mean by "You didn't handle the selected images" ? Eventually, I want to filter the images list in initialize
and so I started by simply returning an empty table, meaning that I don't want to export any of the images. So, I shouldn't have to handle any of them, right? I don't have any code to manipulate any of the images. My store function just prints out some debug information.
The exporter tried to export the empty list of images. In other words it tried to access something that didn't exist and therefore it seg faulted.
Does that mean that at least one image needs to be returned from initialize
? I thought the intent of the table returned from initialize
was to allow for filtering of the images, possibly the filtering of all of them.
The documentation says it is okay to return an empty table:
return - table or nil - The modified table of images to export or nil If nil (or nothing) is returned, the original list of images will be exported If a table of images is returned, that table will be used instead. The table can be empty. The images parameter can be modified and returned
There's something I'm not understanding but I don't know what.
I reproduced the crash on a single invocation. This occurs on windows, but so far not on linux. Now that it's reproducible I'll see if I can figure it out.
After hours of troubleshooting...
src/control/jobs/control_jobs.c
function dt_control_image_enumerator_cleanup
() at the free(params)
line (give or take).Windows seems more sensitive to it, so I may try troubleshooting there since I've narrowed it down.
the issue occurs randomly
The quicker I press the export button, the quicker it will happen. Pressing the export button 5 times in a couple of seconds almost always works
If I wait for the screen message to clean (approx 5 sec) before I press the export button again, then it needs 12 - 16 repetitions before it occurs again.
This is consistent with the behavior I see on Debian 12.
Same as #14803
This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.
Describe the bug
While experimenting with Lua scripting, darktable repeatedly crashes with the following error:
At startup, darktable does not report any errors.
Script I'm testing, put into ~/.config/darktable/lua and
require
'ed inluarc
is below. Note it registers storage, but returns{}
in initialize to signify nothing to export.Steps to reproduce
Expected behavior
Should not crash
Logfile | Screenshot | Screencast
Commit
No response
Where did you obtain darktable from?
downloaded from www.darktable.org
darktable version
4.6.1
What OS are you using?
Linux
What is the version of your OS?
Debian 12
Describe your system?
No response
Are you using OpenCL GPU in darktable?
Yes
If yes, what is the GPU card and driver?
Intel Iris Xe
Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip
No response