Bug 474565

Summary: Crash upon hitting open file limit
Product: [Applications] kdenlive Reporter: jackleberry
Component: Project Bin & ImportAssignee: Jean-Baptiste Mardelle <jb>
Status: CONFIRMED ---    
Severity: crash CC: fritzibaby, snd.noise
Priority: NOR    
Version First Reported In: 23.08.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description jackleberry 2023-09-15 17:49:12 UTC
SUMMARY

Kdenlive crashes when it hits the open file limit. Possibly this could be handled more gracefully, as this is likely to happen with any big project.

STEPS TO REPRODUCE
1. Have a project with lots of clips 
2. Open project
3.  Crash

OBSERVED RESULT

Crashes

EXPECTED RESULT

Some kind of helpful error message

SOFTWARE/OS VERSIONS

ADDITIONAL INFORMATION

Workaround was to run ulimit -n 10000 before running kdenlive.

To test, you could run ulimit -n 10 first. Debian seems to default to 1000, which is hit pretty easily. Probably kdenlive is keeping far more file handles open than it actually needs to (this likely accounts for some of the excessive memory consumption as well)
Comment 1 emohr 2023-10-01 11:24:00 UTC
Thank you for the report. This issue should be solved in the actual master as we switch to not storing producers on which we did a get_frame operation. https://invent.kde.org/multimedia/kdenlive/-/commit/d479d8819f8ce97d437ee076d0abd951c3cd4180
Comment 2 jackleberry 2023-10-03 04:19:02 UTC
I tried with git today's git master and experienced the same thing. kdenlive crashes unless the open file limit is increased. There are 476 clips in the project, and the default open file limit is 1000.
Comment 3 jackleberry 2023-10-03 04:33:36 UTC
I checked the number of file handles kdenlive has open for this project: 2154

That's 4.5 file handles open per clip. Some of these have got to be redundant, and probably they don't need to be open all the time.
Comment 4 farid 2023-10-17 13:26:16 UTC
(In reply to jackleberry from comment #2)
> I tried with git today's git master and experienced the same thing. kdenlive
> crashes unless the open file limit is increased. There are 476 clips in the
> project, and the default open file limit is 1000.

But did you try using MLT master as well?
Comment 5 farid 2023-10-17 13:26:44 UTC
Could you try to reproduce this with the AppImage?