Bug#498216: ffmpeg, mplayer (mipsel/loongson2f) stops with the error message "Segmentation fault." and fix patch

Reinhard Tartler siretart at tauware.de
Mon Sep 8 21:08:51 UTC 2008


Fabian, please make sure that you don't accidentally CC'
submit at bugs.debian.org.

Fabian Greffrath <greffrath at leat.rub.de> writes:

> Upstream has renamed this variable to 'initialized' in r11920, but 
> still has it uninitialized [sic!].
>
> Reinhard, could you please submit this small patch upstream and 
> include it in our tree?
>
> Cheers,
> Fabian
>
> 刘世伟 schrieb:
>> Package: ffmpeg
>> Version: 0.svn20080206-12
>> Severity: critical
>> Justification: breaks unrelated software
>> 
>> *** Please type your report below this line ***
>> (gdb) run
>> Starting program: /usr/bin/ffmpeg
>> [Thread debugging using libthread_db enabled]
>> [New Thread 0x2aad0f40 (LWP 26315)]
>> 
>> Program received signal SIGSEGV, Segmentation fault.
>> [Switching to Thread 0x2aad0f40 (LWP 26315)]
>> 0x2abe11e8 in avcodec_register_all () at
>> /usr/src/ffmpeg/ffmpeg-debian-0.svn20080206/libavcodec/allcodecs.c:58
>> warning: Source file is more recent than executable.
>> 58          if (inited)
>> 
>> fix this bug:
>> --- ffmpeg-debian-0.svn20080206.orig/libavcodec/allcodecs.c
>> +++ ffmpeg-debian-0.svn20080206/libavcodec/allcodecs.c
>> @@ -53,7 +53,7 @@
>>  */
>>  void avcodec_register_all(void)
>>  {
>> -    static int inited;
>> +    static int inited=0;
>> 
>>    if (inited)
>>        return;
>> 

That's, uhm, interesting. I've done some tests with the following
program:

#include<stdio.h>

void print() {
  static int s;

  printf("s: %d\n", s);
}

int main () {
  print();
}

I've compiled it on morales.debian.org, a mipsel porter machine with
CFLAGS set to -O0, -O2, O3 and -Os, all returned 0. AFAIR, static
variables are always initialized to 0, but I don't have the C standard
at hand right now.

刘世伟, TBH, this looks rather like a miscompilation issue here. Is
there something special with gcc on mispel? Perhaps can the mips porter
list help here?

-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4





More information about the pkg-multimedia-maintainers mailing list