https://bugs.kde.org/show_bug.cgi?id=474362

--- Comment #4 from Maksim K. <maksim.e.koz...@gmail.com> ---
After some investigation I think I found workaround for my case (FreeBSD). I
launched kdenlive in gdb and saw that kdenlive creates a lot of threads (more
then 16000 at the crash/hang time):

Thread 16138 received signal SIGSEGV, Segmentation fault.
Address not mapped to object.
[Switching to LWP 462857 of process 40657]
0x0000000814ac6d9d in ?? () from /usr/local/lib/mlt-7/libmltavformat.so
(gdb) bt
#0  0x0000000814ac6d9d in  () at /usr/local/lib/mlt-7/libmltavformat.so
#1  0x0000000800eebf35 in mlt_frame_get_audio () at
/usr/local/lib/libmlt-7.so.7
#2  0x0000000814ad0514 in  () at /usr/local/lib/mlt-7/libmltavformat.so
#3  0x0000000800eebf35 in mlt_frame_get_audio () at
/usr/local/lib/libmlt-7.so.7
#4  0x00000008145d8d9e in  () at /usr/local/lib/mlt-7/libmltcore.so
#5  0x0000000800eebf35 in mlt_frame_get_audio () at
/usr/local/lib/libmlt-7.so.7
#6  0x0000000800ee883d in  () at /usr/local/lib/libmlt-7.so.7
#7  0x00000008044dea78 in  () at /lib/libthr.so.3
#8  0x0000000000000000 in  ()
(gdb) info threads
  Id   Target Id                                  Frame 
  1    LWP 115972 of process 40657                0x000000080574c29c in ?? ()
from /usr/local/lib/libfreetype.so.6
  2    LWP 446587 of process 40657                0x000000080416029a in _poll
() from /lib/libc.so.7
  3    LWP 446588 of process 40657 "pool-spawner" 0x00000008044dbd2c in ?? ()
from /lib/libthr.so.3
  4    LWP 446589 of process 40657 "gmain"        0x000000080416029a in _poll
() from /lib/libc.so.7
  5    LWP 446590 of process 40657 "gdbus"        0x000000080416029a in _poll
() from /lib/libc.so.7
  6    LWP 446591 of process 40657                0x000000080416029a in _poll
() from /lib/libc.so.7
  7    LWP 446592 of process 40657                0x00000008041601da in _kevent
() from /lib/libc.so.7
  9    LWP 446623 of process 40657                0x000000080416029a in _poll
() from /lib/libc.so.7
  10   LWP 446624 of process 40657                0x000000080416029a in _poll
() from /lib/libc.so.7
  11   LWP 446625 of process 40657                0x000000080416029a in _poll
() from /lib/libc.so.7
  12   LWP 446626 of process 40657                0x000000080416029a in _poll
() from /lib/libc.so.7
  13   LWP 446627 of process 40657                0x000000080416029a in _poll
() from /lib/libc.so.7
  14   LWP 446628 of process 40657                0x000000080416029a in _poll
() from /lib/libc.so.7
  15   LWP 446629 of process 40657                0x000000080416029a in _poll
() from /lib/libc.so.7
  16   LWP 446630 of process 40657                0x000000080416029a in _poll
() from /lib/libc.so.7
  17   LWP 446631 of process 40657                0x000000080416029a in _poll
() from /lib/libc.so.7
  27   LWP 446642 of process 40657                0x00000008041602ba in _ppoll
() from /lib/libc.so.7
  28   LWP 446643 of process 40657                0x00000008041602ba in _ppoll
() from /lib/libc.so.7
  40   LWP 446657 of process 40657 "dconf worker" 0x000000080416029a in _poll
() from /lib/libc.so.7
  57   LWP 446693 of process 40657 "av:h264:df0"  0x00000008044dbd2c in ?? ()
from /lib/libthr.so.3
  58   LWP 446694 of process 40657 "av:h264:df1"  0x00000008044dbd2c in ?? ()
from /lib/libthr.so.3
  59   LWP 446695 of process 40657 "av:h264:df2"  0x00000008044dbd2c in ?? ()
from /lib/libthr.so.3
  60   LWP 446696 of process 40657 "av:h264:df3"  0x00000008044dbd2c in ?? ()
from /lib/libthr.so.3

...

  16134 LWP 462821 of process 40657 "av:h264:df15" 0x00000008044dbd2c in ?? ()
from /lib/libthr.so.3
  16135 LWP 462822 of process 40657                0x00000008044dbd2c in ?? ()
from /lib/libthr.so.3
  16136 LWP 462855 of process 40657 "PulseHotplug" 0x00000008041602ba in _ppoll
() from /lib/libc.so.7
  16137 LWP 462856 of process 40657                0x00000008044dbd2c in ?? ()
from /lib/libthr.so.3
* 16138 LWP 462857 of process 40657                0x0000000814ac6d9d in ?? ()
from /usr/local/lib/mlt-7/libmltavformat.so

At the same time, I have in my system:

kern.maxthread: 1000000
kern.threads.max_threads_hits: 7135
kern.threads.max_threads_per_proc: 2048

max_threads_hits is just a count, as I understand, which show how many times we
reached threads limit. So I increased max_threads_per_proc value iterately
(with reboot) and found that max_threads_hits decreases on every iteratition
(after launch kdenlive) and become 0 when max_threads_per_proc reached 16384
and kdelive launch my project corretly without crash. So, now I set
max_threads_per_proc=32768 and it seems that this resolves my problem

But I beleave that "low" number of threads in system settings is not root cause
of the problem. This is because, my previous project was large:  ~1700 clips vs
carrent has ~1200, but I had no problem with previous version of Kdenlive 
(22.12.0). Also, it is a question - is application really need create so many
threads? And is this corret behavior to crahs, not just waiting to release
system resourses?

I hope above info will help to find problem.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to