Darktable crashes at initial startup

Darktable 5.4.1 crashes at initial statup. It keeps hanging at ‘Initializing Lua’. If I force it to close and then statup again it will startup normally. I am on Windows 11. I already deleted it and installed again, but that made no difference.

Jan

Did you delete all the config files in users"username"\appdata\local\darktable… you might have a corruption there… if this was a first time install and you have nothing to save in those files you could delete them and try again…

“USERNAME” would be replaced by your username on the PC

You could also try installing DT but use a modified path and try again… otherwise the next step would be to look for some information in the log files…

We thought we had it fixed in 5.4.1. There is some kind of race condition that we can’t reproduce consistently enough to identify and fix it. The worst part is adding logging to help identify the problem slows darktable down some which makes it even more difficult to create a race condition and reproduce the problem.

If you’re willing to try something, you can replace the <darktable install directory>\share\darktable\luarc file with
luarc.txt (570 Bytes)
but rename it to luarc first.

I removed all the scripts installer code which should make it complete faster and possibly avoid the race condition. You could rename the old luarc to luarc.old.

Either way, we have another data point.

EDIT: The code I removed should go away in darktable 5.6, so if this “fixes it” or prevents it from happening I can kill 2 birds with 1 stone.

Thanks!

I have done it and it looks to be working.

After 2 or 3 times the problem did come back, so I also substitute your file in the windows folder “C:\Users\UserName\AppData\Local\darktable”, and now it’s working.

I will report if it returns.

1 Like

I did the same and it worked fine.

Jan

1 Like

I’m guessing that neither of you had the lua scripts installed and had not disabled scripts_installer being shown.

The next test would be someone having the problem and setting scripts_installer to not show

I was also facing the same problem. Now this has been solved.

Like I said, DT starts up fine now, but I lost all of my Lua options and external editors. Don’t know how to fix that.
Jan

I have reverted my settings to the original to test what I had on “Lua options”, and I had “check for updated scripts on start up” and “lua scripts installer don’t show again” activated.
With these settings it hangs.
Then I turned both off, tested and it hang again.
Resuming: it just does not hang if I do what I describe in my post above (your advice plus doing the same on the user darktable folder).

1 Like

Darn! I was afraid you were going to say that.

But, thanks for the info :smile:. Now I have a different place to look…

Found the problem. darktable sets the current view before it starts changing the view, so if the timing is just right we catch it before the view change completes and we have a hang. Tried a simple fix (moving the setting after the change) but it resulted in a spectacular crash so it’s going to require some thinking.

Great that you found it (and so fast!).
I have no problem to wait as much as it’s necessary.
BTW: thank you a lot for the hard work you and all the other developers are putting in this extraordinary piece of software.

1 Like

There’s now a PR to fix the hang.

This is the fixed luarc file
luarc.txt (15.2 KB)

Just rename it to luarc and put it in the <darktable install location>\share\darktable folder.

It still hangs for me.
I have reverted to the original (hanging) darktable luarc installation in both “C:\Program Files\darktable\share\darktable” and “C:\Users\UserName\AppData\Local\darktable”.
Then, I have put your new lua file in the “C:\Program Files\darktable\share\darktable”, renaming it from luarc.txt to luarc.
Rebooted the computer, so all the memory was clean.
Loaded darktable, and it hanged (and keeps on doing it every time a new power up of the computer is done).

Okay, I’ll see if I can get it to reproduce.

Can you check that the <install dir>\share\darktable\luarc file has a darktable_gui_safe line near the start of the file?

Yes it has, the line is:
darktable_gui_safe = false
and it’s the 26th line on the file.

Here’s another copy of the luarc file with some print statements to let me know what it’s doing.

luarc.txt (15.6 KB)

If you can add -d lua at the end of the darktable start command and then send me a copy of the darktable log file (%USERPROFILE%\Darkable\darktable-log.txt) that would help.

Thanks

This new Luarc file worked for me. I tied yesterday evening and this morning and no crashes any more. I also have back my external editors. Maybe because I use the original Luac file in my C:\Users\UserName\AppData\Local\darktable folder again.
Thanks! Jan

2 Likes

This worked for me. Thanks

1 Like