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

Ronald S. Bultje rsbultje at gmail.com
Sat Oct 1 22:11:38 EEST 2016


On Sat, Oct 1, 2016 at 2:27 PM, <u-h8zb at aetey.se> wrote:

> 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).

I'm not sure we want to go down the rabbit hole of allowing any code to be
executed inside frame en/decoding routines. Historically, IIRC, we have
disallowed float in user callbacks like request_frame also.

Why does musl malloc require float? This is a real question. I can't think
of any reason why you'd want this.


More information about the ffmpeg-devel mailing list