[MPlayer-dev-eng] [PATCH] fix to codec memory mapper to prevent segfaults
Martin Simmons
vyslnqaaxytp at spammotel.com
Mon Aug 2 01:41:35 CEST 2004
>>>>> On Sun, 01 Aug 2004 10:50:38 +0200, Reimar D?ffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> said:
>>> The attached patch fixes the problem on Linux by making VirtualAlloc avoid
>>> already-allocated addresses, something like it does in Win32. I say
>>> "something like" because for efficiency it only records the addresses the
>>> first time, rather than for each allocation request, but that is sufficient in
>>> this case.
>>
>> What happend to this patch ?
Reimar> Up to now the usual thing. I asked the reporter of bug #12 to test it
Reimar> but got no reply.
I suggested it as a fix for
http://mplayerhq.hu/pipermail/mplayer-users/2004-July/046971.html
too and the OP in mailed me (off list) to say that it fixed the crash (without
--enable-debug) and he would check for any problems but I didn't hear of any.
Reimar> And I would have to spend some more time to understand it. Maybe some
Reimar> comments in the code wouldn't be bad?
Sorry, I tried to make it match the rest of the code :-)
The overall logic is pretty trivial (I'm assuming you don't mean comments like
"open the file" or "read lines until eof"). Possibly worthy comments that I
missed:
1) The purpose of the initVirtualAlloc function is to discover which regions
of memory are already in use and make dummy entries in the vm list to
prevent their reuse (since mmap won't check this).
2) The file /proc/nnn/maps contains 1 line for each currently mapped region in
process nnn, in numerical address order.
__Martin
More information about the MPlayer-dev-eng
mailing list