Bug 467515 - Crash when switching around clips with transforms
Summary: Crash when switching around clips with transforms
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Video Effects & Transitions (other bugs)
Version First Reported In: 22.12.3
Platform: Mint (Ubuntu based) Linux
: NOR crash
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-18 09:18 UTC by chocolateimage
Modified: 2024-01-23 17:16 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Video of how to crash kdenlive (3.31 MB, video/mp4)
2023-03-18 09:18 UTC, chocolateimage
Details

Note You need to log in before you can comment on or make changes to this bug.
Description chocolateimage 2023-03-18 09:18:18 UTC
Created attachment 157384 [details]
Video of how to crash kdenlive

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Create a new color clip with a transform on it
2. Create a new title clip with a transform on it
3. Then switch around the clips, after like 10 seconds it will crash

OBSERVED RESULT
The transform effect only renders the titlebar and it crashes

With the following stuff:
MUTEX UNLOCK!!!!!!!!!!!! setmodel
MUTEX LOCK!!!!!!!!!!!! loadEffects COUNT:  0
-----
// SHOW KEYFRAMES:  true
deleting collapsibleeffectview
qml: [kdenlive/effect]
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Aborted (core dumped)

The crash seems to come from src/abstractmodel/abstracttreemodel.cpp line 192: Q_ASSERT(m_allItems.count(id) > 0);

EXPECTED RESULT
No crash

SOFTWARE/OS VERSIONS
Linux: Linux Mint 21.1 Cinnamon Edition
KDE Frameworks: 5.92.0
Qt Version: 5.13.3 (built against 5.13.3)
MLT: 7.14.0

