Skip to content

Instantly share code, notes, and snippets.

@rdp
Created November 10, 2011 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdp/1356451 to your computer and use it in GitHub Desktop.
Save rdp/1356451 to your computer and use it in GitHub Desktop.
mplayer with mingw crash
#include <stdio.h>
#include <inttypes.h>
#include <stdarg.h>
#define MSGSIZE_MAX 3072
typedef long _off_t;
typedef _off_t off_t;
void go(const char *format, va_list va) {
char tmp[MSGSIZE_MAX];
vsnprintf(tmp, 3071, format, va);
printf(tmp);
}
void mp_msg(const char *format, ... ){
va_list va;
va_start(va, format);
go(format, va);
va_end(va);
}
int main() {
off_t newpos= -100;
mp_msg("dvdnav_stream, seeking to %"PRIu64" failed: %s\n", newpos, "a test string");
}
/*
Program received signal SIGSEGV, Segmentation fault.
0x00955470 in __pformat_puts (stream=0x28d32c, s=0x100 <Address 0x100 out of bounds>) at ../../mingw/mingwex/stdio/pformat.c:1732
1732 ../../mingw/mingwex/stdio/pformat.c: No such file or directory.
in ../../mingw/mingwex/stdio/pformat.c
(gdb) bt
#0 0x00955470 in __pformat_puts (stream=0x28d32c, s=0x100 <Address 0x100 out of bounds>) at ../../mingw/mingwex/stdio/pformat.c:1732
#1 __mingw_pformat (flags=0, dest=0x28d3f0, max=3071, fmt=0xab43aa "\n", argv=0x28ec58 "_A¿A¿A¿\004")
at ../../mingw/mingwex/stdio/pformat.c:1869
#2 0x009525ce in __mingw_vsnprintf (buf=0x28d3f0 "dvdnav_stream, seeking to 339020772304318464 failed: ", length=3071,
fmt=0xab4380 "dvdnav_stream, seeking to %I64u failed: %s\n", argv=0x28ec4c "") at ../../mingw/mingwex/stdio/vsnprintf.c:49
#3 0x0044823e in mp_msg_va (mod=20, lev=4, format=0xab4380 "dvdnav_stream, seeking to %I64u failed: %s\n", va=0x28ec4c "") at mp_msg.c:195
#4 0x004486a7 in mp_msg (mod=20, lev=4, format=0xab4380 "dvdnav_stream, seeking to %I64u failed: %s\n") at mp_msg.c:182
#5 0x00501aca in seek (s=0x4b446c0, newpos=-1599246336) at stream/stream_dvdnav.c:303
#6 0x004ec166 in stream_seek_internal (s=0x4b446c0, newpos=0) at stream/stream.c:404
#7 0x004ec481 in stream_seek_long (s=0x4b446c0, pos=0) at stream/stream.c:441
#8 0x004c156c in stream_seek (pos=0, s=<optimized out>) at ./stream/stream.h:313
#9 demux_mpg_probe (demuxer=0x4b5b800) at libmpdemux/demux_mpg.c:737
#10 0x0049d91f in demux_open_stream (stream=0x4b446c0, file_format=2, force=0, audio_id=-1, video_id=-1, dvdsub_id=-1,
filename=0x4b32be8 "dvdnav://1") at libmpdemux/demuxer.c:1027
#11 0x0049e3bd in demux_open (vs=0x4b446c0, file_format=2, audio_id=-1, video_id=-1, dvdsub_id=-1, filename=0x4b32be8 "dvdnav://1")
at libmpdemux/demuxer.c:1242
#12 0x0095c919 in main (argc=2, argv=0x34934e8) at mplayer.c:3298
*/
@rdp
Copy link
Author

rdp commented Nov 10, 2011

I think this meant "you are trying to pass a long for a type %"PRIu64" which causes very weird things/crashes to happen" (which happened to me with mplayer, and vanilla GCC 4.6.1 mingw)

@rdp
Copy link
Author

rdp commented Nov 10, 2011

MPlayer interrupted by signal 11 in module: demux_open with dvdnav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment