Bug 6647 - mediatomb segfaults on avutil - probably mga2 patch was not ported over
Summary: mediatomb segfaults on avutil - probably mga2 patch was not ported over
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal critical
Target Milestone: ---
Assignee: Funda Wang
QA Contact:
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-07-01 11:51 CEST by Joseph Wang
Modified: 2012-09-16 01:38 CEST (History)
2 users (show)

See Also:
Source RPM: mediatomb-0.12.1-4-mga3
CVE:
Status comment:


Attachments
Updated spec (3.46 KB, text/x-rpm-spec)
2012-09-09 10:58 CEST, Joseph Wang
Details
patch to let mediatomb compile with newest gcc (3.90 KB, patch)
2012-09-09 10:59 CEST, Joseph Wang
Details | Diff
Valgrind crash report (150.68 KB, text/plain)
2012-09-13 15:40 CEST, Joseph Wang
Details
libav_0_7 with patch for ffmpeg (2.75 KB, patch)
2012-09-15 18:42 CEST, Joseph Wang
Details | Diff

Description Joseph Wang 2012-07-01 11:51:31 CEST
Description of problem:

The mga3 version of mediatomb breaks immediately on import with a segfault in lib64avutil.  The FAQ for mediatomb says that this is usually an issue with ffmpeg.

Installing the mga2 version works fine, and it appears that there is some patch that was not ported over to cauldron


Version-Release number of selected component (if applicable):


How reproducible:

consistent

Steps to Reproduce:
1.install mediatomb
2.restart and import files
3. crash in avutil
4. backout to mga2 release
5 works fine.
Manuel Hiebel 2012-07-01 21:45:22 CEST

CC: (none) => fundawang, jani.valimaa
Assignee: bugsquad => mageia

Jani Välimaa 2012-07-01 21:48:32 CEST

CC: jani.valimaa => (none)

Comment 1 Joseph Wang 2012-09-09 10:58:27 CEST
Created attachment 2771 [details]
Updated spec
Comment 2 Joseph Wang 2012-09-09 10:59:40 CEST
Created attachment 2772 [details]
patch to let mediatomb compile with newest gcc
Comment 3 Joseph Wang 2012-09-09 11:01:06 CEST
I've created updated specs that seem to fix the issue with a new build
Manuel Hiebel 2012-09-09 11:12:50 CEST

Keywords: (none) => PATCH

Comment 4 Funda Wang 2012-09-12 07:01:21 CEST
How about mediatomb-0.12.1-5.mga3?
Comment 5 Joseph Wang 2012-09-12 16:28:17 CEST
mediatomb-0.12.1-5.mga3 segfaulted for me when it scanned the directories.  Rebuilding somehow works.
Comment 6 Funda Wang 2012-09-13 05:25:08 CEST
What do you mean by rebuilding? I've already merged your patch regarding gcc 4.7 from gentoo.

Would you mind attaching your rebbuild log?

Status: NEW => ASSIGNED
Assignee: mageia => fundawang

Comment 7 Joseph Wang 2012-09-13 15:20:22 CEST
Got confused here.  I've tried the new mediatomb and it still segfaulted.  Unfortunately when I rebuilt my own local build, it also segfaulted.  Trying to figure out what happened.  :-(
Comment 8 Joseph Wang 2012-09-13 15:40:23 CEST
Created attachment 2793 [details]
Valgrind crash report
Comment 9 Joseph Wang 2012-09-13 15:40:47 CEST
Yuck.  Valgrind shows lots of issues.
Comment 10 Joseph Wang 2012-09-15 18:40:42 CEST
Found the problem....

The ffmpeg was not calling avformat_alloc_context()

-       AVFormatContext *pFormatCtx;
+    AVFormatContext *pFormatCtx = avformat_alloc_context();

I've got a modified libav_0.7_suppoort that fixes the problem
Comment 11 Joseph Wang 2012-09-15 18:42:17 CEST
Created attachment 2798 [details]
libav_0_7 with patch for ffmpeg
Comment 12 Joseph Wang 2012-09-15 18:49:59 CEST
Also I've reported this upstream

https://sourceforge.net/projects/mediatomb/forums/forum/440750/topic/5714043
Comment 13 Olivier Blin 2012-09-16 01:22:23 CEST
Thanks for your patch Joseph!
Though, I have a crash with your patch as well.
Reading the ffmpeg source code, avformat_close_input() already calls avformat_free_context(), so you should not call it again, or it will try to free an invalid context the second time.

CC: (none) => mageia

Comment 14 Olivier Blin 2012-09-16 01:24:15 CEST
Also, it seems that avformat_open_input() can already allocate the context, so just setting it to NULL first should do it.
Comment 15 Olivier Blin 2012-09-16 01:38:05 CEST
Fixed in mediatomb-0.12.1-6.mga3, it now indexes files properly again.
Thanks Joseph for spotting the issue!

Updated patch is available here:
http://svnweb.mageia.org/packages/cauldron/mediatomb/current/SOURCES/libav_0.7_support.patch?revision=294279&view=markup

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.