|
From: Ashley P. <as...@pi...> - 2003-11-17 13:02:21
|
On Mon, 2003-11-17 at 12:24, Dirk Mueller wrote: > On Monday 17 November 2003 13:11, Ashley Pittman wrote: > > > I like it (roughly) as it is but it would be nice if the 'trimmed' > > messages contained a link to the full commit so I could read them if I > > wanted to. > > Well, the commit logs still have the information which files were modified and > which revisions there are. we have a script to generate a diff from that. You might have a script to do that but I don't, I *could* write a script to grok the email for me but it would be easier if I didn't have to. If this can't be done then I vote for a larger trim threshold. Ashley, |
|
From: Dirk M. <mu...@kd...> - 2003-11-19 00:56:23
|
CVS commit by mueller: updating .cvsignore M +4 -0 addrcheck/tests/.cvsignore 1.2 M +11 -0 corecheck/tests/.cvsignore 1.4 M +10 -0 helgrind/tests/.cvsignore 1.2 M +7 -0 memcheck/tests/.cvsignore 1.7 --- valgrind/addrcheck/tests/.cvsignore #1.1:1.2 @@ -1,2 +1,6 @@ Makefile.in Makefile +badrw.stderr.diff +badrw.stderr.out +fprw.stderr.diff +fprw.stderr.out --- valgrind/corecheck/tests/.cvsignore #1.3:1.4 @@ -16,2 +16,13 @@ *.stdout.out *.stderr.out +fdleak_cmsg +fdleak_creat +fdleak_dup +fdleak_dup2 +fdleak_fcntl +fdleak_ipv4 +fdleak_open +fdleak_pipe +fdleak_socketpair +pth_exit +vgprintf --- valgrind/helgrind/tests/.cvsignore #1.1:1.2 @@ -1,2 +1,12 @@ Makefile.in Makefile +allok +allok.stderr.diff +allok.stderr.out +deadlock +deadlock.stderr.out +deadlock.stdout.out +inherit +race +race2 +readshared --- valgrind/memcheck/tests/.cvsignore #1.6:1.7 @@ -49,2 +49,9 @@ *.stdout.out *.stderr.out +badrw +brk +metadata +new_nothrow +realloc3 +threadederrno +writev |
|
From: Dirk M. <mu...@kd...> - 2003-11-19 16:55:29
|
CVS commit by mueller:
trying to fix compilation. Does it work now for everybody?
M +0 -3 coregrind/vg_unsafe.h 1.21
M +34 -1 include/vg_kerneliface.h 1.7
--- valgrind/coregrind/vg_unsafe.h #1.20:1.21
@@ -91,7 +91,4 @@
#include <sys/types.h>
-#include <asm/statfs.h>
-#undef statfs
-
#include <sys/sysinfo.h>
--- valgrind/include/vg_kerneliface.h #1.6:1.7
@@ -672,6 +672,39 @@ struct vki_sockaddr {
};
+/* statfs structs */
+/*
+ * bits/statfs.h
+ */
-#endif /* ndef __VG_KERNELIFACE_H */
+struct statfs {
+ unsigned int f_type;
+ unsigned int f_bsize;
+ unsigned int f_blocks;
+ unsigned int f_bfree;
+ unsigned int f_bavail;
+ unsigned int f_files;
+ unsigned int f_ffree;
+ int f_fsid[ 2 ];
+ unsigned int f_namelen;
+ unsigned int f_frsize;
+ unsigned int f_spare[5];
+};
+
+struct statfs64 {
+ unsigned int f_type;
+ unsigned int f_bsize;
+ unsigned long long f_blocks;
+ unsigned long long f_bfree;
+ unsigned long long f_bavail;
+ unsigned long long f_files;
+ unsigned long long f_ffree;
+ int f_fsid[ 2 ];
+ unsigned int f_namelen;
+ unsigned int f_frsize;
+ unsigned int f_spare[5];
+};
+
+
+#endif /* __VG_KERNELIFACE_H */
/*--------------------------------------------------------------------*/
|
|
From: Nicholas N. <nj...@ca...> - 2003-11-19 20:10:41
|
On Wed, 19 Nov 2003, Dirk Mueller wrote: > trying to fix compilation. Does it work now for everybody? yep, thanks. I just fixed cachegrind/tests/dlclose, which had broken due to the "discard" message no longer being shown. N |
|
From: Dirk M. <mu...@kd...> - 2003-11-19 21:50:37
|
CVS commit by mueller:
pkgconfig support. Patch by Dimitri Papadopoulos
MERGE TO STABLE
CCMAIL: 685...@bu...
A valgrind.pc.in 1.1
M +1 -0 .cvsignore 1.5
M +5 -2 Makefile.am 1.58
M +1 -0 configure.in 1.100
--- valgrind/.cvsignore #1.4:1.5
@@ -18,2 +18,3 @@
cachegrind.out.*
autom4te.cache
+valgrind.pc
--- valgrind/Makefile.am #1.57:1.58
@@ -26,5 +26,8 @@
val_DATA = $(SUPP_FILES) default.supp
-BUILT_SOURCES = default.supp
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = valgrind.pc
+
+BUILT_SOURCES = default.supp valgrind.pc
DISTCLEANFILES = default.supp
@@ -41,5 +44,5 @@
README_KDE3_FOLKS README_PACKAGERS \
README_MISSING_SYSCALL_OR_IOCTL TODO \
- valgrind.spec valgrind.spec.in
+ valgrind.spec valgrind.spec.in valgrind.pc.in
install-exec-hook:
--- valgrind/configure.in #1.99:1.100
@@ -341,4 +341,5 @@
Makefile
valgrind.spec
+ valgrind.pc
docs/Makefile
tests/Makefile
|
|
From: Dirk M. <mu...@kd...> - 2003-11-19 22:08:06
|
CVS commit by mueller:
this should fix compilation on weird kernel 2.6.x installations.
CCMAIL: 68...@bu...
M +4 -4 coregrind/vg_syscalls.c 1.59
M +0 -1 coregrind/vg_unsafe.h 1.22
M +13 -0 include/vg_kerneliface.h 1.8
--- valgrind/coregrind/vg_syscalls.c #1.58:1.59
@@ -2488,5 +2488,5 @@ PRE(ioctl)
# endif
- case IIOCGETCPS:
+ case VKI_IIOCGETCPS:
/* In early 2.4 kernels, ISDN_MAX_CHANNELS was only defined
* when KERNEL was. I never saw a larger value than 64 though */
@@ -2498,5 +2498,5 @@ PRE(ioctl)
* 2 * sizeof(unsigned long) );
break;
- case IIOCNETGPN:
+ case VKI_IIOCNETGPN:
SYSCALL_TRACK( pre_mem_read, tid, "ioctl(IIOCNETGPN)",
(UInt)&((isdn_net_ioctl_phone *)arg3)->name,
@@ -2887,5 +2887,5 @@ POST(ioctl)
# endif
- case IIOCGETCPS:
+ case VKI_IIOCGETCPS:
/* In early 2.4 kernels, ISDN_MAX_CHANNELS was only defined
* when KERNEL was. I never saw a larger value than 64 though */
@@ -2897,5 +2897,5 @@ POST(ioctl)
* 2 * sizeof(unsigned long) );
break;
- case IIOCNETGPN:
+ case VKI_IIOCNETGPN:
if (res == 0)
VG_TRACK( post_mem_write, arg3, sizeof(isdn_net_ioctl_phone) );
--- valgrind/coregrind/vg_unsafe.h #1.21:1.22
@@ -58,5 +58,4 @@
#include <linux/sem.h> /* for struct sembuf */
-#include <linux/isdn.h> /* for ISDN ioctls */
#include <scsi/sg.h> /* for the SG_* ioctls */
#include <sched.h> /* for struct sched_param */
--- valgrind/include/vg_kerneliface.h #1.7:1.8
@@ -372,4 +372,17 @@ struct vki_ucontext {
#define VKI_ERESTARTSYS 512 /* Restart the syscall */
+/* Copied from linux/isdn.h */
+
+#define VKI_IIOCGETCPS _IO( 'I',21 )
+#define VKI_IIOCNETGPN _IO( 'I',34 )
+
+#define ISDN_MSNLEN 32
+
+typedef struct {
+ char name[ 10 ];
+ char phone[ ISDN_MSNLEN ];
+ int outgoing;
+} isdn_net_ioctl_phone;
+
/* Gawd ... hack ... */
|
|
From: Dirk M. <mu...@kd...> - 2003-11-24 21:26:09
|
CVS commit by mueller: add missing include files to spec file listing M +3 -0 valgrind.spec.in 1.9 --- valgrind/valgrind.spec.in #1.8:1.9 @@ -42,4 +42,7 @@ /usr/include/valgrind/memcheck.h /usr/include/valgrind/helgrind.h +/usr/include/valgrind/vg_constants_skin.h +/usr/include/valgrind/vg_kerneliface.h +/usr/include/valgrind/vg_skin.h /usr/bin/valgrind /usr/bin/cg_annotate |
|
From: Nicholas N. <nj...@ca...> - 2003-12-02 15:27:30
|
CVS commit by nethercote: Patch from Tom Hughes: This patch extends the SFENCE support that is already present to include support for LFENCE and MFENCE as well. It also stops CLFLUSH being mistaken for SFENCE by checking the top two bits of the MODRM byte. M +21 -59 README 1.13 M +5 -3 coregrind/vg_to_ucode.c 1.114 --- valgrind/README #1.12:1.13 @@ -2,14 +2,15 @@ Release notes for Valgrind, version 1.0.0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +> We're well past 1.0.0. I propose removing the version number here; +> it doesn't contribute anything, and just gets out-of-date. + KDE3 developers: please read also README_KDE3_FOLKS for guidance about how to debug KDE3 applications with Valgrind. -If you are building a binary package of Valgrind for distribution, -please read README_PACKAGERS. It contains some important information. - -If you are developing Valgrind, please read README_DEVELOPERS. It contains -some useful information. +> I propose removing README_KDE3_FOLKS, and this reference to it; I +> think Valgrind has been around long enough that KDE developers don't +> need separate instructions. -For instructions on how to build/install, see the end of this file. +[snip] Valgrind works best on systems with glibc-2.1.X or 2.2.X, and with gcc @@ -19,28 +20,13 @@ optimisation. Valgrind-1.0.X also can't handle glibc-2.3.X systems. +> Out of date: I think glibc-2.3.X is ok, right? Also gcc-3.1 is ok? Executive Summary ~~~~~~~~~~~~~~~~~ -Valgrind is a tool to help you find memory-management problems in your -programs. When a program is run under Valgrind's supervision, all -reads and writes of memory are checked, and calls to -malloc/new/free/delete are intercepted. As a result, Valgrind can -detect problems such as: - - Use of uninitialised memory - Reading/writing memory after it has been free'd - Reading/writing off the end of malloc'd blocks - Reading/writing inappropriate areas on the stack - Memory leaks -- where pointers to malloc'd blocks are lost forever - Passing of uninitialised and/or unaddressible memory to system calls - Mismatched use of malloc/new/new [] vs free/delete/delete [] - Some abuses of the POSIX pthread API - -Problems like these can be difficult to find by other means, often -lying undetected for long periods, then causing occasional, -difficult-to-diagnose crashes. -When Valgrind detects such a problem, it can, if you like, attach GDB -to your program, so you can poke around and see what's going on. +> This summary doesn't account for the core/tool split. Should be +> similar to the overview on the website. + +[snip] Valgrind is closely tied to details of the CPU, operating system and @@ -54,4 +40,7 @@ least. +> Out of date... could make more generic, eg. works on most/all common +> Linux distros + Valgrind is licensed under the GNU General Public License, version 2. Read the file COPYING in the source distribution for details. @@ -66,39 +55,12 @@ docs/techdocs.html. +> These paths are incorrect. -Building and installing it -~~~~~~~~~~~~~~~~~~~~~~~~~~ -To install from CVS : - - 0. Check out the code from CVS, following the instructions at - http://developer.kde.org/source/anoncvs.html. The 'modulename' is - "valgrind". - - 1. cd into the source directory. - - 2. Run ./autogen.sh to setup the environment (you need the standard - autoconf tools to do so). - -To install from a tar.gz archive: - - 3. Run ./configure, with some options if you wish. The standard - options are documented in the INSTALL file. The only interesting - one is the usual --prefix=/where/you/want/it/installed. - - 4. Do "make". - - 5. Do "make install", possibly as root if the destination permissions - require that. - - 6. See if it works. Try "valgrind ls -l". Either this works, - or it bombs out complaining it can't find argc/argv/envp. - In that case, mail me a bug report. - -Important! Do not move the valgrind installation into a place -different from that specified by --prefix at build time. This will -cause things to break in subtle ways, mostly when Valgrind handles -fork/exec calls. - +[snip] Julian Seward (js...@ac...) 1 July 2002 + +> out of date, I suggest removing the date, and saying "report bugs to +> valgrind.kde.org" or similar. + --- valgrind/coregrind/vg_to_ucode.c #1.113:1.114 @@ -3495,7 +3495,9 @@ static Addr disInstr ( UCodeBlock* cb, A } - /* SFENCE -- flush all pending store operations to memory */ + /* LFENCE/MFENCE/SFENCE -- flush pending operations to memory */ if (insn[0] == 0x0F && insn[1] == 0xAE - && (gregOfRM(insn[2]) == 7)) { + && (epartIsReg(insn[2])) + && (gregOfRM(insn[2]) >= 5 && gregOfRM(insn[2]) <= 7)) + { vg_assert(sz == 4); eip += 3; |
|
From: Nicholas N. <nj...@ca...> - 2003-12-02 15:34:10
|
CVS commit by nethercote: Whoops... back out changes accidentally made to this file with the last, unrelated, commit. Sorry. M +59 -21 README 1.14 --- valgrind/README #1.13:1.14 @@ -2,15 +2,14 @@ Release notes for Valgrind, version 1.0.0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -> We're well past 1.0.0. I propose removing the version number here; -> it doesn't contribute anything, and just gets out-of-date. - KDE3 developers: please read also README_KDE3_FOLKS for guidance about how to debug KDE3 applications with Valgrind. -> I propose removing README_KDE3_FOLKS, and this reference to it; I -> think Valgrind has been around long enough that KDE developers don't -> need separate instructions. +If you are building a binary package of Valgrind for distribution, +please read README_PACKAGERS. It contains some important information. + +If you are developing Valgrind, please read README_DEVELOPERS. It contains +some useful information. -[snip] +For instructions on how to build/install, see the end of this file. Valgrind works best on systems with glibc-2.1.X or 2.2.X, and with gcc @@ -20,13 +19,28 @@ optimisation. Valgrind-1.0.X also can't handle glibc-2.3.X systems. -> Out of date: I think glibc-2.3.X is ok, right? Also gcc-3.1 is ok? Executive Summary ~~~~~~~~~~~~~~~~~ +Valgrind is a tool to help you find memory-management problems in your +programs. When a program is run under Valgrind's supervision, all +reads and writes of memory are checked, and calls to +malloc/new/free/delete are intercepted. As a result, Valgrind can +detect problems such as: + + Use of uninitialised memory + Reading/writing memory after it has been free'd + Reading/writing off the end of malloc'd blocks + Reading/writing inappropriate areas on the stack + Memory leaks -- where pointers to malloc'd blocks are lost forever + Passing of uninitialised and/or unaddressible memory to system calls + Mismatched use of malloc/new/new [] vs free/delete/delete [] + Some abuses of the POSIX pthread API + +Problems like these can be difficult to find by other means, often +lying undetected for long periods, then causing occasional, +difficult-to-diagnose crashes. -> This summary doesn't account for the core/tool split. Should be -> similar to the overview on the website. - -[snip] +When Valgrind detects such a problem, it can, if you like, attach GDB +to your program, so you can poke around and see what's going on. Valgrind is closely tied to details of the CPU, operating system and @@ -40,7 +54,4 @@ least. -> Out of date... could make more generic, eg. works on most/all common -> Linux distros - Valgrind is licensed under the GNU General Public License, version 2. Read the file COPYING in the source distribution for details. @@ -55,12 +66,39 @@ docs/techdocs.html. -> These paths are incorrect. -[snip] +Building and installing it +~~~~~~~~~~~~~~~~~~~~~~~~~~ +To install from CVS : -Julian Seward (js...@ac...) -1 July 2002 + 0. Check out the code from CVS, following the instructions at + http://developer.kde.org/source/anoncvs.html. The 'modulename' is + "valgrind". + + 1. cd into the source directory. + + 2. Run ./autogen.sh to setup the environment (you need the standard + autoconf tools to do so). -> out of date, I suggest removing the date, and saying "report bugs to -> valgrind.kde.org" or similar. +To install from a tar.gz archive: + 3. Run ./configure, with some options if you wish. The standard + options are documented in the INSTALL file. The only interesting + one is the usual --prefix=/where/you/want/it/installed. + + 4. Do "make". + + 5. Do "make install", possibly as root if the destination permissions + require that. + + 6. See if it works. Try "valgrind ls -l". Either this works, + or it bombs out complaining it can't find argc/argv/envp. + In that case, mail me a bug report. + +Important! Do not move the valgrind installation into a place +different from that specified by --prefix at build time. This will +cause things to break in subtle ways, mostly when Valgrind handles +fork/exec calls. + + +Julian Seward (js...@ac...) +1 July 2002 |
|
From: Nicholas N. <nj...@ca...> - 2003-12-03 21:45:17
|
CVS commit by nethercote:
Updated the README file. It had lots of out-of-date and incorrect information
in it, much of it from 1.0.X days. Did it in such a way that if it doesn't get
touched (and it undoubtedly won't) it won't really go out of date, eg. by
removing temporary details like version numbers, dates, details of specific
software incompatibilities. It's much better to be vague but correct, than
precise but incorrect; having incorrect info in a file as important as the
README is bad. Also removed the README_KDE3_FOLKS file because it's pretty
redundant now. Also added some changes that had been made in the stable branch
but not the HEAD.
Did similar, but smaller changes to README_DEVELOPERS and README_PACKAGERS.
Also updated the valgrind.spec.in file to use the new, post-1.0.X description
in the README.
Also fixed a minor omission in Addrcheck's docs.
MERGE TO STABLE
M +1 -1 Makefile.am 1.59
M +34 -38 README 1.15
M +0 -2 README_DEVELOPERS 1.2
M +0 -2 README_PACKAGERS 1.3
M +9 -14 valgrind.spec.in 1.10
M +2 -0 addrcheck/docs/ac_main.html 1.4
R README_KDE3_FOLKS 1.3
--- valgrind/Makefile.am #1.58:1.59
@@ -42,5 +42,5 @@
FAQ.txt \
PATCHES_APPLIED ACKNOWLEDGEMENTS \
- README_KDE3_FOLKS README_PACKAGERS \
+ README_PACKAGERS \
README_MISSING_SYSCALL_OR_IOCTL TODO \
valgrind.spec valgrind.spec.in valgrind.pc.in
--- valgrind/README #1.14:1.15
@@ -1,8 +1,5 @@
-Release notes for Valgrind, version 1.0.0
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-KDE3 developers: please read also README_KDE3_FOLKS for guidance
-about how to debug KDE3 applications with Valgrind.
-
+Release notes for Valgrind
+~~~~~~~~~~~~~~~~~~~~~~~~~~
If you are building a binary package of Valgrind for distribution,
please read README_PACKAGERS. It contains some important information.
@@ -13,44 +10,44 @@
For instructions on how to build/install, see the end of this file.
-Valgrind works best on systems with glibc-2.1.X or 2.2.X, and with gcc
-versions prior to 3.1. gcc-3.1 works, but generates code which causes
-valgrind to report many false errors. For now, try to use a gcc prior
-to 3.1; if you can't, at least compile your application without
-optimisation. Valgrind-1.0.X also can't handle glibc-2.3.X systems.
-
+Valgrind works on most, reasonably recent Linux setups. If you have
+problems, consult FAQ.txt to see if there are workarounds.
Executive Summary
~~~~~~~~~~~~~~~~~
-Valgrind is a tool to help you find memory-management problems in your
-programs. When a program is run under Valgrind's supervision, all
-reads and writes of memory are checked, and calls to
-malloc/new/free/delete are intercepted. As a result, Valgrind can
-detect problems such as:
-
- Use of uninitialised memory
- Reading/writing memory after it has been free'd
- Reading/writing off the end of malloc'd blocks
- Reading/writing inappropriate areas on the stack
+Valgrind is a GPL'd system for debugging and profiling x86-Linux programs.
+With the tools that come with Valgrind, you can automatically detect
+many memory management and threading bugs, avoiding hours of frustrating
+bug-hunting, making your programs more stable. You can also perform
+detailed profiling to help speed up your programs.
+
+The Valgrind distribution includes four tools: two memory error
+detectors, a thread error detector, and a cache profiler. Several other
+tools have been built with Valgrind.
+
+To give you an idea of what Valgrind tools do, when a program is run
+under the supervision of the first memory error detector tool, all reads
+and writes of memory are checked, and calls to malloc/new/free/delete
+are intercepted. As a result, it can detect problems such as:
+
+ Use of uninitialised memory
+ Reading/writing memory after it has been free'd
+ Reading/writing off the end of malloc'd blocks
+ Reading/writing inappropriate areas on the stack
Memory leaks -- where pointers to malloc'd blocks are lost forever
Passing of uninitialised and/or unaddressible memory to system calls
- Mismatched use of malloc/new/new [] vs free/delete/delete []
+ Mismatched use of malloc/new/new [] vs free/delete/delete []
+ Overlaps of arguments to strcpy() and related functions
Some abuses of the POSIX pthread API
Problems like these can be difficult to find by other means, often
lying undetected for long periods, then causing occasional,
-difficult-to-diagnose crashes.
-
-When Valgrind detects such a problem, it can, if you like, attach GDB
-to your program, so you can poke around and see what's going on.
+difficult-to-diagnose crashes. When one of these errors occurs, you can
+attach GDB to your program, so you can poke around and see what's going
+on.
Valgrind is closely tied to details of the CPU, operating system and
to a less extent, compiler and basic C libraries. This makes it
difficult to make it portable, so I have chosen at the outset to
-concentrate on what I believe to be a widely used platform: Red Hat
-Linux 7.2, on x86s. I believe that it will work without significant
-difficulty on other x86 GNU/Linux systems which use the 2.4 kernel and
-GNU libc 2.2.X, for example SuSE 7.1 and Mandrake 8.0. This version
-1.0 release is known to work on Red Hats 6.2, 7.2 and 7.3, at the very
-least.
+concentrate on what I believe to be a widely used platform: x86/Linux.
Valgrind is licensed under the GNU General Public License, version 2.
@@ -61,8 +58,6 @@
~~~~~~~~~~~~~
A comprehensive user guide is supplied. Point your browser at
-docs/index.html. If your browser doesn't like frames, point it
-instead at docs/manual.html. There's also detailed, although somewhat
-out of date, documentation of how valgrind works, in
-docs/techdocs.html.
+$PREFIX/share/doc/valgrind/manual.html, where $PREFIX is whatever you
+specified with --prefix= when building.
@@ -80,5 +75,5 @@
autoconf tools to do so).
-To install from a tar.gz archive:
+To install from a tar.bz2 distribution:
3. Run ./configure, with some options if you wish. The standard
@@ -102,3 +97,4 @@
Julian Seward (js...@ac...)
-1 July 2002
+Nick Nethercote (nj...@ca...)
+Jeremy Fitzhardinge (je...@go...)
--- valgrind/README_DEVELOPERS #1.1:1.2
@@ -1,5 +1,3 @@
-5 May 2003
-
Building and not installing it
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- valgrind/README_PACKAGERS #1.2:1.3
@@ -1,5 +1,3 @@
-1 July 2002
-
Greetings, packaging person! This information is aimed at people
building binary distributions of Valgrind.
--- valgrind/valgrind.spec.in #1.9:1.10
@@ -12,18 +12,13 @@
%description
-Valgrind is a GPL'd tool to help you find memory-management problems
-in your programs. When a program is run under Valgrind's supervision,
-all reads and writes of memory are checked, and calls to
-malloc/new/free/delete are intercepted. As a result, Valgrind can
-detect problems such as:
+Valgrind is a GPL'd system for debugging and profiling x86-Linux programs.
+With the tools that come with Valgrind, you can automatically detect
+many memory management and threading bugs, avoiding hours of frustrating
+bug-hunting, making your programs more stable. You can also perform
+detailed profiling to help speed up your programs.
-- Use of uninitialised memory
-- Reading/writing memory after it has been free'd
-- Reading/writing off the end of malloc'd blocks
-- Reading/writing inappropriate areas on the stack
-- Memory leaks -- where pointers to malloc'd blocks are lost forever
-- Passing of uninitialised and/or unaddressible memory to system calls
-- Mismatched use of malloc/new/new [] vs free/delete/delete []
-- Some abuses of the POSIX Pthreads API
+The Valgrind distribution includes four tools: two memory error
+detectors, a thread error detector, and a cache profiler. Several other
+tools have been built with Valgrind.
%prep
--- valgrind/addrcheck/docs/ac_main.html #1.3:1.4
@@ -26,4 +26,6 @@
forever</li>
<li>Mismatched use of malloc/new/new [] vs free/delete/delete []</li>
+ <li>Overlapping <code>src</code> and <code>dst</code> pointers in
+ <code>memcpy()</code> and related functions</li>
<li>Some misuses of the POSIX pthreads API</li>
</ul>
|
|
From: Jeremy F. <je...@go...> - 2003-12-12 07:47:29
|
CVS commit by fitzhardinge:
Fix bug 69836: make record_fd_open ignore fds > VG_MAX_FD.
CCMAIL: 698...@bu...
M +2 -8 corecheck/tests/fdleak_cmsg.stderr.exp 1.2
M +1 -4 corecheck/tests/fdleak_creat.stderr.exp 1.2
M +1 -4 corecheck/tests/fdleak_dup.stderr.exp 1.2
M +1 -4 corecheck/tests/fdleak_dup2.stderr.exp 1.2
M +1 -4 corecheck/tests/fdleak_fcntl.stderr.exp 1.2
M +2 -8 corecheck/tests/fdleak_ipv4.stderr.exp 1.2
M +1 -4 corecheck/tests/fdleak_open.stderr.exp 1.2
M +1 -4 corecheck/tests/fdleak_pipe.stderr.exp 1.2
M +1 -4 corecheck/tests/fdleak_socketpair.stderr.exp 1.2
M +3 -0 coregrind/vg_syscalls.c 1.65
--- valgrind/corecheck/tests/fdleak_cmsg.stderr.exp #1.1:1.2
@@ -1,5 +1,5 @@
-FILE DESCRIPTORS: 8 open at exit.
+FILE DESCRIPTORS: 7 open at exit.
Open AF_UNIX socket .: /tmp/sock
at 0x........: __libc_accept (...libc...)
@@ -27,11 +27,8 @@
<inherited from parent>
-Open file descriptor .: .
- <inherited from parent>
-
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
-FILE DESCRIPTORS: 7 open at exit.
+FILE DESCRIPTORS: 6 open at exit.
Open file descriptor .: /tmp/data2
at 0x........: __libc_recvmsg (...libc...)
@@ -55,7 +52,4 @@
<inherited from parent>
-Open file descriptor .: .
- <inherited from parent>
-
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--- valgrind/corecheck/tests/fdleak_creat.stderr.exp #1.1:1.2
@@ -1,5 +1,5 @@
-FILE DESCRIPTORS: 5 open at exit.
+FILE DESCRIPTORS: 4 open at exit.
Open file descriptor .: /tmp/file
@@ -17,7 +17,4 @@
<inherited from parent>
-Open file descriptor .: .
- <inherited from parent>
-
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--- valgrind/corecheck/tests/fdleak_dup.stderr.exp #1.1:1.2
@@ -1,5 +1,5 @@
-FILE DESCRIPTORS: 6 open at exit.
+FILE DESCRIPTORS: 5 open at exit.
Open file descriptor .: /dev/null
at 0x........: __dup (in /...libc...)
@@ -21,7 +21,4 @@
<inherited from parent>
-Open file descriptor .: .
- <inherited from parent>
-
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--- valgrind/corecheck/tests/fdleak_dup2.stderr.exp #1.1:1.2
@@ -1,5 +1,5 @@
-FILE DESCRIPTORS: 7 open at exit.
+FILE DESCRIPTORS: 6 open at exit.
Open file descriptor .: /dev/null
at 0x........: __dup2 (in /...libc...)
@@ -26,7 +26,4 @@
<inherited from parent>
-Open file descriptor .: .
- <inherited from parent>
-
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--- valgrind/corecheck/tests/fdleak_fcntl.stderr.exp #1.1:1.2
@@ -1,5 +1,5 @@
-FILE DESCRIPTORS: 6 open at exit.
+FILE DESCRIPTORS: 5 open at exit.
Open file descriptor .: /dev/null
at 0x........: __libc_fcntl (...libc...)
@@ -20,7 +20,4 @@
<inherited from parent>
-Open file descriptor .: .
- <inherited from parent>
-
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--- valgrind/corecheck/tests/fdleak_ipv4.stderr.exp #1.1:1.2
@@ -1,5 +1,5 @@
-FILE DESCRIPTORS: 6 open at exit.
+FILE DESCRIPTORS: 5 open at exit.
Open AF_INET socket 4: 127.0.0.1:... <-> 127.0.0.1:...
at 0x........: __libc_accept (...libc...)
@@ -19,11 +19,8 @@
<inherited from parent>
-Open file descriptor .: .
- <inherited from parent>
-
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
-FILE DESCRIPTORS: 5 open at exit.
+FILE DESCRIPTORS: 4 open at exit.
Open AF_INET socket 3: 127.0.0.1:... <-> 127.0.0.1:...
at 0x........: __socket (in /...libc...)
@@ -39,7 +36,4 @@
<inherited from parent>
-Open file descriptor .: .
- <inherited from parent>
-
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--- valgrind/corecheck/tests/fdleak_open.stderr.exp #1.1:1.2
@@ -1,5 +1,5 @@
-FILE DESCRIPTORS: 5 open at exit.
+FILE DESCRIPTORS: 4 open at exit.
Open file descriptor .: /dev/null
at 0x........: __libc_open (...libc...)
@@ -16,7 +16,4 @@
<inherited from parent>
-Open file descriptor .: .
- <inherited from parent>
-
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--- valgrind/corecheck/tests/fdleak_pipe.stderr.exp #1.1:1.2
@@ -1,5 +1,5 @@
-FILE DESCRIPTORS: 6 open at exit.
+FILE DESCRIPTORS: 5 open at exit.
Open file descriptor .:
at 0x........: __pipe (in /...libc...)
@@ -21,7 +21,4 @@
<inherited from parent>
-Open file descriptor .: .
- <inherited from parent>
-
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--- valgrind/corecheck/tests/fdleak_socketpair.stderr.exp #1.1:1.2
@@ -1,5 +1,5 @@
-FILE DESCRIPTORS: 6 open at exit.
+FILE DESCRIPTORS: 5 open at exit.
Open AF_UNIX socket .: <unknown>
at 0x........: __socketpair (in /...libc...)
@@ -21,7 +21,4 @@
<inherited from parent>
-Open file descriptor .: .
- <inherited from parent>
-
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--- valgrind/coregrind/vg_syscalls.c #1.64:1.65
@@ -333,4 +333,7 @@ void record_fd_open(Int tid, Int fd, cha
OpenFd *i;
+ if (fd > VG_MAX_FD)
+ return; /* Valgrind internal */
+
/* Check to see if this fd is already open. */
i = allocated_fds;
|
|
From: Julian S. <js...@ac...> - 2003-12-13 03:08:14
|
CVS commit by jseward:
Un-break 'make distcheck' yet again. I guess someone somewhere understands
how autoconf/automake really work, but not me :-) What's the difference
between $(srcdir) and $(top_srcdir) (eg in coregrind/Makefile.am) ?
M +1 -1 corecheck/tests/Makefile.am 1.17
M +1 -1 corecheck/tests/vgprintf.c 1.2
M +1 -1 coregrind/Makefile.am 1.60
M +1 -1 coregrind/vg_startup.S 1.19
--- valgrind/corecheck/tests/Makefile.am #1.16:1.17
@@ -38,5 +38,5 @@
vgprintf
-AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g -O0
+AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g -O0 -I$(top_srcdir)/include
AM_CXXFLAGS = $(AM_CFLAGS)
--- valgrind/corecheck/tests/vgprintf.c #1.1:1.2
@@ -1,3 +1,3 @@
-#include <include/valgrind.h>
+#include "valgrind.h"
#include <stdio.h>
--- valgrind/coregrind/Makefile.am #1.59:1.60
@@ -7,5 +7,5 @@
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fno-omit-frame-pointer \
@PREFERRED_STACK_BOUNDARY@ -g -fpic
-AM_CCASFLAGS = $(add_includes)
+AM_CCASFLAGS = $(add_includes) -I..
valdir = $(libdir)/valgrind
--- valgrind/coregrind/vg_startup.S #1.18:1.19
@@ -31,5 +31,5 @@
#include "vg_constants.h"
-#include "../config.h"
+#include "config.h"
|
|
From: Julian S. <js...@ac...> - 2003-12-14 00:15:24
|
CVS commit by jseward:
Update for 2.1.0.
M +143 -2 NEWS 1.14
--- valgrind/NEWS #1.13:1.14
@@ -1,3 +1,143 @@
-Snapshot 2003XXXX (XX XXXX 2003)
+
+Unstable (cvs head) release 2.1.0 (15 December 2003)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+For whatever it's worth, 2.1.0 actually seems pretty darn stable to me
+(Julian). It looks eminently usable, and given that it fixes some
+significant bugs, may well be worth using on a day-to-day basis.
+2.1.0 is known to build and pass regression tests on: SuSE 9, SuSE
+8.2, RedHat 8.
+
+2.1.0 most notably includes Jeremy Fitzhardinge's complete overhaul of
+handling of system calls and signals, and their interaction with
+threads. In general, the accuracy of the system call, thread and
+signal simulations is much improved. Specifically:
+
+- Blocking system calls behave exactly as they do when running
+ natively (not on valgrind). That is, if a syscall blocks only the
+ calling thread when running natively, than it behaves the same on
+ valgrind. No more mysterious hangs because V doesn't know that some
+ syscall or other, should block only the calling thread.
+
+- Interrupted syscalls should now give more faithful results.
+
+- Finally, signal contexts in signal handlers are supported. As a
+ result, konqueror on SuSE 9 no longer segfaults when notified of
+ file changes in directories it is watching.
+
+Other changes:
+
+- Robert Walsh's file descriptor leakage checks. When enabled,
+ Valgrind will print out a list of open file descriptors on
+ exit. Along with each file descriptor, Valgrind prints out a stack
+ backtrace of where the file was opened and any details relating to the
+ file descriptor such as the file name or socket details.
+ To use, give: --track-fds=yes
+
+- Implemented a few more SSE/SSE2 instructions.
+
+- Less crud on the stack when you do 'where' inside a GDB attach.
+
+- Fixed the following bugs:
+ 68360: Valgrind does not compile against 2.6.0-testX kernels
+ 68525: CVS head doesn't compile on C90 compilers
+ 68566: pkgconfig support (wishlist)
+ 68588: Assertion `sz == 4' failed in vg_to_ucode.c (disInstr)
+ 69140: valgrind not able to explicitly specify a path to a binary.
+ 69432: helgrind asserts encountering a MutexErr when there are
+ EraserErr suppressions
+
+
+
+Stable release 2.0.0 (5 Nov 2003)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+2.0.0 improves SSE/SSE2 support, fixes some minor bugs, and
+improves support for SuSE 9 and the Red Hat "Severn" beta.
+
+- Further improvements to SSE/SSE2 support. The entire test suite of
+ the GNU Scientific Library (gsl-1.4) compiled with Intel Icc 7.1
+ 20030307Z '-g -O -xW' now works. I think this gives pretty good
+ coverage of SSE/SSE2 floating point instructions, or at least the
+ subset emitted by Icc.
+
+- Also added support for the following instructions:
+ MOVNTDQ UCOMISD UNPCKLPS UNPCKHPS SQRTSS
+ PUSH/POP %{FS,GS}, and PUSH %CS (Nb: there is no POP %CS).
+
+- CFI support for GDB version 6. Needed to enable newer GDBs
+ to figure out where they are when using --gdb-attach=yes.
+
+- Fix this:
+ mc_translate.c:1091 (memcheck_instrument): Assertion
+ `u_in->size == 4 || u_in->size == 16' failed.
+
+- Return an error rather than panicing when given a bad socketcall.
+
+- Fix checking of syscall rt_sigtimedwait().
+
+- Implement __NR_clock_gettime (syscall 265). Needed on Red Hat Severn.
+
+- Fixed bug in overlap check in strncpy() -- it was assuming the src was 'n'
+ bytes long, when it could be shorter, which could cause false
+ positives.
+
+- Support use of select() for very large numbers of file descriptors.
+
+- Don't fail silently if the executable is statically linked, or is
+ setuid/setgid. Print an error message instead.
+
+- Support for old DWARF-1 format line number info.
+
+
+
+Snapshot 20031012 (12 October 2003)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Three months worth of bug fixes, roughly. Most significant single
+change is improved SSE/SSE2 support, mostly thanks to Dirk Mueller.
+
+20031012 builds on Red Hat Fedora ("Severn") but doesn't really work
+(curiosly, mozilla runs OK, but a modest "ls -l" bombs). I hope to
+get a working version out soon. It may or may not work ok on the
+forthcoming SuSE 9; I hear positive noises about it but haven't been
+able to verify this myself (not until I get hold of a copy of 9).
+
+A detailed list of changes, in no particular order:
+
+- Describe --gen-suppressions in the FAQ.
+
+- Syscall __NR_waitpid supported.
+
+- Minor MMX bug fix.
+
+- -v prints program's argv[] at startup.
+
+- More glibc-2.3 suppressions.
+
+- Suppressions for stack underrun bug(s) in the c++ support library
+ distributed with Intel Icc 7.0.
+
+- Fix problems reading /proc/self/maps.
+
+- Fix a couple of messages that should have been suppressed by -q,
+ but weren't.
+
+- Make Addrcheck understand "Overlap" suppressions.
+
+- At startup, check if program is statically linked and bail out if so.
+
+- Cachegrind: Auto-detect Intel Pentium-M, also VIA Nehemiah
+
+- Memcheck/addrcheck: minor speed optimisations
+
+- Handle syscall __NR_brk more correctly than before.
+
+- Fixed incorrect allocate/free mismatch errors when using
+ operator new(unsigned, std::nothrow_t const&)
+ operator new[](unsigned, std::nothrow_t const&)
+
+- Support POSIX pthread spinlocks.
+
+- Fixups for clean compilation with gcc-3.3.1.
- Implemented more opcodes:
@@ -15,6 +155,7 @@
- all "in" and "out" opcodes
- inc/dec %esp
+ - A whole bunch of SSE/SSE2 instructions
-- Memcheck: Implemented handling of more SSE(2) constructs
+- Memcheck: don't bomb on SSE/SSE2 code.
|
|
From: Julian S. <js...@ac...> - 2003-12-14 00:16:05
|
CVS commit by jseward: ---> 2.1.0 M +1 -1 configure.in 1.101 M +1 -1 docs/manual.html 1.45 --- valgrind/configure.in #1.100:1.101 @@ -2,5 +2,5 @@ AC_INIT(coregrind/vg_main.c) # give me a source file, any source file... AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(valgrind, HEAD) +AM_INIT_AUTOMAKE(valgrind, 2.1.0) AM_MAINTAINER_MODE --- valgrind/docs/manual.html #1.44:1.45 @@ -26,5 +26,5 @@ <a name="title"> </a> -<h1 align=center>Valgrind, version 2.0.0</h1> +<h1 align=center>Valgrind, version 2.1.0</h1> <center>This manual was last updated on 3 April 2003</center> <p> |
|
From: Julian S. <js...@ac...> - 2003-12-14 14:35:57
|
CVS commit by jseward:
Comment re tc size increase.
M +5 -0 NEWS 1.15
--- valgrind/NEWS #1.14:1.15
@@ -47,4 +47,9 @@
EraserErr suppressions
+- Increase the max size of the translation cache from 200k average bbs
+ to 300k average bbs. Programs on the size of OOo (680m17) are
+ thrashing the cache at the smaller size, creating large numbers of
+ retranslations and wasting significant time as a result.
+
|
|
From: Jeremy F. <je...@go...> - 2003-12-15 09:01:02
|
CVS commit by fitzhardinge:
When merging multiple symbols with the same address, rather than always
choosing the longest symbol, choose the longest ignoring any of the libc
junk prefixes like __libc_, __, __GI_*, etc. This makes the symbol
presented to the user in messages and used in *.supp files more consistent
and comprehensible.
M +9 -9 glibc-2.1.supp 1.10
M +14 -14 glibc-2.2.supp 1.21
M +31 -8 glibc-2.3.supp 1.8
M +7 -7 corecheck/tests/fdleak_cmsg.stderr.exp 1.3
M +1 -1 corecheck/tests/fdleak_creat.stderr.exp 1.3
M +2 -2 corecheck/tests/fdleak_dup.stderr.exp 1.3
M +3 -3 corecheck/tests/fdleak_dup2.stderr.exp 1.3
M +2 -2 corecheck/tests/fdleak_fcntl.stderr.exp 1.3
M +3 -3 corecheck/tests/fdleak_ipv4.stderr.exp 1.3
M +1 -1 corecheck/tests/fdleak_open.stderr.exp 1.3
M +2 -2 corecheck/tests/fdleak_pipe.stderr.exp 1.3
M +2 -2 corecheck/tests/fdleak_socketpair.stderr.exp 1.3
M +41 -6 coregrind/vg_symtab2.c 1.63
M +2 -2 helgrind/tests/deadlock.stderr.exp 1.5
M +1 -1 memcheck/tests/fwrite.stderr.exp 1.9
M +1 -1 memcheck/tests/weirdioctl.stderr.exp 1.8
M +3 -3 memcheck/tests/writev.stderr.exp 1.5
--- valgrind/glibc-2.1.supp #1.9:1.10
@@ -38,15 +38,15 @@
{
- __pthread_mutex_unlock/__register_frame_info_bases
+ pthread_mutex_unlock/__register_frame_info_bases
core:PThread
- fun:__pthread_mutex_unlock
+ fun:pthread_mutex_unlock
fun:__register_frame_info_bases
}
{
- socketcall.connect(serv_addr)/__libc_connect/*(Param)
+ socketcall.connect(serv_addr)/connect/*(Param)
Addrcheck,Memcheck:Param
socketcall.connect(serv_addr)
- fun:__libc_connect
+ fun:connect
fun:*
}
@@ -69,8 +69,8 @@
{
- llseek(result)/__libc_lseek64/_IO_file_seek(Param)
+ llseek(result)/lseek64/_IO_file_seek(Param)
Addrcheck,Memcheck:Param
llseek(result)
- fun:__libc_lseek64
+ fun:lseek64
fun:_IO_file_seek
}
@@ -165,5 +165,5 @@
{
- socketcall.connect(serv_addr)/__libc_connect/*(Param)
+ socketcall.connect(serv_addr)/connect/*(Param)
Addrcheck,Memcheck:Param
socketcall.connect(serv_addr)
@@ -175,9 +175,9 @@
## For a leak in Valgrind's own libpthread.so :(
{
- my_malloc/get_or_allocate_specifics_ptr/__pthread_key_create(Leak)
+ my_malloc/get_or_allocate_specifics_ptr/pthread_key_create(Leak)
Memcheck:Leak
fun:my_malloc
fun:get_or_allocate_specifics_ptr
- fun:__pthread_key_create
+ fun:pthread_key_create
}
--- valgrind/glibc-2.2.supp #1.20:1.21
@@ -174,23 +174,23 @@
# glibc 'knows' that destroying a locked mutex will unlock it
{
- pthread_error/__pthread_mutex_destroy/__closedir
+ pthread_error/pthread_mutex_destroy/__closedir
core:PThread
fun:pthread_error
- fun:__pthread_mutex_destroy
+ fun:pthread_mutex_destroy
fun:__closedir
}
{
- pthread_error/__pthread_mutex_destroy/_IO_default_finish
+ pthread_error/pthread_mutex_destroy/_IO_default_finish
core:PThread
fun:pthread_error
- fun:__pthread_mutex_destroy
+ fun:pthread_mutex_destroy
fun:_IO_default_finish*
}
{
- __pthread_mutex_unlock/_IO_funlockfile
+ pthread_mutex_unlock/_IO_funlockfile
core:PThread
- fun:__pthread_mutex_unlock
+ fun:pthread_mutex_unlock
fun:_IO_funlockfile
}
@@ -346,8 +346,8 @@
#-------------------
{
- socketcall.connect(serv_addr)/__libc_connect/*
+ socketcall.connect(serv_addr)/connect/*
Addrcheck,Memcheck:Param
socketcall.connect(serv_addr)
- fun:__libc_connect
+ fun:connect
fun:*
}
@@ -362,8 +362,8 @@
#----------------------
{
- write(buf)/__libc_write/libX11.so.6.2/libX11.so.6.2(Param)
+ write(buf)/write/libX11.so.6.2/libX11.so.6.2(Param)
Addrcheck,Memcheck:Param
write(buf)
- fun:__libc_write
+ fun:write
obj:/usr/X11R6/lib/libX11.so.6.2
obj:/usr/X11R6/lib/libX11.so.6.2
@@ -379,8 +379,8 @@
#{
-# llseek(result)/__libc_lseek64/_IO_file_seek(Param)
+# llseek(result)/lseek64/_IO_file_seek(Param)
# Param
# llseek(result)
-# fun:__libc_lseek64
+# fun:lseek64
# fun:_IO_file_seek
#}
@@ -414,9 +414,9 @@
## For a leak in Valgrind's own libpthread.so :(
{
- my_malloc/get_or_allocate_specifics_ptr/__pthread_key_create(Leak)
+ my_malloc/get_or_allocate_specifics_ptr/pthread_key_create(Leak)
Memcheck:Leak
fun:my_malloc
fun:get_or_allocate_specifics_ptr
- fun:__pthread_key_create
+ fun:pthread_key_create
}
--- valgrind/glibc-2.3.supp #1.7:1.8
@@ -107,27 +107,50 @@
}
+#-------- glibc 2.3.2/ Fedora Core 1
+{
+ dl_relocate/dl_main
+ Memcheck:Cond
+ fun:_dl_relocate_object_internal
+ fun:dl_main
+}
+
+#-------- Data races
+{
+ _dl_lookup_symbol_internal/fixup/_dl_runtime_resolve
+ Helgrind:Eraser
+ fun:_dl_lookup_symbol_internal
+ fun:fixup
+ fun:_dl_runtime_resolve
+}
+{
+ _dl_lookup_versioned_symbol_internal/fixup/_dl_runtime_resolve
+ Helgrind:Eraser
+ fun:_dl_lookup_versioned_symbol_internal
+ fun:fixup
+ fun:_dl_runtime_resolve
+}
#-------- Threading bugs?
# glibc 'knows' that destroying a locked mutex will unlock it
{
- pthread_error/__pthread_mutex_destroy/__closedir
+ pthread_error/pthread_mutex_destroy/__closedir
core:PThread
fun:pthread_error
- fun:__pthread_mutex_destroy
+ fun:pthread_mutex_destroy
fun:__closedir
}
{
- pthread_error/__pthread_mutex_destroy/_IO_default_finish
+ pthread_error/pthread_mutex_destroy/_IO_default_finish
core:PThread
fun:pthread_error
- fun:__pthread_mutex_destroy
+ fun:pthread_mutex_destroy
fun:_IO_default_finish*
}
{
- __pthread_mutex_unlock/_IO_funlockfile
+ pthread_mutex_unlock/_IO_funlockfile
core:PThread
- fun:__pthread_mutex_unlock
+ fun:pthread_mutex_unlock
fun:_IO_funlockfile
}
@@ -136,9 +159,9 @@
## For a leak in Valgrind's own libpthread.so :(
{
- my_malloc/get_or_allocate_specifics_ptr/__pthread_key_create(Leak)
+ my_malloc/get_or_allocate_specifics_ptr/pthread_key_create(Leak)
Memcheck:Leak
fun:my_malloc
fun:get_or_allocate_specifics_ptr
- fun:__pthread_key_create
+ fun:pthread_key_create
}
--- valgrind/corecheck/tests/fdleak_cmsg.stderr.exp #1.2:1.3
@@ -3,17 +3,17 @@
FILE DESCRIPTORS: 7 open at exit.
Open AF_UNIX socket .: /tmp/sock
- at 0x........: __libc_accept (...libc...)
+ at 0x........: accept (in /...libc...)
by 0x........: main (fdleak_cmsg.c:170)
Open AF_UNIX socket .: /tmp/sock
- at 0x........: __socket (in /...libc...)
+ at 0x........: socket (in /...libc...)
by 0x........: main (fdleak_cmsg.c:170)
Open file descriptor .: /tmp/data2
- at 0x........: __libc_open (...libc...)
+ at 0x........: open (in /...libc...)
by 0x........: main (fdleak_cmsg.c:170)
Open file descriptor .: /tmp/data1
- at 0x........: __libc_open (...libc...)
+ at 0x........: open (in /...libc...)
by 0x........: main (fdleak_cmsg.c:170)
@@ -32,13 +32,13 @@
FILE DESCRIPTORS: 6 open at exit.
Open file descriptor .: /tmp/data2
- at 0x........: __libc_recvmsg (...libc...)
+ at 0x........: recvmsg (in /...libc...)
by 0x........: main (fdleak_cmsg.c:174)
Open file descriptor .: /tmp/data1
- at 0x........: __libc_recvmsg (...libc...)
+ at 0x........: recvmsg (in /...libc...)
by 0x........: main (fdleak_cmsg.c:174)
Open AF_UNIX socket .: <unknown>
- at 0x........: __socket (in /...libc...)
+ at 0x........: socket (in /...libc...)
by 0x........: main (fdleak_cmsg.c:174)
--- valgrind/corecheck/tests/fdleak_creat.stderr.exp #1.2:1.3
@@ -4,5 +4,5 @@
Open file descriptor .: /tmp/file
- at 0x........: __libc_creat (...libc...)
+ at 0x........: creat (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
--- valgrind/corecheck/tests/fdleak_dup.stderr.exp #1.2:1.3
@@ -3,10 +3,10 @@
FILE DESCRIPTORS: 5 open at exit.
Open file descriptor .: /dev/null
- at 0x........: __dup (in /...libc...)
+ at 0x........: dup (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Open file descriptor .: /dev/null
- at 0x........: __libc_open (...libc...)
+ at 0x........: open (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
--- valgrind/corecheck/tests/fdleak_dup2.stderr.exp #1.2:1.3
@@ -3,15 +3,15 @@
FILE DESCRIPTORS: 6 open at exit.
Open file descriptor .: /dev/null
- at 0x........: __dup2 (in /...libc...)
+ at 0x........: dup2 (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Open file descriptor .: /dev/null
- at 0x........: __dup2 (in /...libc...)
+ at 0x........: dup2 (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Open file descriptor .: /dev/null
- at 0x........: __libc_open (...libc...)
+ at 0x........: open (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
--- valgrind/corecheck/tests/fdleak_fcntl.stderr.exp #1.2:1.3
@@ -3,9 +3,9 @@
FILE DESCRIPTORS: 5 open at exit.
Open file descriptor .: /dev/null
- at 0x........: __libc_fcntl (...libc...)
+ at 0x........: fcntl (in /...libc...)
by 0x........: main (fdleak_fcntl.c:18)
Open file descriptor .: /dev/null
- at 0x........: __libc_open (...libc...)
+ at 0x........: open (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
--- valgrind/corecheck/tests/fdleak_ipv4.stderr.exp #1.2:1.3
@@ -3,9 +3,9 @@
FILE DESCRIPTORS: 5 open at exit.
Open AF_INET socket 4: 127.0.0.1:... <-> 127.0.0.1:...
- at 0x........: __libc_accept (...libc...)
+ at 0x........: accept (in /...libc...)
by 0x........: main (fdleak_ipv4.c:100)
Open AF_INET socket 3: 127.0.0.1:... <-> unbound
- at 0x........: __socket (in /...libc...)
+ at 0x........: socket (in /...libc...)
by 0x........: main (fdleak_ipv4.c:100)
@@ -24,5 +24,5 @@
FILE DESCRIPTORS: 4 open at exit.
Open AF_INET socket 3: 127.0.0.1:... <-> 127.0.0.1:...
- at 0x........: __socket (in /...libc...)
+ at 0x........: socket (in /...libc...)
by 0x........: main (fdleak_ipv4.c:104)
--- valgrind/corecheck/tests/fdleak_open.stderr.exp #1.2:1.3
@@ -3,5 +3,5 @@
FILE DESCRIPTORS: 4 open at exit.
Open file descriptor .: /dev/null
- at 0x........: __libc_open (...libc...)
+ at 0x........: open (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
--- valgrind/corecheck/tests/fdleak_pipe.stderr.exp #1.2:1.3
@@ -3,10 +3,10 @@
FILE DESCRIPTORS: 5 open at exit.
Open file descriptor .:
- at 0x........: __pipe (in /...libc...)
+ at 0x........: pipe (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Open file descriptor .:
- at 0x........: __pipe (in /...libc...)
+ at 0x........: pipe (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
--- valgrind/corecheck/tests/fdleak_socketpair.stderr.exp #1.2:1.3
@@ -3,10 +3,10 @@
FILE DESCRIPTORS: 5 open at exit.
Open AF_UNIX socket .: <unknown>
- at 0x........: __socketpair (in /...libc...)
+ at 0x........: socketpair (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Open AF_UNIX socket .: <unknown>
- at 0x........: __socketpair (in /...libc...)
+ at 0x........: socketpair (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
--- valgrind/coregrind/vg_symtab2.c #1.62:1.63
@@ -399,4 +399,44 @@ static Int compare_RiSym(void *va, void
}
+/* Two symbols have the same address. Which name do we prefer?
+
+ In general we prefer the longer name, but if the choice is between
+ __libc_X and X, then choose X (similarly with __GI__ and __
+ prefixes).
+ */
+static RiSym *prefersym(RiSym *a, RiSym *b)
+{
+ Int pfx;
+
+ /* rearrange so that a is the long one */
+ if (VG_(strlen)(a->name) < VG_(strlen)(b->name)) {
+ RiSym *t;
+
+ t = a;
+ a = b;
+ b = t;
+ }
+
+ pfx = 0;
+
+ if (VG_(memcmp)(a->name, "__GI___libc_", 12) == 0)
+ pfx = 12;
+ else if (VG_(memcmp)(a->name, "__libc_", 7) == 0)
+ pfx = 7;
+ else if (VG_(memcmp)(a->name, "__GI___", 7) == 0)
+ pfx = 7;
+ else if (VG_(memcmp)(a->name, "__GI__", 6) == 0)
+ pfx = 6;
+ else if (VG_(memcmp)(a->name, "__GI_", 5) == 0)
+ pfx = 5;
+ else if (VG_(memcmp)(a->name, "__", 2) == 0)
+ pfx = 2;
+
+ if (pfx != 0 && VG_(strcmp)(a->name + pfx, b->name) == 0)
+ return b;
+
+ return a;
+}
+
static
void canonicaliseSymtab ( SegInfo* si )
@@ -428,10 +468,5 @@ void canonicaliseSymtab ( SegInfo* si )
n_merged++;
/* merge the two into one */
- if (VG_(strlen)(si->symtab[i].name)
- > VG_(strlen)(si->symtab[i+1].name)) {
- si->symtab[si->symtab_used++] = si->symtab[i];
- } else {
- si->symtab[si->symtab_used++] = si->symtab[i+1];
- }
+ si->symtab[si->symtab_used++] = *prefersym(&si->symtab[i], &si->symtab[i+1]);
i++;
} else {
--- valgrind/helgrind/tests/deadlock.stderr.exp #1.4:1.5
@@ -2,5 +2,5 @@
Thread 3:
Mutex 0x........(m1) locked in inconsistent order
- at 0x........: __pthread_mutex_lock (vg_libpthread.c:...)
+ at 0x........: pthread_mutex_lock (vg_libpthread.c:...)
by 0x........: t2 (deadlock.c:20)
by 0x........: thread_wrapper (vg_libpthread.c:...)
@@ -8,5 +8,5 @@
while holding locks 0x........(m2)
0x........(m2) last locked at
- at 0x........: __pthread_mutex_lock (vg_libpthread.c:...)
+ at 0x........: pthread_mutex_lock (vg_libpthread.c:...)
by 0x........: t2 (deadlock.c:19)
by 0x........: thread_wrapper (vg_libpthread.c:...)
--- valgrind/memcheck/tests/fwrite.stderr.exp #1.8:1.9
@@ -1,4 +1,4 @@
Syscall param write(buf) contains uninitialised or unaddressable byte(s)
- at 0x........: __libc_write (...libc...)
+ at 0x........: write (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
--- valgrind/memcheck/tests/weirdioctl.stderr.exp #1.7:1.8
@@ -1,4 +1,4 @@
Syscall param ioctl(TCSET{A,AW,AF}) contains uninitialised or unaddressable byte(s)
- at 0x........: __ioctl (in /...libc...)
+ at 0x........: ioctl (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
--- valgrind/memcheck/tests/writev.stderr.exp #1.4:1.5
@@ -2,5 +2,5 @@
Test file created.
Syscall param writev(vector[...]) contains uninitialised or unaddressable byte(s)
- at 0x........: __libc_writev (...libc...)
+ at 0x........: writev (in /...libc...)
by 0x........: main (writev.c:56)
Address 0x........ is not stack'd, malloc'd or free'd
@@ -8,5 +8,5 @@
Syscall param writev(vector) contains uninitialised or unaddressable byte(s)
- at 0x........: __libc_writev (...libc...)
+ at 0x........: writev (in /...libc...)
by 0x........: main (writev.c:68)
Address 0x........ is not stack'd, malloc'd or free'd
@@ -14,5 +14,5 @@
Syscall param readv(vector) contains uninitialised or unaddressable byte(s)
- at 0x........: __libc_readv (...libc...)
+ at 0x........: readv (in /...libc...)
by 0x........: main (writev.c:76)
Address 0x........ is not stack'd, malloc'd or free'd
|
|
From: Jeremy F. <je...@go...> - 2003-12-16 02:16:37
|
CVS commit by fitzhardinge: Back out unintended change M +2 -2 autogen.sh 1.3 --- valgrind/autogen.sh #1.2:1.3 @@ -12,6 +12,6 @@ } -run aclocal-1.6 +run aclocal run autoheader -run automake-1.6 -a +run automake -a run autoconf |
|
From: Dirk M. <mu...@kd...> - 2003-12-17 13:37:29
|
CVS commit by mueller: ignore M +1 -0 .cvsignore 1.6 M +3 -1 coregrind/.cvsignore 1.3 M +1 -0 coregrind/x86/.cvsignore 1.2 M +1 -0 include/.cvsignore 1.2 --- valgrind/.cvsignore #1.5:1.6 @@ -19,2 +19,3 @@ autom4te.cache valgrind.pc +.in_place --- valgrind/coregrind/.cvsignore #1.2:1.3 @@ -2,3 +2,5 @@ Makefile valgrind -.in_place +stage2 +vg_toolint.h +vg_toolint.c --- valgrind/coregrind/x86/.cvsignore #1.1:1.2 @@ -1,2 +1,3 @@ Makefile.in Makefile +stage2.lds --- valgrind/include/.cvsignore #1.1:1.2 @@ -1,2 +1,3 @@ Makefile.in Makefile +vg_skin.h |
|
From: Jeremy F. <je...@go...> - 2003-12-18 02:12:23
|
CVS commit by fitzhardinge:
An experiment in generating branch-prediction hints. Enable them with
--branchpred=yes. I'm interested to know if these make a significant
difference for anyone - I see a small speed increase on the Pentium M.
M +55 -19 coregrind/vg_from_ucode.c 1.68
M +2 -0 coregrind/vg_include.h 1.160
M +7 -0 coregrind/vg_main.c 1.130
M +8 -2 include/vg_skin.h.base 1.2
M +10 -2 memcheck/mc_from_ucode.c 1.14
--- valgrind/coregrind/vg_from_ucode.c #1.67:1.68
@@ -81,4 +81,24 @@ static enum _eflags_state {
} eflags_state;
+/* ia32 static prediction is very simple. Other implementations are
+ more complex, so we get the condition anyway. */
+static JumpPred static_pred(Condcode cond, Int forward)
+{
+ if (cond == CondAlways)
+ return JP_TAKEN;
+
+ return forward ? JP_NOT_TAKEN : JP_TAKEN;
+}
+
+static const Char *predstr(JumpPred p)
+{
+ switch(p) {
+ default:
+ case JP_NONE: return "";
+ case JP_TAKEN: return ",pt";
+ case JP_NOT_TAKEN: return ",pn";
+ }
+}
+
/* single site for resetting state */
static void reset_state(void)
@@ -1938,6 +1958,7 @@ static inline Int tgt_addr(Int tgt)
static inline Int mk_tgt(Int state, Int addr)
{
- vg_assert(state == TGT_UNDEF
- || state == TGT_FORWARD || state == TGT_BACKWARD);
+ vg_assert(state == TGT_UNDEF ||
+ state == TGT_FORWARD ||
+ state == TGT_BACKWARD);
vg_assert((addr & 0xffff0000) == 0);
@@ -1998,24 +2019,36 @@ void VG_(emit_target_delta) ( Int *tgt )
offset is that which should be added to %eip once %eip has been
advanced over this insn. */
-void VG_(emit_jcondshort_delta) ( Bool simd_flags, Condcode cond, Int delta )
+void VG_(emit_jcondshort_delta) ( Bool simd_flags, Condcode cond, Int delta, JumpPred pred )
{
vg_assert(delta >= -128 && delta <= 127);
VG_(new_emit)(simd_flags, FlagsOSZCP, FlagsEmpty);
+
+ if (VG_(clo_branchpred) &&
+ pred != JP_NONE &&
+ pred != static_pred(cond, delta > 0))
+ VG_(emitB)(pred == JP_TAKEN ? 0x3e : 0x2e);
+
VG_(emitB) ( 0x70 + (UInt)cond );
VG_(emitB) ( (UChar)delta );
if (dis)
- VG_(printf)( "\n\t\tj%s-8\t%%eip+%d\n",
- VG_(name_UCondcode)(cond), delta );
+ VG_(printf)( "\n\t\tj%s-8%s\t%%eip+%d\n",
+ VG_(name_UCondcode)(cond), predstr(pred), delta );
}
/* Same as above, but defers emitting the delta */
-void VG_(emit_jcondshort_target) ( Bool simd, Condcode cond, Int *tgt )
+void VG_(emit_jcondshort_target) ( Bool simd, Condcode cond, Int *tgt, JumpPred pred )
{
VG_(new_emit)(simd, FlagsOSZCP, FlagsEmpty);
+
+ if (VG_(clo_branchpred) &&
+ pred != JP_NONE &&
+ pred != static_pred(cond, tgt_state(*tgt) != TGT_BACKWARD))
+ VG_(emitB)(pred == JP_TAKEN ? 0x3e : 0x2e);
+
VG_(emitB) ( 0x70 + (UInt)cond );
VG_(emit_target_delta) (tgt);
if (dis)
- VG_(printf)( "\n\t\tj%s-8\t%%eip+(%d)\n",
- VG_(name_UCondcode)(cond), tgt_addr(*tgt) );
+ VG_(printf)( "\n\t\tj%s-8%s\t%%eip+(%d)\n",
+ VG_(name_UCondcode)(cond), predstr(pred), tgt_addr(*tgt) );
}
@@ -2615,10 +2648,10 @@ static void synth_jcond_lit ( Condcode c
if (cond == CondLE) {
/* test Z */
- VG_(emit_jcondshort_target)(False, CondS, &tgt_jump);
+ VG_(emit_jcondshort_target)(False, CondS, &tgt_jump, JP_NONE);
/* test OF != SF */
cond = CondP;
} else {
/* test Z */
- VG_(emit_jcondshort_target)(False, CondS, &tgt2);
+ VG_(emit_jcondshort_target)(False, CondS, &tgt2, JP_NONE);
/* test OF == SF */
cond = CondNP;
@@ -2702,5 +2735,5 @@ static void synth_jcond_lit ( Condcode c
}
- VG_(emit_jcondshort_target) ( simd, cond, &tgt );
+ VG_(emit_jcondshort_target) ( simd, cond, &tgt, JP_NONE );
VG_(target_forward)(&tgt_jump);
@@ -2721,5 +2754,5 @@ static void synth_jmp_ifzero_reg_lit ( I
VG_(emit_cmpl_zero_reg) ( False, reg );
- VG_(emit_jcondshort_target) ( False, CondNZ, &tgt );
+ VG_(emit_jcondshort_target) ( False, CondNZ, &tgt, JP_NONE );
synth_jmp_lit ( addr, JmpBoring );
@@ -3235,5 +3268,5 @@ static void synth_cmovl_reg_reg ( Condco
VG_(init_target)(&tgt);
- VG_(emit_jcondshort_target) ( True, invertCondition(cond), &tgt);
+ VG_(emit_jcondshort_target) ( True, invertCondition(cond), &tgt, JP_NONE);
emit_movl_reg_reg ( src, dst );
@@ -4287,14 +4320,17 @@ UChar* VG_(emit_code) ( UCodeBlock* cb,
if (dis) VG_(printf)("Generated x86 code:\n");
- /* Generate decl VG_(dispatch_ctr) and drop into dispatch if we hit
+ /* Generate subl $1, VG_(dispatch_ctr) and drop into dispatch if we hit
zero. We have to do this regardless of whether we're t-chaining
- or not. */
+ or not. (The ia32 optimisation guide recommends sub over dec.) */
VG_(init_target)(&tgt);
VG_(new_emit)(False, FlagsEmpty, FlagsOSZAP);
- VG_(emitB) (0xFF); /* decl */
- emit_amode_litmem_reg((Addr)&VG_(dispatch_ctr), 1);
+ VG_(emitB) (0x83); /* subl */
+ emit_amode_litmem_reg((Addr)&VG_(dispatch_ctr), 5);
+ VG_(emitB) (0x01);
+
if (dis)
- VG_(printf)("\n\t\tdecl (%p)\n", &VG_(dispatch_ctr));
- VG_(emit_jcondshort_target)(False, CondNZ, &tgt);
+ VG_(printf)("\n\t\tsubl $1, (%p)\n", &VG_(dispatch_ctr));
+
+ VG_(emit_jcondshort_target)(False, CondNZ, &tgt, JP_TAKEN);
VG_(emit_movv_lit_reg) ( 4, VG_TRC_INNER_COUNTERZERO, R_EBP );
emit_ret();
--- valgrind/coregrind/vg_include.h #1.159:1.160
@@ -271,4 +271,6 @@ extern Bool VG_(clo_run_libc_freeres);
/* Use the basic-block chaining optimisation? Default: YES */
extern Bool VG_(clo_chain_bb);
+/* Generate branch-prediction hints? */
+extern Bool VG_(clo_branchpred);
/* Continue stack traces below main()? Default: NO */
extern Bool VG_(clo_show_below_main);
--- valgrind/coregrind/vg_main.c #1.129:1.130
@@ -587,4 +587,5 @@ Bool VG_(clo_chain_bb) = True;
Bool VG_(clo_show_below_main) = False;
Bool VG_(clo_pointercheck) = True;
+Bool VG_(clo_branchpred) = False;
static Bool VG_(clo_wait_for_gdb) = False;
@@ -693,4 +694,5 @@ void VG_(usage) ( void )
" --profile=no|yes profile? (tool must be built for it) [no]\n"
" --chain-bb=no|yes do basic-block chaining? [yes]\n"
+" --branchpred=yes|no generate branch prediction hints [no]\n"
" --trace-codegen=<XXXXX> show generated code? (X = 0|1) [00000]\n"
" --trace-syscalls=no|yes show all system calls? [no]\n"
@@ -897,4 +899,9 @@ static void process_cmd_line_options ( c
VG_(clo_chain_bb) = False;
+ else if (VG_CLO_STREQ(argv[i], "--branchpred=yes"))
+ VG_(clo_branchpred) = True;
+ else if (VG_CLO_STREQ(argv[i], "--branchpred=no"))
+ VG_(clo_branchpred) = False;
+
else if (VG_CLO_STREQ(argv[i], "--single-step=yes"))
VG_(clo_single_step) = True;
--- valgrind/include/vg_skin.h.base #1.1:1.2
@@ -1316,6 +1316,12 @@
extern void VG_(emit_target_delta) ( Int *tgt );
-extern void VG_(emit_jcondshort_delta) ( Bool simd_cc, Condcode cond, Int delta );
-extern void VG_(emit_jcondshort_target)( Bool simd_cc, Condcode cond, Int *tgt );
+typedef enum {
+ JP_NONE, /* no prediction */
+ JP_TAKEN, /* predict taken */
+ JP_NOT_TAKEN, /* predict not taken */
+} JumpPred;
+
+extern void VG_(emit_jcondshort_delta) ( Bool simd_cc, Condcode cond, Int delta, JumpPred );
+extern void VG_(emit_jcondshort_target)( Bool simd_cc, Condcode cond, Int *tgt, JumpPred );
--- valgrind/memcheck/mc_from_ucode.c #1.13:1.14
@@ -167,4 +167,6 @@ static void synth_SETV ( Int sz, Int reg
static void synth_TESTV ( Int sz, Int tag, Int val )
{
+ Int tgt; /* jump target */
+
/* Important note. Note that that the calls to
MC_(helper_value_check[0124]_fail) must be compact helpers due to
@@ -174,4 +176,6 @@ static void synth_TESTV ( Int sz, Int ta
sk_assert(sz == 0 || sz == 2 || sz == 4);
+ VG_(init_target)(&tgt);
+
sk_assert(tag == ArchReg || tag == RealReg);
if (tag == ArchReg) {
@@ -223,7 +227,10 @@ static void synth_TESTV ( Int sz, Int ta
}
}
- VG_(emit_jcondshort_delta) ( False, CondZ, 3 );
+
+ /* predict taken because we assume failures are rare */
+ VG_(emit_jcondshort_target) ( False, CondZ, &tgt, JP_TAKEN );
+
VG_(synth_call) (
- True, /* needed to guarantee that this insn is indeed 3 bytes long */
+ False,
( sz==4
? VG_(helper_offset)((Addr) & MC_(helper_value_check4_fail))
@@ -235,4 +242,5 @@ static void synth_TESTV ( Int sz, Int ta
False, FlagsEmpty, FlagsOSZACP /* helpers don't preserve flags */
);
+ VG_(target_forward)(&tgt);
}
|
|
From: Jeremy F. <je...@go...> - 2003-12-18 02:39:53
|
CVS commit by fitzhardinge:
Patch from Tom Hughes: set VG_(max_fd) based on the current file
descriptor limit rather than assuming 1024.
M +6 -8 coregrind/vg_include.h 1.161
M +24 -1 coregrind/vg_main.c 1.131
M +13 -2 coregrind/vg_mylibc.c 1.61
M +4 -4 coregrind/vg_syscalls.c 1.70
M +3 -0 include/vg_skin.h.base 1.3
--- valgrind/coregrind/vg_include.h #1.160:1.161
@@ -109,12 +109,7 @@
#define VG_SCHEDULING_QUANTUM 50000
-/* Maximum FD Valgrind can use for its internal file descriptors. */
-#define VG_MAX_SAFE_FD 1024 /* usual ulimit */
-
-/* Maximum allowed application-visible file descriptor. Valgrind's
- internal fds hide above this (starting at VG_MAX_FD+1). This is
- derived from the default fd limit (1024) minus the 2 fds per thread
- and a small number of extra fds. */
-#define VG_MAX_FD (VG_MAX_SAFE_FD - (VG_N_THREADS*2 + 4))
+/* Number of file descriptors that Valgrind tries to reserve for
+ it's own use - two per thread plues a small number of extras. */
+#define VG_N_RESERVED_FDS (VG_N_THREADS*2 + 4)
/* Stack size for a thread. We try and check that they do not go
@@ -183,4 +178,7 @@ extern Int VG_(main_pid);
extern Int VG_(main_pgrp);
+/* Maximum allowed application-visible file descriptor */
+extern Int VG_(max_fd);
+
/* Should we stop collecting errors if too many appear? default: YES */
extern Bool VG_(clo_error_limit);
--- valgrind/coregrind/vg_main.c #1.130:1.131
@@ -154,4 +154,7 @@ Int VG_(main_pid);
Int VG_(main_pgrp);
+/* Maximum allowed application-visible file descriptor */
+Int VG_(max_fd);
+
/* Words. */
static Int baB_off = 0;
@@ -1110,5 +1113,5 @@ static void process_cmd_line_options ( c
/* Move logfile_fd into the safe range, so it doesn't conflict with any app fds */
- eventually_logfile_fd = VG_(fcntl)(VG_(clo_logfile_fd), VKI_F_DUPFD, VG_MAX_FD+1);
+ eventually_logfile_fd = VG_(fcntl)(VG_(clo_logfile_fd), VKI_F_DUPFD, VG_(max_fd)+1);
if (eventually_logfile_fd < 0)
VG_(message)(Vg_UserMsg, "valgrind: failed to move logfile fd into safe range");
@@ -1365,4 +1368,5 @@ void VG_(main) ( const KickstartParams *
{
VgSchedReturnCode src;
+ struct vki_rlimit rl;
/* initial state */
@@ -1415,4 +1419,23 @@ void VG_(main) ( const KickstartParams *
newpid(VG_INVALID_THREADID);
+ /* Get the current file descriptor limits. */
+ if (VG_(getrlimit)(VKI_RLIMIT_NOFILE, &rl) < 0) {
+ rl.rlim_cur = 1024;
+ rl.rlim_max = 1024;
+ }
+
+ /* Work out where to move the soft limit to. */
+ if (rl.rlim_cur + VG_N_RESERVED_FDS <= rl.rlim_max) {
+ rl.rlim_cur = rl.rlim_cur + VG_N_RESERVED_FDS;
+ } else {
+ rl.rlim_cur = rl.rlim_max;
+ }
+
+ /* Reserve some file descriptors for our use. */
+ VG_(max_fd) = rl.rlim_cur - VG_N_RESERVED_FDS;
+
+ /* Update the soft limit. */
+ VG_(setrlimit)(VKI_RLIMIT_NOFILE, &rl);
+
/* Read /proc/self/maps into a buffer. Must be before:
- SK_(pre_clo_init)(): so that if it calls VG_(malloc)(), any mmap'd
--- valgrind/coregrind/vg_mylibc.c #1.60:1.61
@@ -1204,5 +1204,5 @@ Int VG_(safe_fd)(Int oldfd)
Int newfd;
- newfd = VG_(fcntl)(oldfd, VKI_F_DUPFD, VG_MAX_FD+1);
+ newfd = VG_(fcntl)(oldfd, VKI_F_DUPFD, VG_(max_fd)+1);
if (newfd != -1)
VG_(close)(oldfd);
@@ -1210,5 +1210,5 @@ Int VG_(safe_fd)(Int oldfd)
VG_(fcntl)(newfd, VKI_F_SETFD, VKI_FD_CLOEXEC);
- vg_assert(newfd > VG_MAX_FD);
+ vg_assert(newfd > VG_(max_fd));
return newfd;
}
@@ -1430,4 +1430,15 @@ Int VG_(getrlimit) (Int resource, struct
+/* Support for setrlimit. */
+Int VG_(setrlimit) (Int resource, struct vki_rlimit *rlim)
+{
+ Int res;
+ /* res = setrlimit( resource, rlim ); */
+ res = VG_(do_syscall)(__NR_setrlimit, (UInt)resource, (UInt)rlim);
+ if(VG_(is_kerror)(res)) res = -1;
+ return res;
+}
+
+
/* Support for getdents. */
Int VG_(getdents) (UInt fd, struct vki_dirent *dirp, UInt count)
--- valgrind/coregrind/vg_syscalls.c #1.69:1.70
@@ -312,5 +312,5 @@ void record_fd_close(Int tid, Int fd)
OpenFd *i = allocated_fds;
- if (fd > VG_MAX_FD)
+ if (fd > VG_(max_fd))
return; /* Valgrind internal */
@@ -345,5 +345,5 @@ void record_fd_open(Int tid, Int fd, cha
OpenFd *i;
- if (fd > VG_MAX_FD)
+ if (fd > VG_(max_fd))
return; /* Valgrind internal */
@@ -890,5 +890,5 @@ static Bool valid_client_addr(Addr start
static Bool fd_allowed(Int fd, const Char *syscall, ThreadId tid)
{
- if (fd < 0 || fd > VG_MAX_FD || fd == VG_(clo_logfile_fd)) {
+ if (fd < 0 || fd > VG_(max_fd) || fd == VG_(clo_logfile_fd)) {
VG_(message)(Vg_UserMsg,
"Warning: invalid file descriptor %d in syscall %s()",
@@ -4156,5 +4156,5 @@ POST(socketcall)
case SYS_SOCKETPAIR:
- /* XXX TODO: check return fd against VG_MAX_FD */
+ /* XXX TODO: check return fd against VG_(max_fd) */
VG_TRACK( post_mem_write, ((UInt*)arg2)[3], 2*sizeof(int) );
if(VG_(clo_track_fds)) {
--- valgrind/include/vg_skin.h.base #1.2:1.3
@@ -397,4 +397,7 @@
extern Int VG_(getrlimit) ( Int resource, struct vki_rlimit *rlim );
+/* Set client resource limit*/
+extern Int VG_(setrlimit) ( Int resource, struct vki_rlimit *rlim );
+
/* Crude stand-in for the glibc system() call. */
extern Int VG_(system) ( Char* cmd );
|
|
From: Jeremy F. <je...@go...> - 2003-12-18 09:06:42
|
CVS commit by fitzhardinge:
Make rep; nop (pause) yield the thread. Based on a patch by Tom Hughes;
I added a test case and cleaned up vg_dispatch.S while I was about it.
CCMAIL: 695...@bu...
M +1 -0 coregrind/vg_constants.h 1.14
M +2 -21 coregrind/vg_dispatch.S 1.13
M +3 -0 coregrind/vg_from_ucode.c 1.69
M +10 -0 coregrind/vg_scheduler.c 1.134
M +5 -1 coregrind/vg_to_ucode.c 1.116
M +1 -0 coregrind/vg_translate.c 1.64
M +2 -1 include/vg_skin.h.base 1.4
M +5 -2 none/tests/Makefile.am 1.17
--- valgrind/coregrind/vg_constants.h #1.13:1.14
@@ -49,4 +49,5 @@
#define VG_TRC_EBP_JMP_SYSCALL 19 /* EBP and TRC */
#define VG_TRC_EBP_JMP_CLIENTREQ 23 /* EBP and TRC */
+#define VG_TRC_EBP_JMP_YIELD 27 /* EBP and TRC */
#define VG_TRC_INNER_FASTMISS 31 /* TRC only; means fast-cache miss. */
--- valgrind/coregrind/vg_dispatch.S #1.12:1.13
@@ -170,30 +170,11 @@
dispatch_exceptional:
/* this is jumped to only, not fallen-through from above */
- cmpl $VG_TRC_EBP_JMP_SYSCALL, %ebp
- jz dispatch_syscall
- cmpl $VG_TRC_EBP_JMP_CLIENTREQ, %ebp
- jz dispatch_clientreq
cmpl $VG_TRC_INNER_COUNTERZERO, %ebp
jz counter_is_zero
-
- /* ebp has an invalid value ... crap out. */
- pushl $panic_msg_ebp
- call VG_(core_panic)
- /* (never returns) */
-dispatch_syscall:
- /* save %eax in %EIP and defer to sched */
- movl $VG_(baseBlock), %ebp
- movl VGOFF_(m_eip), %esi
- movl %eax, (%ebp, %esi, 4)
- movl $VG_TRC_EBP_JMP_SYSCALL, %eax
- jmp run_innerloop_exit
-
-dispatch_clientreq:
/* save %eax in %EIP and defer to sched */
- movl $VG_(baseBlock), %ebp
movl VGOFF_(m_eip), %esi
- movl %eax, (%ebp, %esi, 4)
- movl $VG_TRC_EBP_JMP_CLIENTREQ, %eax
+ movl %eax, VG_(baseBlock)(,%esi, 4)
+ movl %ebp, %eax
jmp run_innerloop_exit
--- valgrind/coregrind/vg_from_ucode.c #1.68:1.69
@@ -2550,4 +2550,7 @@ static void load_ebp_from_JmpKind ( JmpK
VG_(emit_movv_lit_reg) ( 4, VG_TRC_EBP_JMP_CLIENTREQ, R_EBP );
break;
+ case JmpYield:
+ VG_(emit_movv_lit_reg) ( 4, VG_TRC_EBP_JMP_YIELD, R_EBP );
+ break;
default:
VG_(core_panic)("load_ebp_from_JmpKind");
--- valgrind/coregrind/vg_scheduler.c #1.133:1.134
@@ -248,4 +248,5 @@ Char* name_of_sched_event ( UInt event )
case VG_TRC_EBP_JMP_SYSCALL: return "SYSCALL";
case VG_TRC_EBP_JMP_CLIENTREQ: return "CLIENTREQ";
+ case VG_TRC_EBP_JMP_YIELD: return "YIELD";
case VG_TRC_INNER_COUNTERZERO: return "COUNTERZERO";
case VG_TRC_INNER_FASTMISS: return "FASTMISS";
@@ -1187,4 +1188,13 @@ VgSchedReturnCode VG_(scheduler) ( void
switch (trc) {
+ case VG_TRC_EBP_JMP_YIELD:
+ /* Explicit yield. Let a new thread be scheduled,
+ simply by doing nothing, causing us to arrive back at
+ Phase 1. */
+ if (VG_(bbs_to_go) == 0) {
+ goto debug_stop;
+ }
+ break;
+
case VG_TRC_INNER_COUNTERZERO:
/* Timeslice is out. Let a new thread be scheduled,
--- valgrind/coregrind/vg_to_ucode.c #1.115:1.116
@@ -5556,5 +5556,9 @@ static Addr disInstr ( UCodeBlock* cb, A
if (abyte == 0x90) { /* REP NOP (PAUSE) */
if (dis) VG_(printf)("rep nop (P4 pause)\n");
- /* do nothing; apparently a hint to the P4 re spin-wait loop */
+ uInstr1(cb, JMP, 0, Literal, 0);
+ uLiteral(cb, eip);
+ uCond(cb, CondAlways);
+ LAST_UINSTR(cb).jmpkind = JmpYield;
+ *isEnd = True;
}
else {
--- valgrind/coregrind/vg_translate.c #1.63:1.64
@@ -1134,4 +1134,5 @@ void pp_UInstrWorker ( Int instrNo, UIns
case JmpSyscall: VG_(printf)("-sys"); break;
case JmpClientReq: VG_(printf)("-cli"); break;
+ case JmpYield: VG_(printf)("-yld"); break;
default: break;
}
--- valgrind/include/vg_skin.h.base #1.3:1.4
@@ -877,5 +877,6 @@
JmpRet=2, /* jump due to an x86 ret insn */
JmpSyscall=3, /* do a system call, then jump */
- JmpClientReq=4 /* do a client request, then jump */
+ JmpClientReq=4,/* do a client request, then jump */
+ JmpYield=5 /* do a yield, then jump */
}
JmpKind;
--- valgrind/none/tests/Makefile.am #1.16:1.17
@@ -36,5 +36,6 @@
shortpush.stderr.exp shortpush.vgtest \
shorts.stderr.exp shorts.vgtest \
- smc1.stderr.exp smc1.stdout.exp smc1.vgtest
+ smc1.stderr.exp smc1.stdout.exp smc1.vgtest \
+ yield.stdout.exp yield.vgtest
check_PROGRAMS = \
@@ -44,5 +45,5 @@
rcrl readline1 resolv seg_override sha1_test shortpush shorts smc1 \
pth_blockedsig \
- coolo_sigaction gxx304
+ coolo_sigaction gxx304 yield
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/include
@@ -73,4 +74,6 @@
shortpush_SOURCES = shortpush.c
shorts_SOURCES = shorts.c
+yield_SOURCES = yield.c
+yield_LDADD = -lpthread
# pthread C ones
|
|
From: Julian S. <js...@ac...> - 2003-12-22 22:39:44
|
CVS commit by jseward:
Add an implementation of strnlen for memcheck, from Tom Hughes.
M +2 -0 coregrind/vg_symtab2.c 1.71
M +7 -0 memcheck/mac_replace_strmem.c 1.11
--- valgrind/coregrind/vg_symtab2.c #1.70:1.71
@@ -2200,4 +2200,6 @@ void VG_(setup_code_redirect_table) ( vo
VG_(add_redirect_sym)("soname:libc.so.6", "stpcpy",
"*vgpreload_memcheck.so*", "stpcpy");
+ VG_(add_redirect_sym)("soname:libc.so.6", "strnlen",
+ "*vgpreload_memcheck.so*", "strnlen");
VG_(add_redirect_sym)("soname:ld-linux.so.2", "stpcpy",
--- valgrind/memcheck/mac_replace_strmem.c #1.10:1.11
@@ -177,4 +177,11 @@ char* strncat ( char* dst, const char* s
}
+unsigned int strnlen ( const char* str, unsigned int n )
+{
+ UInt i = 0;
+ while (i < n && str[i] != 0) i++;
+ return i;
+}
+
unsigned int strlen ( const char* str )
{
|
|
From: Julian S. <js...@ac...> - 2003-12-24 11:45:50
|
CVS commit by jseward:
Add post-FV suppressions needed to make it tolerably quiet on SuSE 9.
With these suppressions there are now 15 stderr fails and 2 stdout
fails on SuSE 9.
M +18 -0 glibc-2.3.supp 1.9
--- valgrind/glibc-2.3.supp #1.8:1.9
@@ -174,2 +174,20 @@
obj:/opt/intel/compiler70/ia32/lib/libcxa.so.3
}
+
+##----------------------------------------------------------------------##
+## SuSE 9 after FV changes (post 2.1.0)
+
+{
+ strlen/_dl_init_paths/dl_main/_dl_sysdep_start(Cond)
+ Memcheck:Cond
+ fun:strlen
+ fun:_dl_init_paths
+ fun:dl_main
+ fun:_dl_sysdep_start
+}
+
+{
+ Ugly strchr error in /lib/ld-2.3.2.so
+ Memcheck:Cond
+ obj:/lib/ld-2.3.2.so
+}
|
|
From: Dirk M. <mu...@kd...> - 2004-01-02 22:43:01
|
CVS commit by mueller:
implement cmpxchg8b, patch by Tom Hughes.
CCMAIL: 696...@bu...
M +24 -0 coregrind/vg_helpers.S 1.27
M +2 -0 coregrind/vg_include.h 1.165
M +3 -0 coregrind/vg_main.c 1.134
M +75 -1 coregrind/vg_to_ucode.c 1.117
M +2 -0 include/vg_skin.h.base 1.5
--- valgrind/coregrind/vg_helpers.S #1.26:1.27
@@ -95,4 +95,5 @@
* setting and getting obscure eflags
* double-length shifts
+ * eight byte compare and exchange
All routines use a standard calling convention designed for
@@ -631,4 +632,27 @@
+/* Eight byte compare and exchange. */
+.globl VG_(helper_cmpxchg8b)
+VG_(helper_cmpxchg8b):
+ pushl %eax
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ movl 20(%esp), %eax
+ movl 24(%esp), %edx
+ movl 28(%esp), %ebx
+ movl 32(%esp), %ecx
+ cmpxchg8b 36(%esp)
+ movl %eax, 20(%esp)
+ movl %edx, 24(%esp)
+ movl %ebx, 28(%esp)
+ movl %ecx, 32(%esp)
+ popl %edx
+ popl %ecx
+ popl %ebx
+ popl %eax
+ ret
+
+
/* Undefined instruction (generates SIGILL) */
.globl VG_(helper_undefined_instruction)
--- valgrind/coregrind/vg_include.h #1.164:1.165
@@ -1746,4 +1746,6 @@ extern void VG_(helper_DAS);
extern void VG_(helper_DAA);
+extern void VG_(helper_cmpxchg8b);
+
extern void VG_(helper_undefined_instruction);
--- valgrind/coregrind/vg_main.c #1.133:1.134
@@ -103,4 +103,5 @@ Int VGOFF_(helper_LAHF) = INVALID_OFFSET
Int VGOFF_(helper_DAS) = INVALID_OFFSET;
Int VGOFF_(helper_DAA) = INVALID_OFFSET;
+Int VGOFF_(helper_cmpxchg8b) = INVALID_OFFSET;
Int VGOFF_(helper_undefined_instruction) = INVALID_OFFSET;
@@ -423,4 +424,6 @@ static void vg_init_baseBlock ( void )
VGOFF_(helper_OUT)
= alloc_BaB_1_set( (Addr) & VG_(helper_OUT));
+ VGOFF_(helper_cmpxchg8b)
+ = alloc_BaB_1_set( (Addr) & VG_(helper_cmpxchg8b));
VGOFF_(helper_undefined_instruction)
--- valgrind/coregrind/vg_to_ucode.c #1.116:1.117
@@ -2755,5 +2755,5 @@ Addr dis_cmpxchg_G_E ( UCodeBlock* cb,
uInstr2(cb, GET, size, ArchReg, gregOfRM(rm), TempReg, src);
uInstr2(cb, GET, size, ArchReg, R_EAX, TempReg, acc);
- uInstr2(cb, MOV, size, TempReg, acc, TempReg, junk);
+ uInstr2(cb, MOV, 4, TempReg, acc, TempReg, junk);
uInstr2(cb, SUB, size, TempReg, dest, TempReg, junk);
setFlagsFromUOpcode(cb, SUB);
@@ -2777,4 +2777,72 @@ Addr dis_cmpxchg_G_E ( UCodeBlock* cb,
+static
+Addr dis_cmpxchg8b ( UCodeBlock* cb,
+ UChar sorb,
+ Addr eip0 )
+{
+ Int tal, tah, junkl, junkh, destl, desth, srcl, srch, accl, acch;
+ UChar dis_buf[50];
+ UChar rm;
+ UInt pair;
+
+ rm = getUChar(eip0);
+ accl = newTemp(cb);
+ acch = newTemp(cb);
+ srcl = newTemp(cb);
+ srch = newTemp(cb);
+ destl = newTemp(cb);
+ desth = newTemp(cb);
+ junkl = newTemp(cb);
+ junkh = newTemp(cb);
+
+ vg_assert(!epartIsReg(rm));
+
+ pair = disAMode ( cb, sorb, eip0, dis?dis_buf:NULL );
+ tal = LOW24(pair);
+ tah = newTemp(cb);
+ uInstr2(cb, MOV, 4, TempReg, tal, TempReg, tah);
+ uInstr2(cb, ADD, 4, Literal, 0, TempReg, tah);
+ uLiteral(cb, 4);
+ eip0 += HI8(pair);
+ if (dis) VG_(printf)("cmpxchg8b %s\n", dis_buf);
+
+ uInstr0(cb, CALLM_S, 0);
+
+ uInstr2(cb, LOAD, 4, TempReg, tah, TempReg, desth);
+ uInstr1(cb, PUSH, 4, TempReg, desth);
+ uInstr2(cb, LOAD, 4, TempReg, tal, TempReg, destl);
+ uInstr1(cb, PUSH, 4, TempReg, destl);
+ uInstr2(cb, GET, 4, ArchReg, R_ECX, TempReg, srch);
+ uInstr1(cb, PUSH, 4, TempReg, srch);
+ uInstr2(cb, GET, 4, ArchReg, R_EBX, TempReg, srcl);
+ uInstr1(cb, PUSH, 4, TempReg, srcl);
+ uInstr2(cb, GET, 4, ArchReg, R_EDX, TempReg, acch);
+ uInstr1(cb, PUSH, 4, TempReg, acch);
+ uInstr2(cb, GET, 4, ArchReg, R_EAX, TempReg, accl);
+ uInstr1(cb, PUSH, 4, TempReg, accl);
+
+ uInstr1(cb, CALLM, 0, Lit16, VGOFF_(helper_cmpxchg8b));
+ uFlagsRWU(cb, FlagsEmpty, FlagZ, FlagsEmpty);
+
+ uInstr1(cb, POP, 4, TempReg, accl);
+ uInstr2(cb, PUT, 4, TempReg, accl, ArchReg, R_EAX);
+ uInstr1(cb, POP, 4, TempReg, acch);
+ uInstr2(cb, PUT, 4, TempReg, acch, ArchReg, R_EDX);
+ uInstr1(cb, POP, 4, TempReg, srcl);
+ uInstr2(cb, PUT, 4, TempReg, srcl, ArchReg, R_EBX);
+ uInstr1(cb, POP, 4, TempReg, srch);
+ uInstr2(cb, PUT, 4, TempReg, srch, ArchReg, R_ECX);
+ uInstr1(cb, POP, 4, TempReg, destl);
+ uInstr2(cb, STORE, 4, TempReg, destl, TempReg, tal);
+ uInstr1(cb, POP, 4, TempReg, desth);
+ uInstr2(cb, STORE, 4, TempReg, desth, TempReg, tah);
+
+ uInstr0(cb, CALLM_E, 0);
+
+ return eip0;
+}
+
+
/* Handle conditional move instructions of the form
cmovcc E(reg-or-mem), G(reg)
@@ -5887,7 +5955,13 @@ static Addr disInstr ( UCodeBlock* cb, A
/* =-=-=-=-=-=-=-=-=- CMPXCHG -=-=-=-=-=-=-=-=-=-= */
+ case 0xB0: /* CMPXCHG Gv,Ev */
+ eip = dis_cmpxchg_G_E ( cb, sorb, 1, eip );
+ break;
case 0xB1: /* CMPXCHG Gv,Ev */
eip = dis_cmpxchg_G_E ( cb, sorb, sz, eip );
break;
+ case 0xC7: /* CMPXCHG8B Gv */
+ eip = dis_cmpxchg8b ( cb, sorb, eip );
+ break;
/* =-=-=-=-=-=-=-=-=- CPUID -=-=-=-=-=-=-=-=-=-=-= */
--- valgrind/include/vg_skin.h.base #1.4:1.5
@@ -1184,4 +1184,6 @@
extern Int VGOFF_(helper_DAA);
+extern Int VGOFF_(helper_cmpxchg8b);
+
/*====================================================================*/
|
|
From: Dirk M. <mu...@kd...> - 2004-01-02 23:13:36
|
CVS commit by mueller: link the bugzilla CCMAIL: 698...@bu... M +2 -2 README_PACKAGERS 1.4 --- valgrind/README_PACKAGERS #1.3:1.4 @@ -86,4 +86,4 @@ -If you find any more hints/tips for packaging, please let me know -(js...@ac...). Thanks. +If you find any more hints/tips for packaging, please report +it as a bugreport. See http://valgrind.kde.org/bugs.html for details. |