[MPlayer-users] segfault in mencoder

Justin Moore justin at cs.duke.edu
Tue Mar 4 07:53:09 CET 2003


   I'm trying to encode a wav file to mp3 using mencoder; I had ripped
the audio track using 'mplayer -ao pcm -aofile sound.wav -vo null
video.avi'.  I keep getting a segfault after mencoder parses the sound
header.  The error is that in

int video_read_properties(sh_video_t *sh_video){

libmpdemux/video.c (line 38), the sh_video variable is NULL.  mencoder
is not happy when it tries to dereference this pointer. :)

The command line and output:

opus:~/media/vid$ mencoder -v -v -v -ss 0:00 -endpos 3:13 -o
Helter_Skelter.mp3 -oac mp3lame -lameopts cbr:br=192:aq=1:mode=3
sound.wav

Using GNU internationalization
Original domain: messages
Original dirname: /usr/share/locale
Current domain: mplayer
Current dirname: /usr/local/share/locale


MEncoder dev-CVS-030303-23:14-3.2.1 (C) 2000-2003 Arpad Gereoffy (see
DOCS)

CPU: Advanced Micro Devices Athlon 4 PM Palomino/Athlon MP
Multiprocessor/Athlon XP eXtreme Performance (Family: 6, Stepping: 2)
Detected cache-line size is 64 bytes
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Reading /home/justin/.mplayer/codecs.conf: can't open
'/home/justin/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: 50 audio & 135 video codecs
File not found: 'frameno.avi'
Reading config file /home/justin/.mplayer/mencoder: No such file or
directory
init_freetype
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
Not an URL!
File size is 719519788 bytes
success: format: 0  data: 0x0 - 0x2AE3002C
seek to 0x0
s->pos=0  newpos=0  new_bufpos=0  buflen=0  
DEMUXER: freeing demuxer at 0x836e438  
seek to 0x0
Checking for YUV4MPEG2
Failed: YUV4MPEG2
DEMUXER: freeing demuxer at 0x836edd8  
seek to 0x0
ASF_check: not ASF guid!
DEMUXER: freeing demuxer at 0x836edd8  
seek to 0x0
Checking for NuppelVideo
DEMUXER: freeing demuxer at 0x836edd8  
seek to 0x0
Checking for REAL
DEMUXER: freeing demuxer at 0x836edd8  
seek to 0x0
Checking for SMJPEG
DEMUXER: freeing demuxer at 0x836edd8  
Searching demuxer type for filename sound.wav ext: .wav
Trying demuxer 17 based on filename extension
seek to 0x0
==> Found audio stream: 0
======= WAVE Format =======
Format Tag: 1 (0x1)
Channels: 2
Samplerate: 48000
avg byte/sec: 192000
Block align: 4
bits/sample: 16
cbSize: 0
demux_audio: audio data 0x2C - 0x0  
Audio file detected.
Segmentation fault

And some gdb goodness:

(gdb) set args -ss 0:00 -endpos 3:13 -o Helter_Skelter.mp3 -oac mp3lame
-lameopts cbr:br=192:aq=1:mode=3 sound.wav
(gdb) run
Starting program: /usr/local/bin/mencoder -ss 0:00 -endpos 3:13 -o
Helter_Skelter.mp3 -oac mp3lame -lameopts cbr:br=192:aq=1:mode=3
sound.wav
[New Thread 1077297824 (LWP 5105)]
Using GNU internationalization
Original domain: messages
Original dirname: /usr/share/locale
Current domain: mplayer
Current dirname: /usr/local/share/locale
 
 
MEncoder dev-CVS-030303-23:14-3.2.1 (C) 2000-2003 Arpad Gereoffy (see
DOCS)
 
CPU: Advanced Micro Devices Athlon 4 PM Palomino/Athlon MP
Multiprocessor/Athlon XP eXtreme Performance (Family: 6, Stepping: 2)
Detected cache-line size is 64 bytes
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Reading /home/justin/.mplayer/codecs.conf: can't open
'/home/justin/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: 50 audio & 135 video codecs
File not found: 'frameno.avi'
Reading config file /home/justin/.mplayer/mencoder: No such file or
directory
success: format: 0  data: 0x0 - 0x2AE3002C
Audio file detected.
 
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1077297824 (LWP 5105)]
0x080fc7cc in video_read_properties (sh_video=0x0) at video.c:38
38      if(!sh_video)
(gdb) where
#0  0x080fc7cc in video_read_properties (sh_video=0x0) at video.c:38
#1  0x080630a3 in main (argc=0, argv=0x0) at mencoder.c:506
#2  0x420154a0 in __libc_start_main () from /lib/tls/libc.so.6
(gdb) info local
d_video = (struct {...} *) 0x821dfb8
(gdb) print *d_video
$2 = {buffer_pos = 1407551829, buffer_size = -1516718000, buffer =
0x982d0826 <Address 0x982d0826 out of bounds>, pts = -8.5094347,
  pts_bytes = -1065024776, eof = 1979668621, pos = 15456702474062603,
dpos = -7449775119015542784, pack_no = -1995954523,
  flags = -763016230, packs = -437521803, bytes = 1407551829, first =
0xd938a152, last = 0xf883082a, current = 0xd938bbff, id = 208930858,
  demuxer = 0xff04eb83, asf_packet = 0x83038bd0, asf_seq = -193593352,
ss_mul = 3284753240, ss_div = 1407551829, sh = 0xe852}
(gdb) up
#1  0x080630a3 in main (argc=0, argv=0x0) at mencoder.c:506
506       if(!video_read_properties(sh_video)){
(gdb) info local
stream = (struct stream_st *) 0x836dab0
demuxer = (struct demuxer_st *) 0x836f778
stream2 = (struct stream_st *) 0x0
demuxer2 = (struct demuxer_st *) 0x0
d_audio = (struct {...} *) 0x836ffe0
d_video = (struct {...} *) 0x8370048
d_dvdsub = (struct {...} *) 0x83700b0
sh_audio = (struct {...} *) 0x8370118
sh_video = (struct {...} *) 0x0
file_format = 0
i = 0
vobsub_writer = (void *) 0x0
ptimer_start = 0
audiorate = 0
videorate = 0
audiosamples = 1
videosamples = 1
skippedframes = 0
duplicatedframes = 0
badframes = 0
mux_a = (struct {...} *) 0x0
mux_v = (struct {...} *) 0x821dfb8
muxer_f_size = -4611717904126943960
---Type <return> to continue, or q <return> to quit---
lame = (struct lame_global_struct *) 0x1b
v_pts_corr = 0
v_timer_corr = 0
filelist = (struct m_entry_st *) 0x8345d28
filename = 0x8345d28 "sound.wav"
decoded_frameno = 0
next_frameno = -1
timer_start = 3221219464
(gdb)

-jdm

-- 
Justin Moore <justin at cs.duke.edu>
Duke University Department of Computer Science



More information about the MPlayer-users mailing list