[MPlayer-users] lavf Seg Fault

Pedro A. Aranda paaguti at hotmail.com
Fri May 9 08:56:36 CEST 2008


Larry Reznick <lreznick <at> idistream.com> writes:

> 
> 
> Thanks, Corey. That patch is definitely the problem. Commenting that 
> code section out is sufficient to get the muxing working again.
> 
> It seems to me that this patch should be backed out until someone can 
> prove the correct way to setup data structures before the url_seek() 
> call. As the patch indicates, the prior code didn't have this segment. 
> There must be some reason why opening requires a rewind, which is what 
> this seek appears to try to do.
> 
> --Larry
> 

I agree that the patch has something to do, but when I try to transcode to mp4
with the command

mencoder -oac faac -faacopts br=128:mpeg=4:object=2:raw -ovc x264 -x264encopts \
bitrate=1000:vbv_maxrate=1500:vbv_bufsize=2000:nocabac:level_idc=13:\
global_header:interlaced -of lavf -lavfopts format=mp4 ../ladeux.m2p \
-o ladeux.mp4

after commenting out the code in avio.c it continues to segfault. After some
debugging (without reverting that patch), I get lost. Anyhow here is a log
of my work with gdb (compiling with --enable-debug). I hope it helps to
debug this. Unfortunately, I'm too busy to chase this bug down myself :(

Cheers,/PA

Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) set args -oac faac -faacopts br=128:mpeg=4:object=2:raw -ovc x264
-x264encopts
bitrate=1000:vbv_maxrate=1500:vbv_bufsize=2000:nocabac:level_idc=13:\
global_header:interlaced
 -of lavf -lavfopts format=mp4 ../ladeux.m2p -o ../ladeux.mp4
(gdb) br url_fopen
Breakpoint 1 at 0x8262517: file aviobuf.c, line 590.
(gdb) run
Starting program: /home/paag/Personal/Devel/mplayer/mencoder -oac faac -faacopts
br=128:mpeg=4:object=2:raw -ovc x264 -x264encopts
bitrate=1000:vbv_maxrate=1500:vbv_bufsize=2000:nocabac:level_idc=13:\
global_header:interlaced
 -of lavf -lavfopts format=mp4 ../ladeux.m2p -o ../ladeux.mp4
[Thread debugging using libthread_db enabled]
MEncoder dev-SVN-r26689-4.2.3 (C) 2000-2008 MPlayer Team
CPU: Intel(R) Core(TM)2 CPU         T7200  @ 2.00GHz (Family: 6, Model: 15,
Stepping: 6)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

success: format: 0  data: 0x0 - 0xe50687
MPEG-PS file format detected.
VIDEO:  MPEG2  720x576  (aspect 2)  25.000 fps  15000.0 kbps (1875.0 kbyte/s)
[V] filefmt:2  fourcc:0x10000002  size:720x576  fps:25.000  ftime:=0.0400
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
** MUXER_LAVF *****************************************************************
REMEMBER: MEncoder's libavformat muxing is presently broken and can generate
INCORRECT files in the presence of B frames. Moreover, due to bugs MPlayer
will play these INCORRECT files as if nothing were wrong!
*******************************************************************************
[New Thread 0xb7bf26b0 (LWP 5324)]
[Switching to Thread 0xb7bf26b0 (LWP 5324)]

Breakpoint 1, url_fopen (s=0x88fbc20, 
    filename=0xbf81f898 "menc://stream.dummy", flags=1) at aviobuf.c:590
590	    err = url_open(&h, filename, flags);
(gdb) print h
$1 = (URLContext *) 0x88ccfc0
(gdb) s
url_open (puc=0xbf81f860, filename=0xbf81f898 "menc://stream.dummy", flags=1)
    at avio.c:62
