[FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

u-h8zb at aetey.se u-h8zb at aetey.se
Sat Oct 1 21:27:44 EEST 2016


Hello,

It looks like some general information is due:

Musl libc is a high quality standard C library for Linux
with emphasis on "quality" and "standard"
 http://www.musl-libc.org/

On Sat, Oct 01, 2016 at 12:31:05PM -0400, Ronald S. Bultje wrote:
> > This means when malloc()/free()/... happens to be called internally,
> > it corrupts the malloc structures, in a non-straightforward ways.
> 
> That's correct.
> 
> Why does your malloc implementation use floats?

Not mine, but musl's. I am not involved in musl development.

(The tradition of fixed-point malloc was born while floating point was
extremely expensive. It is otherwise a "myth" that memory management
can not have use for floating point operations. Musl malloc() is well
behaving, efficient and robust.)

If you are curious you may wish to look at its code (it is clean
and readable).

On Sat, Oct 01, 2016 at 06:38:49PM +0200, Henrik Gramner wrote:
> On Sat, Oct 1, 2016 at 5:37 PM,  <u-h8zb at aetey.se> wrote:
> > musl libc which uses floating point in its malloc() implementation.
> 
> That's honestly the real "WTF?" here.

I hope the explanation above sheds light on the matter.

> In that case use emms_c() before calling those functions.

Yes, it is probably what ffmpeg should do and this is the point of my
report. If you mean that I should have submitted a patch, I really
hope somebody else can do the actual fix(es).

Regards,
Rune



More information about the ffmpeg-devel mailing list