[MPlayer-dev-eng] [PATCH] configure & MEMALIGN_HACK

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Jan 5 12:43:01 CET 2005

On Tue, Jan 04, 2005 at 11:28:05PM +0100, Björn Sandell wrote:
> On Tue, 4 Jan 2005 23:04:34 +0100
> Sascha Sommer <saschasommer at freenet.de> wrote:
> > On Tuesday 04 January 2005 21:10, Björn Sandell wrote:
> [snip]
> > > mplayer in free(): error: modified (chunk-) pointer

What _exactly_ is that message supposed to mean?

> > > MPlayer interrupted by signal 6 in module: uninit_vcodec
> > > - MPlayer crashed. This shouldn't happen.
> > >   It can be a bug in the MPlayer code _or_ in your drivers _or_ in
> > >   your gcc version. If you think it's MPlayer's fault, please read
> > >   DOCS/HTML/en/bugreports.html and follow the instructions there. We
> > >   can't
> > > and won't help unless you provide this information when reporting a
> > > possible bug.
> > >
> > > hence I suggest a patch like the attached.
> > 
> > Can you find out why this happens or send a backtrace?
> It's av_free() in libavcodec/mem.c that calls free() with a bad pointer.
> I'll try to get a better description/backtrace.

On first sight I can't see anything wrong with the code. A backtrace
definitely is needed.

> > Do the BSDs really have no memalign?
> No. malloc() returns a pointer that is "suitably aligned (after possible
> pointer coercion) for storage of any type of object".

This is nonsense unless the BSD developers have a crystal ball that can
tell them all assembler instructions that will ever be implemented.
As with some CPUs you can do microcode updates somebody could have
created an instruction that needs data aligned on a GB boundary - malloc
certainly doesn't return a pointer suitable for that!

> > I'm afraid this fix is needed on BSD, too otherwise SSE instructions
> > will just lead to a segfault on P4 if the buffers aren't aligned
> > correctly.
> Well, then we would have seen those segfaults a month ago, but I didn't.
> (acutally I have a PIII, but I'm sure someone would have told me :)

It only can be a problem with SSE2 (except for the loss in speed),
so you will only see it with P4. And there weren't too many bugreports
on windows about it and I expect that we have at least as many windows
users as BSD users...

Reimar Döffinger

More information about the MPlayer-dev-eng mailing list