[FFmpeg-devel] [PATCH] Force users to specify memalign_hack in configure

Michael Kostylev mik
Tue May 6 15:36:56 CEST 2008


At Mon, 05 May 2008 16:39:43 +0100,
Ramiro Polla wrote:

 >>>>>> The option to use it or not should be there through configure IMO.
 >>>>> Is it an option? Does it work without?
 >>>> It *should* work without. All regression tests are failing on Windows 
 >>>> ATM, so I'll investigate further some other time.
 >>> Taking [0][1][2] into account, FFmpeg passes make test on Windows with:
 >>> ./configure --disable-mmx
 >>> make
 >>> make test
 >>> Could the DOS users try to confirm this on DOS too, please?
 >> --enable-memalign-hack is necessary as before, I don't know what you expect.
 > Does DOS crash with normal (not mmx) reads to unaligned memory?

Nope.

 > So this testcase should crash:
 > int main()
 > {
 >      int foobar[2];
 >      char *ptr = (char*)foobar;
 >      return *((int)(ptr+1));
 > }
 > If that is the case, then you should probably unset fast_unaligned in 
 > configure.

If you mean *((int *)(ptr+1)) - it works as well as unsetting of fast_unaligned has no effect.

 > And please give us more information about this crash. You have not yet 
 > provided any gdb output as to where and how it crashes. Also I couldn't 
 > find any docs on the Internet about this DOS fragility.

(gdb) r
Starting program: d:/src/ffmpeg-export-2008-05-06/ffmpeg_g.exe

Program received signal SIGSEGV, Segmentation fault.
sws_getContext (srcW=16, srcH=16, srcFormat=0, dstW=16, dstH=16, dstFormat=0,
    flags=4, srcFilter=0x0, dstFilter=0x0, param=0x0)
    at libavcodec/imgresample.c:539
539             ctx->resampling_ctx->iheight = srcH;
(gdb) bt
#0  sws_getContext (srcW=16, srcH=16, srcFormat=0, dstW=16, dstH=16,
    dstFormat=0, flags=4, srcFilter=0x0, dstFilter=0x0, param=0x0)
    at libavcodec/imgresample.c:539
#1  0x00009369 in main (argc=) at ffmpeg.c:3914
(gdb) disas $pc-32 $pc+32
Dump of assembler code from 0x9a1f6 to 0x9a236:
0x0009a1f6 <sws_getContext+138>:        call   0x3cd578 <av_log>
0x0009a1fb <sws_getContext+143>:        add    $0x10,%esp
0x0009a1fe <sws_getContext+146>:        jmp    0x9a1ad <sws_getContext+65>
0x0009a200 <sws_getContext+148>:        cmp    0x2c(%esp),%ebp
0x0009a204 <sws_getContext+152>:        jne    0x9a19d <sws_getContext+49>
0x0009a206 <sws_getContext+154>:        sub    $0xc,%esp
0x0009a209 <sws_getContext+157>:        push   $0x148
0x0009a20e <sws_getContext+162>:        call   0x3cd3cc <av_malloc>
0x0009a213 <sws_getContext+167>:        mov    %eax,0x4(%ebx)
0x0009a216 <sws_getContext+170>:        mov    %esi,0x4(%eax)
0x0009a219 <sws_getContext+173>:        mov    %ebp,(%eax)
0x0009a21b <sws_getContext+175>:        mov    %esi,0xc(%eax)
0x0009a21e <sws_getContext+178>:        mov    %ebp,0x8(%eax)
0x0009a221 <sws_getContext+181>:        add    $0x10,%esp
0x0009a224 <sws_getContext+184>:        jmp    0x9a1d2 <sws_getContext+102>
0x0009a226 <sws_getContext+186>:        push   %eax
0x0009a227 <sws_getContext+187>:        push   $0x9a0fc
0x0009a22c <sws_getContext+192>:        push   $0x0
0x0009a22e <sws_getContext+194>:        push   $0x0
0x0009a230 <sws_getContext+196>:        call   0x3cd578 <av_log>
0x0009a235 <sws_getContext+201>:        xor    %edi,%edi
End of assembler dump.
(gdb) info all-registers
eax            0x0      0
ecx            0x10     16
edx            0x288    648
ebx            0x58e050 5824592
esp            0x58cc50 0x58cc50
ebp            0x10     0x10
esi            0x10     16
edi            0x58e050 5824592
eip            0x9a216  0x9a216 <sws_getContext+170>
eflags         0x13002  77826
cs             0x12f    303
ss             0x137    311
ds             0x137    311
es             0x137    311
fs             0x127    295
gs             0x147    327

Michael




More information about the ffmpeg-devel mailing list