[Ffmpeg-devel] random crashes decoding MP3s

Måns Rullgård mru
Mon Apr 3 09:50:03 CEST 2006


Jacob Meuser <jakemsr at jakemsr.com> writes:

> On Sun, Apr 02, 2006 at 03:09:07AM -0400, Rich Felker wrote:
>> On Sat, Apr 01, 2006 at 08:31:43PM -0800, Jacob Meuser wrote:
>> > > > I tried to build ffmpeg on OpenBSD myself, and it turns out it's not
>> > > > as easy as it should be.  What exactly have you done to your source to
>> > > > make it build?
>> > > 
>> > > OK, now it builds, but only with --enable-memalign-hack.  Did you use
>> > > this option or disable mmx/sse?  OpenBSD appears to be missing
>> > > memalign() so one or the other is required.  Forcing mmx/sse without a
>> > > proper memalign() can very well result in random crashes.
>> > 
>> > yes, there is no memlign() on OpenBSD.
>> > 
>> > quoting malloc(3)
>> > 
>> >     The allocated space is suitably aligned (after possible
>> >     pointer coercion) for storage of any type of object.  If the
>> >     space is of pagesize or larger, the memory returned will be
>> >     page-aligned.
>> 
>> This text is not meaningful to what we're talking about. ISO C
>> requires that the return value of malloc be "suitably aligned for
>> storage of any type of object", but "object" is defined as in ISO C,
>> and this has nothing to do with the alignment requirements of various
>> asm constructs. A true memalign is needed..
>
> I have always disabled MEMALIGN_HACK and never had any problems.

Maybe OpenBSD malloc() aligns more than is required.

>> > enabling the memalign-hack actually causes crashes all over the
>> > place.  I am only seeing problems decoding MP3 files.
>> 
>> Odd..
>
> I guess I never explicitly stated that this problem occurs on an
> amd64 machine (although that was in the gdb info).  I cannot reproduce
> the problem on an i386 installation.

Hmm, I only have P4 machines around (and some Alphas).

> it looks like the MEMALIGN_HACK stuff is only useful on x86 and
> not x86_64?  using the MEMALIGN_HACK stuff on OpenBSD/amd64 creates
> a completely useless binary.

Weird.  Enabling it should always be harmless.

-- 
M?ns Rullg?rd
mru at inprovide.com





More information about the ffmpeg-devel mailing list