[FFmpeg-devel] [PATCH] av_malloc() workaround for QNX platform

Mike Gorchak mike.gorchak.qnx at gmail.com
Thu Feb 7 22:17:12 CET 2013


>> I agree this code is correct, but anyway something trashing the heap
>> when this code is active. Maybe code somewhere has va_malloc() and
>> corresponding free() instead of va_free(), but this situation is hard
>> to check. I've checked vice versa situation when malloc()/va_free() is
>> used, and have not found any cases. Memory heap corruption is 100%
>> reproducible using H.264 codec, but when posix_memalign() is used, all
>> goes fine, because free() and va_free() are the same.
>
> make sure you use latest git

I'm using 4 hours old git checkout.

> can you try with something like valgrind or asan ?

No valgrind and asan under QNX. I've a special debug malloc library
under QNX. Malloc uses few arenas (memory regions). When incorrect
free() is issued, it is almost impossible to track it down, especially
when numerous subsequent allocations/deallocations are performed on
another arena. I can only notice much later that one of the malloc()s
has been failed, and after few calls application segfaults on any
malloc() or free() operation because malloc's service data is trashed.


More information about the ffmpeg-devel mailing list