Opened 16 years ago
Last modified 14 years ago
#1467 closed defect (wontfix)
Unable to play Matroska files (mkv, mka)
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | important | Component: | demuxer |
Version: | HEAD | Severity: | critical |
Keywords: | Cc: | reimar, compn, rjquesada@…, arkanoid@… | |
Blocked By: | Blocking: | ||
Reproduced by developer: | no | Analyzed by developer: | no |
Description
After upgrading to GCC 4.4.0 in ArchLinux, and building my weekly MPlayer SVN update, I noticed two things, first that liba52-internal is broken (allegedly fixed somewhere else, but still broken).
And, the most important, is that I'm unable to play any Matroska file. MPlayer ends with "MPlayer interrupted by signal 11 in module: init_audio_codec".
I have tried many older releases and the problem persists.
Attachments (3)
Change History (15)
comment:1 by , 16 years ago
by , 16 years ago
Attachment: | mpeg12.c_quick_fix.diff added |
---|
Moving functions to get it to compile under GCC 4.4.0
comment:3 by , 16 years ago
I hate this kind of bugs because it works when debugging is enabled.
However, to get HEAD to compile I moved a function in libavcodec/mpeg12.c, the diff patch is attached. It is an unrelated quick and dirty fix to this bug, sorry for that. Probably another GCC 4.4.0 annoyance.
by , 15 years ago
Attachment: | demux_mkv.c_gcc-4.4.patch added |
---|
Patch for libmpdemux/demux_mkv.c to get it to work with gcc 4.4
comment:4 by , 15 years ago
I had a free afternoon today,
This small patch allows mplayer to play mkv files when compiled with gcc 4.4, funny thing is that adding a simple printf there in the same place would fix the problem, but it seems that gcc 4.4 is sensitive to a proper malloc before being freed as in the switch/case in the while loop of the same function.
The patch works, but I don't know if it will have any other future implications.
comment:5 by , 15 years ago
Forget about this... Tested in two other computers (x86_64 and other x86) and they keep segfaulting. Is mkv on gcc 4.4 doomed?
(In reply to comment #4)
Created an attachment (id=566) [details]
Patch for libmpdemux/demux_mkv.c to get it to work with gcc 4.4
I had a free afternoon today,
This small patch allows mplayer to play mkv files when compiled with gcc 4.4,
funny thing is that adding a simple printf there in the same place would fix
the problem, but it seems that gcc 4.4 is sensitive to a proper malloc before
being freed as in the switch/case in the while loop of the same function.
The patch works, but I don't know if it will have any other future
implications.
comment:6 by , 15 years ago
Cc: | added |
---|
OK, new development... In libmpdemux/demux_mkv.c the function grow_array is there to increase in one element the size of an array, however, it is coded in a way that increases the array in 32 elements when we are at the 31st element at intervals of 32 elements. This is it:
static void grow_array(void array, int nelem, size_t elsize) {
if (!(nelem & 31))
*array = realloc(*array, (nelem + 32) * elsize);
}
Leaving it in that way will segfault, but if I change it to increment in only one element, then it will play the mkv files with no problems!
static void grow_array(void array, int nelem, size_t elsize) {
*array = realloc(*array, (nelem + 1) * elsize);
}
Also, it is used two times, but at both times there is a compiler warning that it needs to be casted to void, I tried in both ways (casting and no) and both are working.
I tested it in three different computers all with different kernels, but the same distro (ArchLinux), one is 64 bits, the other two are 32, all of them uses gcc 4.4.0 20090630.
Hope this helps, more and more people are having this gcc4.4+mkv problem.
(In reply to comment #5)
Forget about this... Tested in two other computers (x86_64 and other x86) and
they keep segfaulting. Is mkv on gcc 4.4 doomed?
(In reply to comment #4)
Created an attachment (id=566) [details] [details]
Patch for libmpdemux/demux_mkv.c to get it to work with gcc 4.4
I had a free afternoon today,
This small patch allows mplayer to play mkv files when compiled with gcc 4.4,
funny thing is that adding a simple printf there in the same place would fix
the problem, but it seems that gcc 4.4 is sensitive to a proper malloc before
being freed as in the switch/case in the while loop of the same function.
The patch works, but I don't know if it will have any other future
implications.
comment:7 by , 15 years ago
Cc: | added |
---|
comment:8 by , 15 years ago
Cc: | added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
My guess is that gcc mistakenly treats this as an aliasing issue since the pointer arguments to grow_array have an incompatible type.
Anyway, I added casts that avoid the warning and it fixed the issue for me with gcc 4.4.1.
comment:9 by , 15 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I suppose your changes where in the latest svn, I checked it out and it still gave me problems in my whole "lab".
I had a chance today to revisit demux_mkv.c. I just moved the grow_array contents (It is just a realloc, I don't know if a wrapper around it is necessary?) inside add_cluster_position and it fixed the problem for my three computers. Using gcc 4.4.1 and in two x86 and one x86-64 architectures (That's my "lab"), all of them with ArchLinux.
Also while finding the break point again I added a lot of key brackets in demux_mkv_fill_buffer, and also moved all the declarations at the start of the function, well, I don't know, it makes life easier for the compiler I guess.
I'm attaching the whole file and the patch against 19673.
comment:10 by , 15 years ago
attachments.isobsolete: | 0 → 1, 1 |
---|
As stated in the last comment, this patch only moves the grow_array contents to add_cluster_position, and it fixes the bug for many test cases.
comment:11 by , 15 years ago
the answer is to use -demuxer lavf
because the same person maintains both and we'd like to get rid of duplicate code.
comment:12 by , 14 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed, patriotact@gmail.com |
demux lavf is now default for mplayer since no one cared to fix up demuxer mkv.
sounds like gcc 4.4.0 is broken
make a gdb like it says in the DOCS under how to make a bugreport...
http://www.mplayerhq.hu/DOCS/HTML-single/en/MPlayer.html#bugreports_crash