[MPlayer-users] Bug report: mencoder config file segfault

Gerald Grabner gerald.grabner at tugraz.at
Mon Jun 30 14:48:23 CEST 2003


 > Hi, could you please read bugreports.html and follow the rules
 > there. At least compile mplayer/mencoder with debugging symbols and
 > include the commandline you used and the WHOLE -v output of
 > mencoder. Otherwise it isnt of much use.

Hi, the -v output of mencoder isn't very helpful in this case.
Regardless of how calling mencoder, it ends with:

   Reading config file /home/gerry/.mplayer/mencoder
   Segmentation fault

I was under the misconception that this would be some easy-to-find
malloc kind of bug, and as it was reproducable with all versions (cvs
and 0.90) and Linux distributions (redhat and SuSE) I tried, I didn't
bother to go into more detail. Sorry for that. Below is the full
backtrace.


Finally I found the time to try debugging this problem, and I figured
out some workaround. Replacing line 78 of m_option.c

    if (src == M_CONFIG_FILE ) {

with

    if (src == M_CONFIG_FILE && param != NULL ) {

seems to do the trick. However, I guess this is only a symptomatic
approach. I'm not deep into mplayer, so I'm not sure how the treatment
of options with childs is supposed to work. Anyway, the arguments for
(recursively) calling m_config_parse_option in m_config.c:268 seem
strange to me. In case of "ovc copy", the second argument is
constructed as "ovc:copy", the third argument is 0. The latter is
(after the recursive call) passed to m_config::parse_flag and causes
the segmentation fault. It also seems surprising that the parse_flag
function is called for an ovc argument. Maybe there is some meaning
that I don't understand. As I don't want to mess up the code, I let
the developers decide what to do...

Regards,
Gerald

--

(gdb) bt
#0  0x4207c209 in strcasecmp () from /lib/tls/libc.so.6
#1  0x0807716e in parse_flag (opt=0x8171c1f, name=0x405c9b04 "",
     param=0x42131a14 " \031\023BpR,@`Â", dst=0x8224be0, src=0) at 
m_option.c:78
#2  0x08076c71 in m_config_parse_option (config=0x8224920,
     arg=0x42131a14 " \031\023BpR,@`Â", param=0x0, set=1) at m_option.h:216
#3  0x08076b7b in m_config_parse_option (config=0x8224920,
     arg=0xbfffbbf4 "ovc:copy", param=0xbfffbc90 "copy", set=1)
     at m_config.c:268
#4  0x08076cfd in m_config_set_option (config=0x405c9b04,
     arg=0xbfffc080 "ovc", param=0xbfffbc90 "copy") at m_config.c:303
#5  0x0807a701 in m_config_parse_config_file (config=0x8224920,
     conffile=0x822d1d0 "/home/gerry/.mplayer/mencoder") at parser-cfg.c:190
#6  0x08060a82 in parse_cfgfiles (conf=0x405c9b04) at mencoder.c:265
#7  0x08060dda in main (argc=1079810820, argv=0x405c9b04) at mencoder.c:401
#8  0x420156a4 in __libc_start_main () from /lib/tls/libc.so.6
(gdb) disass $pc-32 $pc+32
Dump of assembler code from 0x4207c1e9 to 0x4207c229:
0x4207c1e9 <strcasecmp+25>:     Cannot access memory at address 0x4207c1e9
(gdb) info all-registers
eax            0x405c9b04       1079810820
ecx            0x0      0
edx            0x403c7814       1077704724
ebx            0x42131a14       1108548116
esp            0xbfffc5d8       0xbfffc5d8
ebp            0xbfffc5e8       0xbfffc5e8
esi            0x8224be0        136465376
edi            0x8171c1f        135732255
eip            0x4207c209       0x4207c209
eflags         0x210202 2163202
cs             0x23     35
ss             0x2b     43
ds             0x2b     43
es             0x2b     43
fs             0x0      0
gs             0x33     51
st0            0        (raw 0x00000000000000000000)
st1            0        (raw 0x00000000000000000000)
st2            0        (raw 0x00000000000000000000)
st3            0        (raw 0x00000000000000000000)
st4            0        (raw 0x00000000000000000000)
st5            0        (raw 0x00000000000000000000)
st6            0        (raw 0x00000000000000000000)
st7            0        (raw 0x00000000000000000000)
fctrl          0x37f    895
fstat          0x0      0
ftag           0xffff   65535
fiseg          0x23     35
fioff          0x8060c1a        134614042
foseg          0x2b     43
fooff          0xbfffcfa8       -1073754200
fop            0x0      0
xmm0           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {
     0x8000000000000000, 0x8000000000000000}, v16_int8 = {
     0xff <repeats 16 times>}, v8_int16 = {0xffff, 0xffff, 0xffff, 0xffff,
     0xffff, 0xffff, 0xffff, 0xffff}, v4_int32 = {0xffffffff, 0xffffffff,
     0xffffffff, 0xffffffff}, v2_int64 = {0xffffffffffffffff,
     0xffffffffffffffff}, uint128 = 0xffffffffffffffffffffffffffffffff}
xmm1           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {
     0x8000000000000000, 0x8000000000000000}, v16_int8 = {
     0xff <repeats 16 times>}, v8_int16 = {0xffff, 0xffff, 0xffff, 0xffff,
     0xffff, 0xffff, 0xffff, 0xffff}, v4_int32 = {0xffffffff, 0xffffffff,
     0xffffffff, 0xffffffff}, v2_int64 = {0xffffffffffffffff,
     0xffffffffffffffff}, uint128 = 0xffffffffffffffffffffffffffffffff}
xmm2           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {
     0x8000000000000000, 0x8000000000000000}, v16_int8 = {
     0xff <repeats 16 times>}, v8_int16 = {0xffff, 0xffff, 0xffff, 0xffff,
     0xffff, 0xffff, 0xffff, 0xffff}, v4_int32 = {0xffffffff, 0xffffffff,
     0xffffffff, 0xffffffff}, v2_int64 = {0xffffffffffffffff,
     0xffffffffffffffff}, uint128 = 0xffffffffffffffffffffffffffffffff}
xmm3           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {
     0x8000000000000000, 0x8000000000000000}, v16_int8 = {
     0xff <repeats 16 times>}, v8_int16 = {0xffff, 0xffff, 0xffff, 0xffff,
     0xffff, 0xffff, 0xffff, 0xffff}, v4_int32 = {0xffffffff, 0xffffffff,
     0xffffffff, 0xffffffff}, v2_int64 = {0xffffffffffffffff,
     0xffffffffffffffff}, uint128 = 0xffffffffffffffffffffffffffffffff}
xmm4           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {
     0x8000000000000000, 0x8000000000000000}, v16_int8 = {
     0xff <repeats 16 times>}, v8_int16 = {0xffff, 0xffff, 0xffff, 0xffff,
     0xffff, 0xffff, 0xffff, 0xffff}, v4_int32 = {0xffffffff, 0xffffffff,
     0xffffffff, 0xffffffff}, v2_int64 = {0xffffffffffffffff,
     0xffffffffffffffff}, uint128 = 0xffffffffffffffffffffffffffffffff}
xmm5           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {
     0x8000000000000000, 0x8000000000000000}, v16_int8 = {
     0xff <repeats 16 times>}, v8_int16 = {0xffff, 0xffff, 0xffff, 0xffff,
     0xffff, 0xffff, 0xffff, 0xffff}, v4_int32 = {0xffffffff, 0xffffffff,
     0xffffffff, 0xffffffff}, v2_int64 = {0xffffffffffffffff,
     0xffffffffffffffff}, uint128 = 0xffffffffffffffffffffffffffffffff}
xmm6           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {
     0x8000000000000000, 0x8000000000000000}, v16_int8 = {
     0xff <repeats 16 times>}, v8_int16 = {0xffff, 0xffff, 0xffff, 0xffff,
     0xffff, 0xffff, 0xffff, 0xffff}, v4_int32 = {0xffffffff, 0xffffffff,
     0xffffffff, 0xffffffff}, v2_int64 = {0xffffffffffffffff,
     0xffffffffffffffff}, uint128 = 0xffffffffffffffffffffffffffffffff}
xmm7           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {
     0x8000000000000000, 0x8000000000000000}, v16_int8 = {
     0xff <repeats 16 times>}, v8_int16 = {0xffff, 0xffff, 0xffff, 0xffff,
     0xffff, 0xffff, 0xffff, 0xffff}, v4_int32 = {0xffffffff, 0xffffffff,
     0xffffffff, 0xffffffff}, v2_int64 = {0xffffffffffffffff,
     0xffffffffffffffff}, uint128 = 0xffffffffffffffffffffffffffffffff}
mxcsr          0x1f80   8064
mm0            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
     0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm1            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
     0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm2            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
     0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm3            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
     0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm4            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
     0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm5            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
     0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm6            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
     0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm7            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
     0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}



More information about the MPlayer-users mailing list