Bug 332721 - Crash when reading a certain MP4 video file
Summary: Crash when reading a certain MP4 video file
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Video (show other bugs)
Version: 3.5.0
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-28 03:08 UTC by JKAbrams
Modified: 2018-02-28 12:38 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.0


Attachments
The offending video (2.00 MB, video/mp4)
2014-03-28 03:20 UTC, JKAbrams
Details
Offending video 5kb (4.88 KB, video/mp4)
2014-03-28 03:22 UTC, JKAbrams
Details
Stracktrace, but without debug symbols (21.64 KB, text/plain)
2014-03-28 11:41 UTC, JKAbrams
Details

Note You need to log in before you can comment on or make changes to this bug.
Description JKAbrams 2014-03-28 03:08:33 UTC
I have isolated a certain mp4-file that crashes Digikam while indexing the file.


Reproducible: Always

Steps to Reproduce:
Paste file into a digikam album-folder inside digikam.
OR
Place file in a album folder outside of digikam and start digikam to let it index the file.
Actual Results:  
1. digikam tries to index the file
2. digikam crashes

Expected Results:  
-

I tried to cut the file to see what would happen, cut it all the way down to 5kb and it still crashes.

Original file was 29mb, unfortunately I can't publish the full file, but these pieces still triggers the crash
http://jkabrams.se/files/digikam-crash/video_crashing_digikam_5k.mp4
http://jkabrams.se/files/digikam-crash/video_crashing_digikam_500k.mp4
http://jkabrams.se/files/digikam-crash/video_crashing_digikam_2m.mp4

Console output
http://pastebin.com/6ZwH6hs7
Comment 1 JKAbrams 2014-03-28 03:20:13 UTC
Created attachment 85801 [details]
The offending video

Sorry about my links not working, (something wrong with my server mimetype settings).
Here's the 2mb version of the file.
Comment 2 JKAbrams 2014-03-28 03:22:50 UTC
Created attachment 85802 [details]
Offending video 5kb

And the 5kb version.
Comment 3 caulier.gilles 2014-03-28 04:53:36 UTC
run digiKam in a console through GDB to get a backtrace to hack, as explained here :

http://www.digikam.org/contrib

Gilles Caulier
Comment 4 JKAbrams 2014-03-28 11:41:03 UTC
Created attachment 85807 [details]
Stracktrace, but without debug symbols

(In reply to comment #3)
> run digiKam in a console through GDB to get a backtrace to hack, as
> explained here :
> 
> http://www.digikam.org/contrib
> 
> Gilles Caulier

It's not reproducible then? Guess I'll have to figure out how to build it with debugging symbols for Arch then. Would it be enough to rebuild only digikam itself with debugging symbols or will I also need to rebuild the dependencies?
Here is the stack trace I have now, is it of any use without the debug symbols?
Comment 5 caulier.gilles 2014-03-28 12:47:43 UTC
From your trace it crash in Exiv2 shared lib when video file is parsed:

Thread 24 (Thread 0x7fa970e9e700 (LWP 540)):
[KCrash Handler]
#5  0x00007fa99830c7d5 in Exiv2::QuickTimeVideo::movieHeaderDecoder(unsigned long) () from /usr/lib/libexiv2.so.13
#6  0x00007fa99830dd9b in Exiv2::QuickTimeVideo::tagDecoder(Exiv2::DataBuf&, unsigned long) () from /usr/lib/libexiv2.so.13
#7  0x00007fa99830e1a0 in Exiv2::QuickTimeVideo::decodeBlock() () from /usr/lib/libexiv2.so.13
#8  0x00007fa99830dd40 in Exiv2::QuickTimeVideo::tagDecoder(Exiv2::DataBuf&, unsigned long) () from /usr/lib/libexiv2.so.13
#9  0x00007fa99830e1a0 in Exiv2::QuickTimeVideo::decodeBlock() () from /usr/lib/libexiv2.so.13
#10 0x00007fa99830e3d5 in Exiv2::QuickTimeVideo::readMetadata() () from /usr/lib/libexiv2.so.13
#11 0x00007fa9a02d1be5 in KExiv2Iface::KExiv2::load(QString const&) const () from /usr/lib/libkexiv2.so.11

Please report this problem to Exiv2 bugzilla. Thanks in advance

Gilles Caulier
Comment 6 Joseph Reagle 2014-10-06 20:37:35 UTC
I have this problem too.
Comment 7 Joseph Reagle 2014-10-06 20:40:32 UTC
Is there a pointer to where this was resolved upstream? Also, even if exiv2 fails, sucks for digikam to segfault.
Comment 8 caulier.gilles 2015-02-01 07:27:27 UTC
*** Bug 343643 has been marked as a duplicate of this bug. ***
Comment 9 caulier.gilles 2015-03-24 05:50:33 UTC
*** Bug 345457 has been marked as a duplicate of this bug. ***
Comment 10 caulier.gilles 2015-09-16 04:48:06 UTC
*** Bug 352777 has been marked as a duplicate of this bug. ***
Comment 11 caulier.gilles 2018-02-28 12:38:05 UTC
With 6.0.0, we have now a FFMpeg low level metadata parser based on libav C API
for video files database registration.

The Exiv2 video support is not used anymore as this code is buggous and nobody
sound motivated in Exiv2 to finalize the code.

The original post for this file must be fixed now and video metadata support
with ffmpeg must be enough to populate database entries.

Gilles Caulier