Few MPG clips that cause crashes

Hi,

From

http://jakorasia.homelinux.org/kamera/

you can find a few mpeg clips that cause various types of crashes and buggy behaviour in kdenlive.

Most repeatable way to crash kdenlive is take for example MPG_0003.MPG, add it to the timeline and try to razor the clip at about halfway.

Other easy way is to take the same clip, add it to timeline so that the clip middlepoint is at about 5s (does not work if placed at the beginning), and place the preview cursor at 5s point.

Even if kdenlive does not crash, the preview window often shows either green or noise. At this point, crash will happen very soon.

Crashes on both x86 and amd64
The systems are debian sid/experimental, kdenlive version 0.4.
The kdenlive/mlt packages are the latest from debian-multimedia.org/sid

I've made backtrace under gdb and run under valgrind, but the bt seems to have some problems.
Full logs are available at the same URL as the clips.

gdb:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1269970032 (LWP 25597)]
0xb59af5e0 in ?? () from /usr/lib/libswscale.so.0
(gdb) bt
#0 0xb59af5e0 in ?? () from /usr/lib/libswscale.so.0
(gdb)

valgrind:
kdenlive: WARNING: selectedEffectIndex = -1
kdenlive: +++++++++++ Generating scenelist start... ++++++++++++++++++
==25994==
==25994== Thread 2:
==25994== Invalid read of size 8
==25994== at 0x7E3C5E0: (within /usr/lib/libswscale.so.0.5.0)
==25994== Address 0x0 is not stack'd, malloc'd or (recently) free'd
KCrash: Application 'kdenlive' crashing...

Please let me know if you need more info. Also, it would be nice if somebody could try to replicate the crashes on other systems.

I'll compile and install the SVN version later. Maybe that will solve the problem or at least gives better backtrace.

Forums:

I was able to edit and view the file as proposed without crash. Maybe you sou should consider upgrading to Kdenlive 0.5 / MLT svn OR wait for a release before doing further debugging. There were so many changes that Kdenlive 0.4 should be considered deprecated, my opinion.

Ok, I got the latest svn of kdenlive/mlt/ffmpeg built with the kdenlive_builder.sh script.

The crash is still happening. The backtrace/valgrind log now has debugging information :)
You can find the full logs on the same URL as the clips.

gdb tells basically this:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1233111360 (LWP 24512)]
mlt_frame_rescale_yuv422 (this=0x8a8ffb8, owidth=60, oheight=46) at mlt_frame.c:1075
1075 *out_ptr ++ = *( in_line + base );
Current language: auto; currently c
(gdb) bt
#0 mlt_frame_rescale_yuv422 (this=0x8a8ffb8, owidth=60, oheight=46) at mlt_frame.c:1075
#1 0xb646a5cf in filter_scale (this=0x8a8ffb8, image=0xbfc8f6f0, iformat=mlt_image_yuv422, oformat=mlt_image_yuv422, iwidth=320, iheight=240, owidth=60, oheight=46) at filter_rescale.c:46
#2 0xb646acff in filter_get_image (this=0x8a8ffb8, image=0xbfc8f6f0, format=0xbfc8f748, width=0xbfc8f53c, height=0xbfc8f538, writable=0) at filter_rescale.c:228
#3 0xb7f8f004 in mlt_frame_get_image (this=0x8a8ffb8, buffer=0xbfc8f6f0, format=0xbfc8f748, width=0xbfc8f53c, height=0xbfc8f538, writable=0) at mlt_frame.c:257
#4 0xb646b009 in filter_get_image (this=0x8a8ffb8, image=0xbfc8f6f0, format=0xbfc8f748, width=0xbfc8f7dc, height=0xbfc8f7e0, writable=0) at filter_resize.c:114
#5 0xb7f8f004 in mlt_frame_get_image (this=0x8a8ffb8, buffer=0xbfc8f6f0, format=0xbfc8f748, width=0xbfc8f7dc, height=0xbfc8f7e0, writable=0) at mlt_frame.c:257
#6 0xb6174f65 in filter_get_image (this=0x8a8ffb8, image=0xbfc8f6f0, format=0xbfc8f748, width=0xbfc8f7dc, height=0xbfc8f7e0, writable=0) at filter_avcolour_space.c:100
#7 0xb7f8f004 in mlt_frame_get_image (this=0x8a8ffb8, buffer=0xbfc8f6f0, format=0xbfc8f748, width=0xbfc8f7dc, height=0xbfc8f7e0, writable=0) at mlt_frame.c:257
#8 0xb7f75f55 in Mlt::Frame::get_image () from /home/chevfi/build/kdenlive.2007-08-06_12_05/lib/libmlt++.so.0.2.4
#9 0x0813b92a in KThumb::getImage (this=0x85d3f20, url=@0xbfc8f820, frame=45, width=60, height=48) at kthumb.cpp:170
#10 0x081dc525 in KThumb::qt_invoke (this=0x85d3f20, _id=2, _o=0xbfc8f910) at kthumb.moc.cpp:153
#11 0xb70cfd23 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#12 0x081f0ddc in DocClipRef::getClipThumbnail (this=0x85d1bb0, t0=@0xbfc8f9d8, t1=45, t2=62, t3=50) at docclipref.moc.cpp:208
#13 0x080aa974 in DocClipRef::doFetchEndThumbnail (this=0x85d1bb0) at docclipref.cpp:244
#14 0x0812f9ef in Command::KResizeCommand::execute (this=0x8762590) at kresizecommand.cpp:64
#15 0xb7a42e4b in KMacroCommand::execute () from /usr/lib/libkdeui.so.4
#16 0xb7a42e4b in KMacroCommand::execute () from /usr/lib/libkdeui.so.4
#17 0xb7ac4a75 in KCommandHistory::addCommand () from /usr/lib/libkdeui.so.4
#18 0x080f4ff8 in Gui::KdenliveApp::addCommand (this=0x8294d38, command=0x85a9490, execute=true) at kdenlive.cpp:2889
#19 0x080f5139 in Gui::KdenliveApp::slotRazorSelectedClips (this=0x8294d38) at kdenlive.cpp:4425
#20 0x081de513 in Gui::KdenliveApp::qt_invoke (this=0x8294d38, _id=178, _o=0xbfc8fd9c) at kdenlive.moc.cpp:740
#21 0xb70cfd23 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#22 0xb70d07c8 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#23 0xb7a2d709 in KAction::activated () from /usr/lib/libkdeui.so.4
#24 0xb7a62ab2 in KAction::slotActivated () from /usr/lib/libkdeui.so.4
#25 0xb7b2ed2d in KAction::slotPopupActivated () from /usr/lib/libkdeui.so.4
#26 0xb7b2eff1 in KAction::qt_invoke () from /usr/lib/libkdeui.so.4
#27 0xb70cfd23 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#28 0xb745c360 in QSignal::signal () from /usr/lib/libqt-mt.so.3
#29 0xb70efd4e in QSignal::activate () from /usr/lib/libqt-mt.so.3
#30 0xb71f6611 in QPopupMenu::mouseReleaseEvent () from /usr/lib/libqt-mt.so.3
#31 0xb7a3690e in KPopupMenu::mouseReleaseEvent () from /usr/lib/libkdeui.so.4
#32 0xb7106cb2 in QWidget::event () from /usr/lib/libqt-mt.so.3
#33 0xb70674e0 in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#34 0xb70696a1 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#35 0xb7823122 in KApplication::notify () from /usr/lib/libkdecore.so.4
#36 0xb6ffa609 in QApplication::sendSpontaneousEvent () from /usr/lib/libqt-mt.so.3
#37 0xb6ff8feb in QETWidget::translateMouseEvent () from /usr/lib/libqt-mt.so.3
#38 0xb6ff76da in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#39 0xb700dfb8 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#40 0xb7081be6 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#41 0xb70819f6 in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#42 0xb7069089 in QApplication::exec () from /usr/lib/libqt-mt.so.3
#43 0x0814da77 in main (argc=136506348, argv=0xb69a93e2) at main.cpp:107

Could you save and publish your project file, please?

I uploaded the project file to the same place.
It crashes here as soon as I try to razor the clip in half

Thanks. I downloaded the XML project and files, and adapted paths.
Sorry, I cannot reproduce, maybe because I use SDL display (?).
I can razor the file in two, three or four sections.
And play around.

Thanks for trying it out. I guess I'll have to try the SVN version on my other (amd64) machine also and debug it some more.
Maybe it's caused by some other library... There may be some unstable libraries coming from debian experimental.

My machine is plain AMD64 from Debian SID, with Marillat ffmpeg packages.
Then I recompiled SVN versions of kdenlive and MLT using shared libraries, just like in plain packages.

talk to you later on.

I was not able to reproduce the crash by razoring the MPEG_0003.MPEG.
The backtrace appears in the area where there were some bugfixes:

http://mlt.svn.sourceforge.net/viewvc/m ... c?view=log

I do get horrible image corruption with seeking around that video due to its temporal compression and long gop.