[FFmpeg-devel] Multithreaded svq3 decoding gives segfault

Thorsten Jordan tjordan
Wed Apr 23 15:06:02 CEST 2008


Hello,

when using 2 or more threads with avcodec_thread_init() and SVQ3 video
it gives a segfault, may be a known problem, but here is a stack trace:


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xa3f4eb90 (LWP 5482)]
0xa7c8238a in frame_start (h=0x817f790) at libavcodec/h264.c:2252
2252            if(!h->thread_context[i]->s.obmc_scratchpad)
Current language:  auto; currently c
(gdb) bt
#0  0xa7c8238a in frame_start (h=0x817f790) at libavcodec/h264.c:2252
#1  0xa7ca63a8 in svq3_decode_frame (avctx=0x8054e80, data=0x8061820,
data_size=0xa3f4e254,
    buf=0xa3fe1008 "<REMOVEDTEXT>"..., buf_size=5162) at
libavcodec/svq3.c:882
#2  0xa7ac679f in avcodec_decode_video (avctx=0x8054e80,
picture=0xa3fe1008, got_picture_ptr=0xa3f4e254, buf=0x5 <Address 0x5 out
of bounds>,
    buf_size=5162) at libavcodec/utils.c:945

(application related from here on)

#3  0xa782bb69 in mpeg_decoder_avcodec::stream_in (this=0x8061618,
    data=0xa3fe1008 "<REMOVEDTEXT>"..., length=5162, pts=0) at
src/mpeg_decoder_avcodec.cpp:457
#4  0xa797bc7b in DEC_MPGV::stream_data_to_decoder (this=0x80aded8) at
src/decmpgv.cc:683
#5  0xa797c8b0 in DEC_MPGV::loop (this=0x80aded8) at src/decmpgv.cc:593
#6  0xa7568d69 in os_thread::run (this=0x80aded8) at src/os_thread.cpp:338
#7  0xa756e48d in os_thread::thread_entry (arg=0x80aded8) at
inc/os_thread.h:244
#8  0xa71244fb in start_thread () from /lib/i686/cmov/libpthread.so.0
#9  0xa765bd7e in clone () from /lib/i686/cmov/libc.so.6

(some infos)

(gdb) print h
$1 = (H264Context *) 0x817f790
(gdb) print h->thread_context[i]
$2 = (struct H264Context *) 0x0
(gdb) print i
$3 = 1


It is obviously that H264Context.thread_context[1] is unexpectedly NULL
here. It seems that the multithreaded h264 decoding just ignored the
fact that svq3 decoding is done with the same code.

-- 
Regards, Thorsten




More information about the ffmpeg-devel mailing list