[MPlayer-advusers] gcc, mplayer and profile (mcount)
Adam Sulmicki
adam at cfar.umd.edu
Wed Jan 3 15:17:01 CET 2007
Hello folks,
This is my last post on the subject of mcount.
I have spent a quite bit of time on this to find out
that the results of myserious crashes is the mcount variable.
(with help from Ian Lance Taylor).
I have reported the issue to both gcc and mplayer lists, and
from _BOTH_ lists I got reply that they do not feel it is their
problem and blamed the other package.
WELL, as far as I'm concerned the issue is solved, I know how to
fix it and works for me.
In spirit making OSS better, I took the extra effor to report
findings back to both lists. In reward I got flamed on both list.
The Issue:
Anyway, the scop is that once I try to compile mplayer with
-pg option (or -p) then it will start myseriously crash on
mplayer/libmenu/menu.c:menu_init().
It comes out that in mplayer/libmenu/menu.c there's in use
"mcount" variable:
# grep mcount menu.c
static int mcount = 0;
however, once "-pg" or "-p" options are enabled,
gcc uses mcount _function_ for its internal profiling.
The results are mysterious crashes on menu_init().
Suggested solutions:
* Rename mcount in mplayer/libmenu/menu.c to something else.
* document mcount in gcc man page
* gcc prints warning.
* do nothing.
I can immagine that gcc developers might have intentionally left mcount()
visible to user space so that user can replace gcc's mcount() with their
own implementation.
Just FWIW, I don't care if anything will get done about it.
--
Adam Sulmicki
http://www.eax.com The Supreme Headquarters of the 32 bit registers
More information about the MPlayer-advusers
mailing list