History log of /external/valgrind/none/tests/mmap_fcntl_bug.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ad4e979f408239dabbaae955d8ffcb84a51a5c85 05-Jul-2015 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix typos in source code. Patch by Dmitriy (olshevskiy87@bk.ru).
Fixes BZ #349874


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15394 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/none/tests/mmap_fcntl_bug.c
8050bb782a2010d8453d161c7c291f52be4f0cc1 14-Apr-2012 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> patch fixing 297991: mmap changing a file descriptor current position

Bug caused by the following problem:
for each mmap, Valgrind reads the 1st 1024 bytes to detect
if this is an mmap-ed file containing debug info to decode.

Reading this 1Kb is done with VG_(pread). VG_(pread) should be
the equivalent of syscall pread but on linux, it is implemented as
a seek+read.

The patch implements VG_(pread) in terms of the underlying pread syscall.

Test mmap_fcntl_bug.c completed to also verify the fd current position
before and after the mmap.

tested on linux x86/amd64/ppc32/ppc64/s390.
(not tested on Darwin)
(manually tested on arm-android)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12504 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/none/tests/mmap_fcntl_bug.c
5f2dcad945d0bf3aaa9c9449ae90a5f2ca69adf1 24-Oct-2011 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Don't break fcntl locks when program does mmap. #280965.
(Rusty Russell, rusty@rustcorp.com.au)

tdb uses fcntl locks and mmap, and some of the tests fail under valgrind.
strace showed valgrind opening the tdb file, reading 1024 bytes, then closing
it. This is not allowed: POSIX says if you open and close a file, all fcntl
locks on it are dropped (insane, yes).

Finally got around to hacking the source to track this down: di_notify_mmap is
doing the damage. The simplest fix was to hand in an optional fd for it to
use, then have it do pread.

I had to fix your pread; surely this should seek back even if the platform
doesn't have pread support?



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12224 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/none/tests/mmap_fcntl_bug.c