than doing it inline. Doing it inline screws up on ppc32-linux if
we're sending an async signal to ourselves (the same thread) because
the kernel immediately hands the signal to async_sighandler() which
then dies at the assertion that this thread's state is VgTs_WaitSys.
From which I conclude this wrapper has always had a race against the
kernel which did not show up on x86 or amd64. (and/or that I don't
understand this stuff too well)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5169
source it turns out that there are five different versions of mmap for
the three platforms we currently support:
- On x86-linux there is mmap (aka old_mmap) which takes the
arguments in a memory block and the offset in bytes; and
mmap2 (aka sys_mmap2) which takes the arguments in the normal
way and the offset in pages.
- On ppc32-linux there is mmap (aka sys_mmap) which takes the
arguments in the normal way and the offset in bytes; and
mmap2 (aka sys_mmap2) which takes the arguments in the normal
way and the offset in pages.
- On amd64-linux everything is simple and there is just the one
call, mmap (aka sys_mmap) which takes the arguments in the normal
way and the offset in bytes.
To reconcile all this I have created a generic handler and then
written five platform specific wrappers which normalise all the
arguments and then call the generic handler.
I have also modified the address space manager to use mmap2 rather
than mmap on x86 and ppc32 so that large offsets can be correctly
handled.
There is still an issue of OffT truncating offsets as we go through
the address space manager that will need to be addressed.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4834
- update comment re offset scaling
- ppc32 offset is in bytes, not pages
- don't deal with MAP_FIXED case directly here; instead uniformly pass
all requests to VG_(am_get_advisory), so that layout policy is controlled
from one place only.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4823
not bytes. This is a horrible kludge of a fix and it should probably
be fixed properly with a separate sys_mmap for amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4821
changes from r4341 through r4787 inclusive). That branch is now dead.
Please do not commit anything else to it.
For the most part the merge was not troublesome. The main areas of
uncertainty are:
- build system: I had to import by hand Makefile.core-AM_CPPFLAGS.am
and include it in a couple of places. Building etc seems to still
work, but I haven't tried building the documentation.
- syscall wrappers: Following analysis by Greg & Nick, a whole lot of
stuff was moved from -generic to -linux after the branch was created.
I think that is satisfactorily glued back together now.
- Regtests: although this appears to work, no .out files appear, which
is strange, and makes it hard to diagnose regtest failures. In
particular memcheck/tests/x86/scalar.stderr.exp remains in a
conflicted state.
- amd64 is broken (slightly), and ppc32 will be unbuildable. I'll
attend to the former shortly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4789
Previously, %d printed a 32-bit int. %ld and %lld printed 64-bit ints.
So if you wanted to print a word-sized int (eg. a SizeT variable), you
had to cast it to a Long and then print with %lld in order to work on
both 32-bit and 64-bit platforms.
I changed things so that %d prints a 32-bit int, %ld prints a word-sized
int, and %lld prints a 64-bit int. There are two advantages to this:
- it now matches the way the normal glibc printf() works;
- you can print word-sized ints without casting.
I also made the corresponding change for %u/lu/llu and %x/lx/llx, and I
changed a couple of VG_(printf)() invocations accordingly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4527
* The wrapper for fcntl(F_SETOWN) and fcntl(F_SETSIG) ignores ARG3,
but should not.
* Linux PRE(sys_umount) doesn't print ARG2.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4487
remaining ones have no interesting effect, but I left them in.
Also simplify the signature for VG_(get_memory_from_mmap_for_client)().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4045
EPOLL_CTL_DEL invocation.
Also renamed our "struct epoll_event" to "struct vki_epoll_event" as it
should be called.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4014
As part of this, VG_(resolve_filename)() no longer calls VG_(malloc)()
and so m_libcfile no longer depends on m_mallocfree.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4001
module-local, use the new ML_ prefix instead of VG_. This makes it
trivial to see which names are those exported from public module
interfaces: precisely those using VG_.
/* VG_ is for symbols exported from modules. ML_ (module-local) is
for symbols which are not intended to be visible outside modules,
but which cannot be declared as C 'static's since they need to be
visible across C files within a given module. It is a mistake for
a ML_ name to appear in a pub_core_*.h or pub_tool_*.h file.
Likewise it is a mistake for a VG_ name to appear in a priv_*.h
file.
*/
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4000
- Broke part of m_scheduler off into a new module m_threadstate. It
contains ThreadState, VG_(threads)[] and some basic operations on the
thread table. All simple stuff, the complex stuff stays in m_scheduler.
This avoids lots of circular dependencies between m_scheduler and other
modules.
- Managed to finally remove core.h and tool.h, double hurrah!
- Introduced pub_tool_basics.h and pub_core_basics.h, one of which is
include by every single C file.
- Lots of little cleanups and changes related to the above.
- I even did a small amount of documentation updating.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3944