ADDITIONAL INFORMATION
Also happens on Version 23.07.70 (rev. 4464e940e). compiled from source
Comment 1 chocolateimage 2023-04-20 11:53:29 UTC
Any updates on this? It also happens when I just cut which is really annoying: https://www.youtube.com/watch?v=k4oWpRf_Sr8
Comment 2 chocolateimage 2023-04-20 11:59:59 UTC
Full backtrace from gdb:
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737230646912) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737230646912) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737230646912, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff4b2a476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff4b107f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff50b1ba3 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff50b0ff0 in qt_assert_x(char const*, char const*, char const*, int) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00005555556b0d9f in AbstractTreeModel::getItemById(int) const (this=0x555559918ad0, id=494) at /home/lukas/gits/kdenlive/src/abstractmodel/abstracttreemodel.cpp:192
#8  0x00005555556b0792 in AbstractTreeModel::rowCount(QModelIndex const&) const (this=0x555559918ad0, parent=...) at /home/lukas/gits/kdenlive/src/abstractmodel/abstracttreemodel.cpp:115
#9  0x00007ffff527441f in QAbstractItemModel::hasChildren(QModelIndex const&) const () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007ffff66c6760 in  () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007ffff03c1e94 in  () at /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#12 0x00007ffff03c4c2f in  () at /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#13 0x00007ffff69d461f in  () at /lib/x86_64-linux-gnu/libQt5DBus.so.5
#14 0x00007ffff69d6dac in  () at /lib/x86_64-linux-gnu/libQt5DBus.so.5
#15 0x00007ffff530841e in QObject::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007ffff6456713 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x00007ffff52dae3a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007ffff52ddf27 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007ffff5334a67 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007ffff36d7d3b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007ffff372c6c8 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007ffff36d53e3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007ffff53340b8 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007ffff52d975b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007ffff52e1cf4 in QCoreApplication::exec() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#26 0x000055555563e8ce in main(int, char**) (argc=1, argv=0x7fffffffdcb8) at /home/lukas/gits/kdenlive/src/main.cpp:352
Comment 3 Bernd 2023-04-20 14:27:50 UTC
(In reply to chocolateimage from comment #1)
> Any updates on this? It also happens when I just cut which is really
> annoying: https://www.youtube.com/watch?v=k4oWpRf_Sr8

I cannot reproduce this behavior with installed version 22.12.1 or appimage 22.12.2 on Pop!_OS 22.04
Comment 4 emohr 2023-04-21 06:33:29 UTC
I cannot reproduce either on Windows. Please try with the current Kdenlive AppImage version 22.12.3 to see if there are any packaging issues https://kdenlive.org/en/download/
Comment 5 Jean-Baptiste Mardelle 2023-04-21 07:54:03 UTC
The crash seems to happen in Qt. One thing I don't understand is that we require Qt 5.15.2 since Kdenlive 22.08.0, but you mention using Qt 5.13.3 ?? Is that a typo ? It shouldn't be possible to compile Kdenlive with such Qt version
Comment 6 chocolateimage 2023-04-21 15:47:51 UTC
I am on linux mint (may cause old packages) and in the appimage version it also does not work. I found a fix for this issue:

in src/abstractmodel/abstracttreemodel.cpp
change function "int AbstractTreeModel::rowCount(const QModelIndex &parent) const" to this:

int AbstractTreeModel::rowCount(const QModelIndex &parent) const
{
    if (parent.column() > 0) return 0;

    std::shared_ptr<TreeItem> parentItem;
    if (!parent.isValid())
        parentItem = rootItem;
    else {
        int parent_internalId = int(parent.internalId());
        if (m_allItems.count(parent_internalId) == 0) {
            return 0;
        }
        parentItem = getItemById(parent_internalId);
        if (parentItem == nullptr) {
            return 0;
        }
    }

    return parentItem->childCount();
}
Comment 7 chocolateimage 2023-04-21 15:49:10 UTC
oh, i just checked again, it's not version 5.13.3, it's version 5.15.3: https://imgur.com/a/YA2CqWo
Comment 8 farid 2023-04-21 17:34:14 UTC
Cannot reproduce on self built sources on Arch nor in AppImage.
Comment 9 Jean-Baptiste Mardelle 2023-04-23 08:49:36 UTC
Git commit 9add99b23b4afa29eb665855109ed71e72f23f87 by Jean-Baptiste Mardelle.
Committed on 23/04/2023 at 08:49.
Pushed by mardelle into branch 'master'.

Delete selection model in effectstask to avoid possibly incorrect indexes.

M  +7    -1    src/effects/effectstack/view/effectstackview.cpp

https://invent.kde.org/multimedia/kdenlive/commit/9add99b23b4afa29eb665855109ed71e72f23f87
Comment 10 Jean-Baptiste Mardelle 2023-04-23 08:50:20 UTC
The problem with your patch in comment 6 is that it silently discards requests with invalid item id, so it just hides the real problem. We need to understand why in the first place we have requests with items that are not in m_allItems.

The other problem is that you seem to be the only one having this issue, so harder to fix without being able to reproduce. I just pushed a tentative fix to Kdenlive's git master that might fix a case of invalid item. Could you compile and test, or test tomorrow's AppImage to see if it changes anything ? Thanks
Comment 11 chocolateimage 2023-04-25 17:51:27 UTC
I have tried it and it still crashed, I think this is the correct version: (YouTube) https://youtu.be/qfPTj8Y8e9A
Comment 12 chocolateimage 2023-04-26 15:34:39 UTC
Found a way to reproduce (on linux mint 21.1 cinnamon, i tried in a vm and it crashes!):
1. do "sudo apt install kdenlive" (without ppa)
2. open kdenlive (and notice that the version is too old)
3. do "sudo apt remove kdenlive kdenlive-data"
4. do "sudo add-apt-repository ppa:kdenlive/kdenlive-stable" and "sudo apt update"
5. install kdenlive again: "sudo apt install kdenlive"
6. get weird error messages from melt7
7. open kdenlive and reproduce the issue
Comment 13 chocolateimage 2023-04-26 15:58:44 UTC
forgot to make a video: (YouTube) https://youtu.be/8L6MCUHG6lo
weirdly it didn't work in this recording (the first section, the other vm worked, just install some other random stuff)... ughhh...
Comment 14 Bug Janitor Service 2023-05-11 03:45:54 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 15 Bug Janitor Service 2023-05-26 03:45:42 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 16 Binjomin Szanto-Varnagy 2024-01-23 12:17:32 UTC
For me still crashes Kdenlive 23.08.4, on Linux Mint 21.3.
Comment 17 Binjomin Szanto-Varnagy 2024-01-23 12:26:40 UTC
With AppImage, same versions, the issue is seemingly not present.
Comment 18 emohr 2024-01-23 17:16:35 UTC
Thank you for the feedback. If the AppImage is working then it’s most likely an upstream issue with the Mint packager.

I close this bug. If it still appears in the latest version, please feel free to re-open it and update the affected version number.