62	{
(gdb) s
71	    while (*p != '\0' && *p != ':') {
(gdb) s
62	{
(gdb) s
s
s73	        if (!isalpha(*p))
(gdb) s
75	        if ((q - proto_str) < sizeof(proto_str) - 1)
(gdb) s
76	            *q++ = *p;
(gdb) s
71	    while (*p != '\0' && *p != ':') {
(gdb) s
73	        if (!isalpha(*p))
(gdb) s
75	        if ((q - proto_str) < sizeof(proto_str) - 1)
(gdb) s
76	            *q++ = *p;
(gdb) s
71	    while (*p != '\0' && *p != ':') {
(gdb) s
73	        if (!isalpha(*p))
(gdb) s
75	        if ((q - proto_str) < sizeof(proto_str) - 1)
(gdb) s
76	            *q++ = *p;
(gdb) s
71	    while (*p != '\0' && *p != ':') {
(gdb) s
73	        if (!isalpha(*p))
(gdb) s
75	        if ((q - proto_str) < sizeof(proto_str) - 1)
(gdb) s
76	            *q++ = *p;
(gdb) s
71	    while (*p != '\0' && *p != ':') {
(gdb) s
80	    if (*p == '\0' || (q - proto_str) <= 1) {
(gdb) s
84	        *q = '\0';
(gdb) s
87	    up = first_protocol;
(gdb) s
88	    while (up != NULL) {
(gdb) s
89	        if (!strcmp(proto_str, up->name))
(gdb) s
96	    uc = av_malloc(sizeof(URLContext) + strlen(filename) + 1);
(gdb) s
97	    if (!uc) {
(gdb) s
96	    uc = av_malloc(sizeof(URLContext) + strlen(filename) + 1);
(gdb) s
av_malloc (size=44) at mem.c:43
43	{
(gdb) s
50	    if(size > (INT_MAX-16) )
(gdb) s
61	    ptr = memalign(16,size);
(gdb) s
92	}
(gdb) s
url_open (puc=0xbf81f860, filename=0xbf81f898 "menc://stream.dummy", flags=1)
    at avio.c:97
97	    if (!uc) {
(gdb) s
96	    uc = av_malloc(sizeof(URLContext) + strlen(filename) + 1);
(gdb) s
97	    if (!uc) {
(gdb) s
104	    uc->filename = (char *) &uc[1];
(gdb) s
105	    strcpy(uc->filename, filename);
(gdb) s
104	    uc->filename = (char *) &uc[1];
(gdb) s
105	    strcpy(uc->filename, filename);
(gdb) s
106	    uc->prot = up;
(gdb) s
107	    uc->flags = flags;
(gdb) s
106	    uc->prot = up;
(gdb) s
107	    uc->flags = flags;
(gdb) s
108	    uc->is_streamed = 0; /* default = not streamed */
(gdb) s
109	    uc->max_packet_size = 0; /* default: stream file */
(gdb) s
110	    err = up->url_open(uc, filename, flags);
(gdb) s
mp_open (h=0x88cd5d0, filename=0xbf81f898 "menc://stream.dummy", flags=1)
    at libmpdemux/muxer_lavf.c:67
67	}
(gdb) s
url_open (puc=0xbf81f860, filename=0xbf81f898 "menc://stream.dummy", flags=1)
    at avio.c:111
111	    if (err < 0) {
(gdb) s
110	    err = up->url_open(uc, filename, flags);
(gdb) s
111	    if (err < 0) {
(gdb) s
118	    if(   (flags & (URL_WRONLY | URL_RDWR))
(gdb) s
120	        if(!uc->is_streamed && url_seek(uc, 0, SEEK_SET) < 0)
(gdb) s
url_seek (h=0x88cd5d0, pos=0, whence=0) at avio.c:151
151	{
(gdb) s
154	    if (!h->prot->url_seek)
(gdb) s
158	}
(gdb) s
url_seek (h=0xbf81f860, pos=7507933336, whence=136689975) at avio.c:156
156	    ret = h->prot->url_seek(h, pos, whence);
(gdb) s
mp_seek (h=0x88cd5d0, pos=0, whence=0) at libmpdemux/muxer_lavf.c:88
88	{
(gdb) s
89		muxer_t *muxer = (muxer_t*)h->priv_data;
(gdb) s
88	{
(gdb) s
90		if(whence == SEEK_CUR)
(gdb) s
88	{
(gdb) s
89		muxer_t *muxer = (muxer_t*)h->priv_data;
(gdb) s
90		if(whence == SEEK_CUR)
(gdb) s
97		else if(whence == SEEK_END)
(gdb) s
104		mp_msg(MSGT_MUXER, MSGL_DBG2, "SEEK %"PRIu64"\n", (int64_t)pos);
(gdb) s
mp_msg (mod=39, lev=7, format=0x85f9a3b "SEEK %llu\n") at mp_msg.c:172
172	    FILE *stream = lev <= MSGL_WARN ? stderr : stdout;
(gdb) s
169	void mp_msg(int mod, int lev, const char *format, ... ){
(gdb) s
172	    FILE *stream = lev <= MSGL_WARN ? stderr : stdout;
(gdb) s
175	    if (!mp_msg_test(mod, lev)) return; // do not display
(gdb) s
169	void mp_msg(int mod, int lev, const char *format, ... ){
(gdb) s
172	    FILE *stream = lev <= MSGL_WARN ? stderr : stdout;
(gdb) s
175	    if (!mp_msg_test(mod, lev)) return; // do not display
(gdb) s
mp_msg_test (mod=39, lev=7) at mp_msg.c:85
85	    return lev <= (mp_msg_levels[mod] == -2 ? mp_msg_level_all + \
verbose :
mp_msg_levels[mod]);
(gdb) s
86	}
(gdb) s
mp_msg_test (mod=39, lev=7) at mp_msg.c:85
85	    return lev <= (mp_msg_levels[mod] == -2 ? mp_msg_level_all + verbose :
mp_msg_levels[mod]);
(gdb) s
86	}
(gdb) s
mp_msg (mod=39, lev=7, format=0x85f9a3b "SEEK %llu\n") at mp_msg.c:225
225	}
(gdb) s
mp_seek (h=0x88cd5d0, pos=0, whence=0) at libmpdemux/muxer_lavf.c:105
105		if(!stream_seek(muxer->stream, pos))
(gdb) s

Program received signal SIGSEGV, Segmentation fault.
mp_seek (h=0x88cd5d0, pos=0, whence=0) at libmpdemux/muxer_lavf.c:105
105		if(!stream_seek(muxer->stream, pos))
(gdb) s

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) bt

#0  mp_seek (h=0x88cd5d0, pos=0, whence=0) at libmpdemux/muxer_lavf.c:105
#1  0x08260ed7 in url_open (puc=0xbfa94ae0, 
    filename=0xbfa94b18 "menc://stream.dummy", flags=<value optimized out>)
    at avio.c:120
#2  0x08262530 in url_fopen (s=0x88fbc20, 
    filename=0xbfa94b18 "menc://stream.dummy", flags=1) at aviobuf.c:590
#3  0x08090b1a in muxer_init_muxer_lavf (muxer=0x88ccee0)
    at libmpdemux/muxer_lavf.c:391
#4  0x080859bc in muxer_new_muxer (type=3, stream=0x88cc548)
    at libmpdemux/muxer.c:39
#5  0x0807eff3 in main (argc=1668179309, argv=0xbfa94f24) at mencoder.c:760






More information about the MPlayer-users mailing list