You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(31) |
2
(27) |
|
3
(25) |
4
(21) |
5
(21) |
6
(21) |
7
(32) |
8
(23) |
9
(15) |
|
10
(12) |
11
(9) |
12
(10) |
13
(10) |
14
(9) |
15
(7) |
16
(20) |
|
17
(14) |
18
(71) |
19
(67) |
20
(50) |
21
(25) |
22
(15) |
23
(37) |
|
24
(25) |
25
(41) |
26
(34) |
27
(57) |
28
(20) |
29
(30) |
30
(13) |
|
31
(18) |
|
|
|
|
|
|
|
From: Duncan S. <bal...@fr...> - 2005-07-18 14:41:56
|
Hi Julian, > > Excessive floating point precision loss when run > > under valgrind. I guess valgrind is not perfectly > > IEEE conformant. > > Yes (sigh). > > Life in 2.4.0 was very simple: V simply copied x87 (FP) instructions > through more or less verbatim and so any program that relied on > 64-bit mantissas, huge exponents, or 99 other useless non-portable > things you can do with the '387 work exactly as they do on the real > hardware. in the Ada case this is not non-portable, quite the opposite. The reason is that in Ada you don't work with predefined types like float, double and long double, and hope they have the properties you want. You instead specify your floating point type by specifying logical properties of it. If you want a floating point type that can accommodate at least 18 digits of precision (for example), then you can define one as follows: type Julian_Type is digits 18; The compiler will map this onto a machine floating point type, which may have more precision, but won't have less. You can query the properties of the machine type using attributes; for example Julian_Type'Mantissa returns the mantissa. [On an intel machine a declaration like the one above would doubtless be mapped onto a long double, and 'Mantissa would return 64]. This allows you to write portable floating point code: you don't work with the number "64" (and hope the mantissa will be 64 on the machine the code is built on), you work with logical quantities like 'Mantissa instead. Anyway, tests like cxg2001 aren't testing whether long double has a 64 bit mantissa - they are checking whether the value 'Mantissa returns is correct, i.e. matches what you get if you work out the mantissa via floating point operations. The problem is that the compiler knows that it assigned you a type with a 64 bit mantissa, i.e. it replaces Julian_Type'Mantissa with 64 everywhere when it builds your program, but in fact this is wrong when run under valgrind because in reality you're getting a type with a 53 bit mantissa. The test detects that the compiler "got it wrong" and waggles a finger at it ;) End of rant! > 3.0 line valgrind has much more difficulty with these, due to the > need to translate everything to a common architecture-neutral > intermediate representation. As as a result, what Valgrind-3.0 > attempts to do is look like a minimal IEEE754 implementation. All > arithmetic is done with 53-bit mantissas (viz, standard 64-bit > doubles and not long doubles). It also mostly ignores non-default > IEEE rounding modes and doesn't simulate FP exceptions at all. > 80-bit loads/stores are simulated correctly, though, so that > 80-bit in-memory images of FP numbers look correct, at least to > the extent that they can be given the 80-bit image is derived from > a 64-bit value. > > That's clearly not optimal and I am keeping a careful watch for > real problems this might cause. It has to be said that the 3.X > line on x86 has already been tested on a large amount of FP code, > including the test suite from GNU gsl-1.6, which is particularly > demanding, and I am not aware of any problems with real programs > this has caused. Mostly it appears to cause testsuite programs > of this nature to either fail or (more commonly) report unexpected > loss of precision. > > If you experience any problems arising from these approximations > I would be interested to hear of them. I've experienced no problems due to this. And I doubt I ever will since most of the floating point number crunching I occasionally do doesn't care much exactly what precision you have. Thanks for explaining. All the best, Duncan. |
|
From: Julian S. <js...@ac...> - 2005-07-18 14:21:17
|
> Excessive floating point precision loss when run > under valgrind. I guess valgrind is not perfectly > IEEE conformant. Yes (sigh). Life in 2.4.0 was very simple: V simply copied x87 (FP) instructions through more or less verbatim and so any program that relied on 64-bit mantissas, huge exponents, or 99 other useless non-portable things you can do with the '387 work exactly as they do on the real hardware. 3.0 line valgrind has much more difficulty with these, due to the need to translate everything to a common architecture-neutral intermediate representation. As as a result, what Valgrind-3.0 attempts to do is look like a minimal IEEE754 implementation. All arithmetic is done with 53-bit mantissas (viz, standard 64-bit doubles and not long doubles). It also mostly ignores non-default IEEE rounding modes and doesn't simulate FP exceptions at all. 80-bit loads/stores are simulated correctly, though, so that 80-bit in-memory images of FP numbers look correct, at least to the extent that they can be given the 80-bit image is derived from a 64-bit value. That's clearly not optimal and I am keeping a careful watch for real problems this might cause. It has to be said that the 3.X line on x86 has already been tested on a large amount of FP code, including the test suite from GNU gsl-1.6, which is particularly demanding, and I am not aware of any problems with real programs this has caused. Mostly it appears to cause testsuite programs of this nature to either fail or (more commonly) report unexpected loss of precision. If you experience any problems arising from these approximations I would be interested to hear of them. J |
|
From: Tom H. <th...@cy...> - 2005-07-18 14:15:56
|
SVN commit 435882 by thughes:
Fix typo.
M +1 -1 core.h =20
--- trunk/valgrind/coregrind/core.h #435881:435882
@@ -887,7 +887,7 @@
const Char *val );
extern void VG_(env_unsetenv) ( Char **env, const Char *varname );
extern void VG_(env_remove_valgrind_env_stuff) ( Char** env );=20
-extern Char **VG_(env_clone) ( Vhar **envp );
+extern Char **VG_(env_clone) ( Char **envp );
=20
extern void VG_(nanosleep)(struct vki_timespec *);
/* ---------------------------------------------------------------------
|
|
From: Tom H. <th...@cy...> - 2005-07-18 14:14:04
|
SVN commit 435880 by thughes:
Backport fixes for bugs #103509, #106293, #104797, #101881 from
the valgrind 3.0 tree.
M +1 -0 coregrind/core.h =20
M +1 -1 coregrind/vg_memory.c =20
M +2 -2 coregrind/vg_mylibc.c =20
M +17 -10 coregrind/vg_syscalls.c =20
M +1 -0 include/linux/vki.h =20
--- trunk/valgrind/coregrind/core.h #435879:435880
@@ -887,6 +887,7 @@
const Char *val );
extern void VG_(env_unsetenv) ( Char **env, const Char *varname );
extern void VG_(env_remove_valgrind_env_stuff) ( Char** env );=20
+extern Char **VG_(env_clone) ( Vhar **envp );
=20
extern void VG_(nanosleep)(struct vki_timespec *);
/* ---------------------------------------------------------------------
--- trunk/valgrind/coregrind/vg_memory.c #435879:435880
@@ -1014,7 +1014,7 @@
=20
for(s =3D VG_(first_segment)(); s !=3D NULL; s =3D VG_(next_segment)(=
s)) {
UInt flags =3D s->flags & (SF_SHARED|SF_MMAP|SF_VALGRIND|SF_CORE|S=
F_STACK|SF_DEVICE);
- if (flags !=3D SF_MMAP && flags !=3D SF_STACK)
+ if (flags !=3D SF_MMAP && flags !=3D SF_STACK && flags !=3D (SF_MM=
AP|SF_STACK))
continue;
if ((s->prot & (VKI_PROT_READ|VKI_PROT_WRITE)) !=3D (VKI_PROT_READ=
|VKI_PROT_WRITE))
continue;
--- trunk/valgrind/coregrind/vg_mylibc.c #435879:435880
@@ -1356,7 +1356,7 @@
------------------------------------------------------------------ */
=20
/* clone the environment */
-static Char **env_clone ( Char **oldenv )
+Char **VG_(env_clone) ( Char **oldenv )
{
Char **oldenvp;
Char **newenvp;
@@ -1640,7 +1640,7 @@
/* restore the DATA rlimit for the child */
VG_(setrlimit)(VKI_RLIMIT_DATA, &VG_(client_rlimit_data));
=20
- envp =3D env_clone(VG_(client_envp));
+ envp =3D VG_(env_clone)(VG_(client_envp));
VG_(env_remove_valgrind_env_stuff)( envp );=20
=20
argv[0] =3D "/bin/sh";
--- trunk/valgrind/coregrind/vg_syscalls.c #435879:435880
@@ -1697,6 +1697,7 @@
PRE(sys_execve, Special)
{
Char *path; /* path to executable */
+ Char **envp; /* environment */
=20
PRINT("sys_execve ( %p(%s), %p, %p )", arg1, arg1, arg2, arg3);
PRE_REG_READ3(vki_off_t, "execve",
@@ -1746,16 +1747,14 @@
VG_(shutdown_actions)(tid);
}
=20
- {
- // Remove the valgrind-specific stuff from the environment so the
- // child doesn't get vg_inject.so, vgpreload.so, etc. This is
- // done unconditionally, since if we are tracing the child,
- // stage1/2 will set up the appropriate client environment.
- Char** envp =3D (Char**)arg3;
+ // Remove the valgrind-specific stuff from the environment so the
+ // child doesn't get vg_inject.so, vgpreload.so, etc. This is
+ // done unconditionally, since if we are tracing the child,
+ // stage1/2 will set up the appropriate client environment.
+ envp =3D VG_(env_clone)( (Char**)arg3 );
=20
- if (envp !=3D NULL) {
- VG_(env_remove_valgrind_env_stuff)( envp );=20
- }
+ if (envp !=3D NULL) {
+ VG_(env_remove_valgrind_env_stuff)( envp );=20
}
=20
if (VG_(clo_trace_children)) {
@@ -3269,6 +3268,9 @@
case VKI_BLKGETSIZE:
SYS_PRE_MEM_WRITE( "ioctl(BLKGETSIZE)", arg3, sizeof(unsigned long=
));
break;
+ case VKI_BLKGETSIZE64:
+ SYS_PRE_MEM_WRITE( "ioctl(BLKGETSIZE64)", arg3, sizeof(unsigned lo=
ng long));
+ break;
=20
/* Hard disks */
case VKI_HDIO_GET_IDENTITY: /* 0x030d */
@@ -3934,6 +3936,9 @@
case VKI_BLKGETSIZE:
VG_TRACK( post_mem_write,arg3, sizeof(unsigned long));
break;
+ case VKI_BLKGETSIZE64:
+ VG_TRACK( post_mem_write,arg3, sizeof(unsigned long long));
+ break;
=20
/* Hard disks */
case VKI_HDIO_GET_IDENTITY: /* 0x030d */
@@ -5423,7 +5428,9 @@
{
PRINT("sys_times ( %p )", arg1);
PRE_REG_READ1(long, "times", struct tms *, buf);
- SYS_PRE_MEM_WRITE( "times(buf)", arg1, sizeof(struct vki_tms) );
+ if (arg1 !=3D 0) {
+ SYS_PRE_MEM_WRITE( "times(buf)", arg1, sizeof(struct vki_tms) );
+ }
}
=20
POST(sys_times)
--- trunk/valgrind/include/linux/vki.h #435879:435880
@@ -1390,6 +1390,7 @@
//----------------------------------------------------------------------
=20
#define VKI_BLKGETSIZE _VKI_IO(0x12,96) /* return device size /512 (long=
*arg) */
+#define VKI_BLKGETSIZE64 _VKI_IOR(0x12,114, vki_size_t) /* return device=
size in bytes (u64 *arg) */
=20
#define VKI_FIBMAP _VKI_IO(0x00,1) /* bmap access */
#define VKI_FIGETBSZ _VKI_IO(0x00,2) /* get the block size used for b=
map */
|
|
From: Duncan S. <bal...@fr...> - 2005-07-18 14:10:29
|
Hi Nicholas, > ACATS seems to be an Ada test suite. See > http://www.ada-auth.org/acats.html. yes, that's correct. It used to have many failures due to use of trampolines, and it seemed like a good test of the self-modifying code changes. Unfortunately all kinds of tests are failing due to valgrind floating point problems, so the signal is lost in the noise. > Duncan, if you find any more Valgrind failures for this suite, please feel > free to put them all in one email rather than 10 different ones. Yes, it looks like these are all the same kind of problem, so could very reasonably have been grouped. My only excuse is that at first glance I thought they had different causes. There are several other failures of quite a different kind, however they are much harder to understand (particularly the multitasking failures) and I want to analyse them thouroughly first. > You might also want to report them with Valgrind's Bugzilla page to ensure > they don't get lost. Will do. The main problem is in providing C test cases: Ada has some high level features that can't readily be mapped to C, so some test cases will have to be in Ada; I will try to find as many C equivalents as possible though. Getting hold of an Ada enabled gcc is not too hard, but I appreciate that it's an extra hurdle. All the best, Duncan. |
|
From: <sv...@va...> - 2005-07-18 14:10:19
|
Author: njn
Date: 2005-07-18 15:10:12 +0100 (Mon, 18 Jul 2005)
New Revision: 4163
Log:
add comment
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2005-07-18 14:02:11 UTC (=
rev 4162)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2005-07-18 14:10:12 UTC (=
rev 4163)
@@ -2322,6 +2322,8 @@
// child doesn't get vg_preload_core.so, vg_preload_TOOL.so, etc. =20
// This is done unconditionally, since if we are tracing the child,
// stage1/2 will set up the appropriate client environment.
+ // Nb: we make a copy of the environment before trying to mangle it
+ // as it might be in read-only memory (this was bug #101881).
envp =3D VG_(env_clone)( (Char**)ARG3 );
if (envp !=3D NULL) {
VG_(env_remove_valgrind_env_stuff)( envp );
|
|
From: Julian S. <js...@ac...> - 2005-07-18 14:03:39
|
On Monday 18 July 2005 14:20, Nicholas Nethercote wrote: > On Mon, 18 Jul 2005, Duncan Sands wrote: > > These both fail in similar ways: > > > > ,.,. C45624A ACATS 2.5 05-07-18 00:19:06 > > ---- C45624A FOR FLOATING POINT TYPES, CHECK THAT CONSTRAINT_ERROR IS > > RAISED IF MACHINE_OVERFLOWS IS FALSE. THIS TESTS DIGITS > > 5. > > - C45624A CONSTRAINT_ERROR WAS NOT RAISED WHEN MACHINE_OVERFLOWS WAS > > FALSE. > > 0:I1 > > vex: the `impossible' happened: > > iselCondCode > > vex storage: P 512, T total 85688840 (2710216), T curr 136584 (4423) > > > > valgrind: the 'impossible' happened: > > LibVEX called failure_exit(). Ok, that was straightforward. Either of vex r1275 or r1276 fixes it. Pls try. You'll also need to update your valgrind tree due to massive ppc hacking over the weekend. Next: can you send me a binary of one of the tests that appears not to terminate running on V ? Also the ada source would be good, so I can get some idea of what it's trying to do. J |
|
From: Duncan S. <bal...@fr...> - 2005-07-18 14:02:48
|
Returns 64 when run directly, 53 when run under valgrind. $ gcc -o cxg2001 cxg2001.c $ ./cxg2001 64 $ valgrind --tool=memcheck ./cxg2001 ==2417== Memcheck, a memory error detector. ==2417== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al. ==2417== Using LibVEX rev 1271, a library for dynamic binary translation. ==2417== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP. ==2417== Using valgrind-3.0.0.SVN, a dynamic binary instrumentation framework. ==2417== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al. ==2417== For more details, rerun with: -v ==2417== 53 ==2417== ==2417== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 16 from 1) ==2417== malloc/free: in use at exit: 0 bytes in 0 blocks. ==2417== malloc/free: 0 allocs, 0 frees, 0 bytes allocated. ==2417== For counts of detected errors, rerun with: -v ==2417== No malloc'd blocks -- no leaks are possible. |
|
From: Nicholas N. <nj...@cs...> - 2005-07-18 14:02:42
|
On Mon, 18 Jul 2005, Nicholas Nethercote wrote: > ACATS seems to be an Ada test suite. See http://www.ada-auth.org/acats.html. Ah, I missed Duncan's explanatory email. Sorry for the noise. N |
|
From: <sv...@va...> - 2005-07-18 14:02:15
|
Author: tom
Date: 2005-07-18 15:02:11 +0100 (Mon, 18 Jul 2005)
New Revision: 4162
Log:
Take a copy of the environment given to execve before trying to mangle
it as it might be in read only memory. Fixes bug #101881.
Modified:
trunk/coregrind/m_libcproc.c
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/coregrind/pub_core_libcproc.h
Modified: trunk/coregrind/m_libcproc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_libcproc.c 2005-07-18 13:26:55 UTC (rev 4161)
+++ trunk/coregrind/m_libcproc.c 2005-07-18 14:02:11 UTC (rev 4162)
@@ -239,7 +239,7 @@
}
=20
/* clone the environment */
-static Char **env_clone ( Char **oldenv )
+Char **VG_(env_clone) ( Char **oldenv )
{
Char **oldenvp;
Char **newenvp;
@@ -284,7 +284,7 @@
/* restore the DATA rlimit for the child */
VG_(setrlimit)(VKI_RLIMIT_DATA, &VG_(client_rlimit_data));
=20
- envp =3D env_clone(VG_(client_envp));
+ envp =3D VG_(env_clone)(VG_(client_envp));
VG_(env_remove_valgrind_env_stuff)( envp );=20
=20
argv[0] =3D "/bin/sh";
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2005-07-18 13:26:55 UTC (=
rev 4161)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2005-07-18 14:02:11 UTC (=
rev 4162)
@@ -2271,6 +2271,7 @@
PRE(sys_execve)
{
Char* path; /* path to executable */
+ Char** envp;
ThreadState* tst;
=20
PRINT("sys_execve ( %p(%s), %p, %p )", ARG1, ARG1, ARG2, ARG3);
@@ -2317,14 +2318,13 @@
VG_(nuke_all_threads_except)( tid, VgSrc_ExitSyscall );
VG_(reap_threads)(tid);
=20
- { // Remove the valgrind-specific stuff from the environment so the
- // child doesn't get vg_preload_core.so, vg_preload_TOOL.so, etc. =20
- // This is done unconditionally, since if we are tracing the child,
- // stage1/2 will set up the appropriate client environment.
- Char** envp =3D (Char**)ARG3;
- if (envp !=3D NULL) {
- VG_(env_remove_valgrind_env_stuff)( envp );
- }
+ // Remove the valgrind-specific stuff from the environment so the
+ // child doesn't get vg_preload_core.so, vg_preload_TOOL.so, etc. =20
+ // This is done unconditionally, since if we are tracing the child,
+ // stage1/2 will set up the appropriate client environment.
+ envp =3D VG_(env_clone)( (Char**)ARG3 );
+ if (envp !=3D NULL) {
+ VG_(env_remove_valgrind_env_stuff)( envp );
}
=20
if (VG_(clo_trace_children)) {
Modified: trunk/coregrind/pub_core_libcproc.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_libcproc.h 2005-07-18 13:26:55 UTC (rev 4161=
)
+++ trunk/coregrind/pub_core_libcproc.h 2005-07-18 14:02:11 UTC (rev 4162=
)
@@ -70,6 +70,7 @@
const Char *val );
extern void VG_(env_unsetenv) ( Char **env, const Char *varname );
extern void VG_(env_remove_valgrind_env_stuff) ( Char** env );=20
+extern Char **VG_(env_clone) ( Char **env_clone );
=20
// misc
extern Int VG_(poll)( struct vki_pollfd *, UInt nfds, Int timeout);
|
|
From: <sv...@va...> - 2005-07-18 13:58:52
|
Author: sewardj
Date: 2005-07-18 14:58:49 +0100 (Mon, 18 Jul 2005)
New Revision: 1276
Log:
Add a folding rule for 1Sto16.
Modified:
trunk/priv/ir/iropt.c
Modified: trunk/priv/ir/iropt.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/ir/iropt.c 2005-07-18 13:54:49 UTC (rev 1275)
+++ trunk/priv/ir/iropt.c 2005-07-18 13:58:49 UTC (rev 1276)
@@ -893,6 +893,11 @@
? 1 : 0));
break;
=20
+ case Iop_1Sto16:
+ e2 =3D IRExpr_Const(IRConst_U16(
+ e->Iex.Unop.arg->Iex.Const.con->Ico.U1
+ ? 0xFFFF : 0));
+ break;
case Iop_1Sto32:
e2 =3D IRExpr_Const(IRConst_U32(
e->Iex.Unop.arg->Iex.Const.con->Ico.U1
|
|
From: <sv...@va...> - 2005-07-18 13:55:20
|
Author: sewardj
Date: 2005-07-18 14:54:49 +0100 (Mon, 18 Jul 2005)
New Revision: 1275
Log:
Handle 0 :: Ity_I1 as well as 1 :: Ity_I1.
Modified:
trunk/priv/host-x86/isel.c
Modified: trunk/priv/host-x86/isel.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/host-x86/isel.c 2005-07-18 11:39:47 UTC (rev 1274)
+++ trunk/priv/host-x86/isel.c 2005-07-18 13:54:49 UTC (rev 1275)
@@ -1492,13 +1492,15 @@
}
=20
/* Constant 1:Bit */
- if (e->tag =3D=3D Iex_Const && e->Iex.Const.con->Ico.U1 =3D=3D True) =
{
+ if (e->tag =3D=3D Iex_Const) {
HReg r;
vassert(e->Iex.Const.con->tag =3D=3D Ico_U1);
+ vassert(e->Iex.Const.con->Ico.U1 =3D=3D True=20
+ || e->Iex.Const.con->Ico.U1 =3D=3D False);
r =3D newVRegI(env);
addInstr(env, X86Instr_Alu32R(Xalu_MOV,X86RMI_Imm(0),r));
addInstr(env, X86Instr_Alu32R(Xalu_XOR,X86RMI_Reg(r),r));
- return Xcc_Z;
+ return e->Iex.Const.con->Ico.U1 ? Xcc_Z : Xcc_NZ;
}
=20
/* Not1(e) */
|
|
From: Tom H. <to...@co...> - 2005-07-18 13:44:05
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
> On Monday 18 July 2005 14:14, Nicholas Nethercote wrote:
>> > Author: tom
>> > Log:
>> > Preserve %esi across VG_(clone) as the caller may be relying on it
>> > not being changed. Fix to bug #106713.
>>
>> Nice catch.
>
> Indeed; I'm impressed. But/and I was wondering if amd64 is similarly
> afflicted, or even if/how we could tell. Ah, life was so simple back
> in the x86-only days ..
It was actually quite easy to find because it happening in my athlon
optimised builds because the compiler was using %esi across that call ;-)
As far as amd64 goes, we just need to check if any registers are used
in VG_(clone) that are supposed to be preserved by the callee according
to the amd64 ABI.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: <sv...@va...> - 2005-07-18 13:27:49
|
Author: tom
Date: 2005-07-18 14:26:55 +0100 (Mon, 18 Jul 2005)
New Revision: 4161
Log:
Handle the BLKGETSIZE64 ioctl. Fixes bug #104797.
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/include/vki-linux.h
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2005-07-18 12:02:45 UTC (=
rev 4160)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2005-07-18 13:26:55 UTC (=
rev 4161)
@@ -3444,6 +3444,9 @@
case VKI_BLKGETSIZE:
PRE_MEM_WRITE( "ioctl(BLKGETSIZE)", ARG3, sizeof(unsigned long));
break;
+ case VKI_BLKGETSIZE64:
+ PRE_MEM_WRITE( "ioctl(BLKGETSIZE64)", ARG3, sizeof(unsigned long l=
ong));
+ break;
=20
/* Hard disks */
case VKI_HDIO_GET_IDENTITY: /* 0x030d */
@@ -4086,6 +4089,9 @@
case VKI_BLKGETSIZE:
POST_MEM_WRITE(ARG3, sizeof(unsigned long));
break;
+ case VKI_BLKGETSIZE64:
+ POST_MEM_WRITE(ARG3, sizeof(unsigned long long));
+ break;
=20
/* Hard disks */
case VKI_HDIO_GET_IDENTITY: /* 0x030d */
Modified: trunk/include/vki-linux.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/vki-linux.h 2005-07-18 12:02:45 UTC (rev 4160)
+++ trunk/include/vki-linux.h 2005-07-18 13:26:55 UTC (rev 4161)
@@ -1424,6 +1424,7 @@
//----------------------------------------------------------------------
=20
#define VKI_BLKGETSIZE _VKI_IO(0x12,96) /* return device size /512 (long=
*arg) */
+#define VKI_BLKGETSIZE64 _VKI_IOR(0x12,114, vki_size_t) /* return device=
size in bytes (u64 *arg) */
=20
#define VKI_FIBMAP _VKI_IO(0x00,1) /* bmap access */
#define VKI_FIGETBSZ _VKI_IO(0x00,2) /* get the block size used for b=
map */
|
|
From: Julian S. <js...@ac...> - 2005-07-18 13:27:26
|
On Monday 18 July 2005 14:14, Nicholas Nethercote wrote: > > Author: tom > > Log: > > Preserve %esi across VG_(clone) as the caller may be relying on it > > not being changed. Fix to bug #106713. > > Nice catch. Indeed; I'm impressed. But/and I was wondering if amd64 is similarly afflicted, or even if/how we could tell. Ah, life was so simple back in the x86-only days .. J |
|
From: Nicholas N. <nj...@cs...> - 2005-07-18 13:20:41
|
On Mon, 18 Jul 2005, Duncan Sands wrote: > These both fail in similar ways: > > ,.,. C45624A ACATS 2.5 05-07-18 00:19:06 > ---- C45624A FOR FLOATING POINT TYPES, CHECK THAT CONSTRAINT_ERROR IS > RAISED IF MACHINE_OVERFLOWS IS FALSE. THIS TESTS DIGITS > 5. > - C45624A CONSTRAINT_ERROR WAS NOT RAISED WHEN MACHINE_OVERFLOWS WAS > FALSE. > 0:I1 > vex: the `impossible' happened: > iselCondCode > vex storage: P 512, T total 85688840 (2710216), T curr 136584 (4423) > > valgrind: the 'impossible' happened: > LibVEX called failure_exit(). ACATS seems to be an Ada test suite. See http://www.ada-auth.org/acats.html. Duncan, if you find any more Valgrind failures for this suite, please feel free to put them all in one email rather than 10 different ones. You might also want to report them with Valgrind's Bugzilla page to ensure they don't get lost. N |
|
From: Nicholas N. <nj...@cs...> - 2005-07-18 13:14:39
|
> Author: tom > Log: > Preserve %esi across VG_(clone) as the caller may be relying on it > not being changed. Fix to bug #106713. Nice catch. N |
|
From: Tom H. <th...@cy...> - 2005-07-18 12:03:05
|
SVN commit 435847 by thughes: Preserve %esi across VG_(clone) as the caller may be relying on it not being changed. Fix to bug #106713. M +3 -1 syscall.S =20 --- trunk/valgrind/coregrind/x86-linux/syscall.S #435846:435847 @@ -77,9 +77,10 @@ */ .globl VG_(clone) VG_(clone): -#define FSZ (4+4+4) /* frame size =3D retaddr+ebx+edi */ +#define FSZ (4+4+4+4) /* frame size =3D retaddr+ebx+edi+esi */ push %ebx push %edi + push %esi /* set up child stack with function and arg */ movl 4+FSZ(%esp), %ecx /* child stack */ movl 12+FSZ(%esp), %ebx /* fn arg */ @@ -111,6 +112,7 @@ ud2 =09 1: /* PARENT or ERROR */ + pop %esi pop %edi pop %ebx ret |
|
From: <sv...@va...> - 2005-07-18 12:02:49
|
Author: tom
Date: 2005-07-18 13:02:45 +0100 (Mon, 18 Jul 2005)
New Revision: 4160
Log:
Preserve %esi across VG_(clone) as the caller may be relying on it
not being changed. Fix to bug #106713.
Modified:
trunk/coregrind/m_syswrap/syswrap-x86-linux.c
Modified: trunk/coregrind/m_syswrap/syswrap-x86-linux.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2005-07-18 11:41:15 UTC=
(rev 4159)
+++ trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2005-07-18 12:02:45 UTC=
(rev 4160)
@@ -306,7 +306,7 @@
*/
#define STRINGIFZ(__str) #__str
#define STRINGIFY(__str) STRINGIFZ(__str)
-#define FSZ "4+4+4" /* frame size =3D retaddr+ebx+edi */
+#define FSZ "4+4+4+4" /* frame size =3D retaddr+ebx+edi+es=
i */
#define __NR_CLONE STRINGIFY(__NR_clone)
#define __NR_EXIT STRINGIFY(__NR_exit)
=20
@@ -323,6 +323,7 @@
"do_syscall_clone_x86_linux:\n"
" push %ebx\n"
" push %edi\n"
+" push %esi\n"
=20
/* set up child stack with function and arg */
" movl 4+"FSZ"(%esp), %ecx\n" /* syscall arg2: child stack=
*/
@@ -355,6 +356,7 @@
" ud2\n"
=20
"1:\n" /* PARENT or ERROR */
+" pop %esi\n"
" pop %edi\n"
" pop %ebx\n"
" ret\n"
|
|
From: <sv...@va...> - 2005-07-18 11:41:18
|
Author: sewardj
Date: 2005-07-18 12:41:15 +0100 (Mon, 18 Jul 2005)
New Revision: 4159
Log:
Track API changes in vex r1272.
Modified:
trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c
trunk/coregrind/m_syswrap/syscall-ppc32-linux.S
trunk/coregrind/m_syswrap/syswrap-main.c
trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
trunk/memcheck/mc_translate.c
Modified: trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c 2005-07-18 11:03:35=
UTC (rev 4158)
+++ trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c 2005-07-18 11:41:15=
UTC (rev 4159)
@@ -151,8 +151,8 @@
mc->mc_gregs[VKI_PT_ORIG_R3] =3D tst->arch.vex.guest_GPR3;
mc->mc_gregs[VKI_PT_CTR] =3D tst->arch.vex.guest_CTR;
mc->mc_gregs[VKI_PT_LNK] =3D tst->arch.vex.guest_LR;
- mc->mc_gregs[VKI_PT_XER] =3D tst->arch.vex.guest_XER;
- mc->mc_gregs[VKI_PT_CCR] =3D LibVEX_GuestPPC32_get_cr(&tst->arch.=
vex);
+ mc->mc_gregs[VKI_PT_XER] =3D LibVEX_GuestPPC32_get_XER(&tst->arch=
.vex);
+ mc->mc_gregs[VKI_PT_CCR] =3D LibVEX_GuestPPC32_get_CR(&tst->arch.=
vex);
mc->mc_gregs[VKI_PT_MQ] =3D 0;
mc->mc_gregs[VKI_PT_TRAP] =3D 0;
mc->mc_gregs[VKI_PT_DAR] =3D fault_addr;
@@ -908,12 +908,11 @@
// Umm ... ? (jrs 2005 July 8)
// tst->arch.m_orig_gpr3 =3D mc->mc_gregs[VKI_PT_ORIG_R3];
=20
- //tst->arch.m_cr =3D mc->mc_gregs[VKI_PT_CCR];
- LibVEX_GuestPPC32_put_cr( mc->mc_gregs[VKI_PT_CCR], &tst->arch.vex );
+ LibVEX_GuestPPC32_put_CR( mc->mc_gregs[VKI_PT_CCR], &tst->arch.vex );
=20
tst->arch.vex.guest_LR =3D mc->mc_gregs[VKI_PT_LNK];
tst->arch.vex.guest_CTR =3D mc->mc_gregs[VKI_PT_CTR];
- tst->arch.vex.guest_XER =3D mc->mc_gregs[VKI_PT_XER];
+ LibVEX_GuestPPC32_put_XER( mc->mc_gregs[VKI_PT_XER], &tst->arch.vex )=
;
=20
tst->arch.vex_shadow =3D priv->shadow;
=20
Modified: trunk/coregrind/m_syswrap/syscall-ppc32-linux.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syscall-ppc32-linux.S 2005-07-18 11:03:35 U=
TC (rev 4158)
+++ trunk/coregrind/m_syswrap/syscall-ppc32-linux.S 2005-07-18 11:41:15 U=
TC (rev 4159)
@@ -103,14 +103,11 @@
2: sc /* do the syscall */
=20
/* put the result back in the threadstate */
- /* HACK: killing all of CR0 for simplicity (should get from gst)=
*/
3: stw 3,OFFSET_ppc32_GPR3(30) /* gst->GPR3 =3D sc result */
- li 4,1
- stw 4,OFFSET_ppc32_CC_OP(30) /* gst->CC_OP =3D 1 *=
/
+ /* copy cr0.so back to simulated state */
mfcr 5 /* r5 =3D CR */
- andis. 5,5,0x1000 /* mask to only CR7.SO */
- oris 5,5,0x2000 /* set CR7.EQ */
- stw 5,OFFSET_ppc32_CC_DEP1(30) /* gst->CR7 =3D CR7 *=
/
+ rlwinm 5,5,4,31,31 /* r5 =3D (CR >> 28) & 1 */
+ stb 5,OFFSET_ppc32_CR0_0(30) /* gst->CR0.SO =3D cr0.so *=
/
=20
/* block signals again */
/* set up for sigprocmask(SIG_SETMASK, postmask, NULL) */
Modified: trunk/coregrind/m_syswrap/syswrap-main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-main.c 2005-07-18 11:03:35 UTC (rev=
4158)
+++ trunk/coregrind/m_syswrap/syswrap-main.c 2005-07-18 11:41:15 UTC (rev=
4159)
@@ -360,8 +360,8 @@
=20
#elif defined(VGP_ppc32_linux)
VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
- UInt cr =3D LibVEX_GuestPPC32_get_cr7( gst );
- UInt err =3D (cr >> 28) & 1; // CR7.=
SO
+ UInt cr =3D LibVEX_GuestPPC32_get_CR( gst );
+ UInt err =3D (cr >> 28) & 1; // CR0.SO
canonical->what =3D (err =3D=3D 1) ? SsFailure : SsSuccess;
canonical->val =3D (UWord)gst->guest_GPR3;
=20
@@ -399,16 +399,18 @@
=20
#elif defined(VGP_ppc32_linux)
VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
+ UInt old_cr =3D LibVEX_GuestPPC32_get_CR(gst);
+
gst->guest_GPR3 =3D canonical->val;
- gst->guest_CC_OP =3D 1;
- /* XXX: Setting all of CR0, not just SO flag */
- if (canonical->what =3D=3D SsFailure) /* set cr0.SO */
- gst->guest_CC_DEP1 =3D 0x30000000;
- else /* clear cr0.SO */
- gst->guest_CC_DEP1 =3D 0x20000000;
-// CAB: Need to set gpr0?
- gst->guest_GPR0 =3D 0;
=20
+ if (canonical->what =3D=3D SsFailure) {
+ /* set CR0.SO */
+ LibVEX_GuestPPC32_put_CR( old_cr | (1<<28), gst );
+ } else {
+ /* clear CR0.SO */
+ LibVEX_GuestPPC32_put_CR( old_cr & ~(1<<28), gst );
+ }
+
#else
# error "putSyscallStatusIntoGuestState: unknown arch"
#endif
Modified: trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2005-07-18 11:03:35 U=
TC (rev 4158)
+++ trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2005-07-18 11:41:15 U=
TC (rev 4159)
@@ -1543,7 +1543,8 @@
SET_STATUS_from_SysRes(
VG_(mk_SysRes_ppc32_linux)(=20
tst->arch.vex.guest_GPR3,
- (LibVEX_GuestPPC32_get_cr7( &tst->arch.vex ) >> 28) & 1
+ /* get CR0.SO */
+ (LibVEX_GuestPPC32_get_CR( &tst->arch.vex ) >> 28) & 1
)
);
=20
Modified: trunk/memcheck/mc_translate.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mc_translate.c 2005-07-18 11:03:35 UTC (rev 4158)
+++ trunk/memcheck/mc_translate.c 2005-07-18 11:41:15 UTC (rev 4159)
@@ -1706,6 +1706,8 @@
=20
cheap_AddSub32:
case Iop_Mul32:
+ case Iop_CmpORD32S:
+ case Iop_CmpORD32U:
return mkLeft32(mce, mkUifU32(mce, vatom1,vatom2));
=20
case Iop_Add64:
@@ -1902,6 +1904,7 @@
case Iop_64to32:
case Iop_64HIto32:
case Iop_1Uto32:
+ case Iop_1Sto32:
case Iop_8Uto32:
case Iop_16Uto32:
case Iop_16Sto32:
@@ -2059,7 +2062,6 @@
v64lo =3D expr2vbits_Load_WRK(mce, end, Ity_I64, addr, bias)=
;
v64hi =3D expr2vbits_Load_WRK(mce, end, Ity_I64, addr, bias+=
8);
} else {
- tl_assert(0 /* awaiting test case */);
v64hi =3D expr2vbits_Load_WRK(mce, end, Ity_I64, addr, bias)=
;
v64lo =3D expr2vbits_Load_WRK(mce, end, Ity_I64, addr, bias+=
8);
}
|
|
From: <sv...@va...> - 2005-07-18 11:39:49
|
Author: sewardj
Date: 2005-07-18 12:39:47 +0100 (Mon, 18 Jul 2005)
New Revision: 1274
Log:
Fix up linking/relocation a bit, and track API changes in r1272.
Modified:
trunk/switchback/linker.c
trunk/switchback/linker.h
trunk/switchback/switchback.c
Modified: trunk/switchback/linker.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/switchback/linker.c 2005-07-18 11:38:58 UTC (rev 1273)
+++ trunk/switchback/linker.c 2005-07-18 11:39:47 UTC (rev 1274)
@@ -8,7 +8,7 @@
#include <elf.h>
#include <fcntl.h>
#include <string.h>
-#include <malloc.h>
+//#include <malloc.h>
=20
#include "linker.h"
=20
@@ -45,6 +45,27 @@
return p;
}
=20
+#define MYMALLOC_MAX 50*1000*1000
+static HChar mymalloc_area[MYMALLOC_MAX];
+static UInt mymalloc_used =3D 0;
+void* mymalloc ( Int n )
+{
+ void* p;
+ while=20
+ ((UInt)(mymalloc_area+mymalloc_used) & 0xFFF)
+ mymalloc_used++;
+ assert(mymalloc_used+n < MYMALLOC_MAX);
+ p =3D (void*)(&mymalloc_area[mymalloc_used]);
+ mymalloc_used +=3D n;
+ // printf("mymalloc(%d) =3D %p\n", n, p);
+ return p;
+}
+
+void myfree ( void* p )
+{
+}
+
+
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
@@ -190,7 +211,7 @@
static void addProddableBlock ( ObjectCode* oc, void* start, int size )
{
ProddableBlock* pb
- =3D malloc(sizeof(ProddableBlock));
+ =3D mymalloc(sizeof(ProddableBlock));
if (debug_linker)
fprintf(stderr, "aPB oc=3D%p %p %d (%p .. %p)\n", oc, start, siz=
e,
start, ((char*)start)+size-1 );
@@ -241,19 +262,19 @@
=20
static StringMap* new_StringMap ( void )
{
- StringMap* sm =3D malloc(sizeof(StringMap));
+ StringMap* sm =3D mymalloc(sizeof(StringMap));
sm->sm_size =3D 10;
sm->sm_used =3D 0;
- sm->maplets =3D malloc(10 * sizeof(Maplet));
+ sm->maplets =3D mymalloc(10 * sizeof(Maplet));
return sm;
}
=20
static void delete_StringMap ( StringMap* sm )
{
assert(sm->maplets !=3D NULL);
- free(sm->maplets);
+ myfree(sm->maplets);
sm->maplets =3D NULL;
- free(sm);
+ myfree(sm);
}
=20
static void ensure_StringMap ( StringMap* sm )
@@ -264,10 +285,10 @@
if (sm->sm_used < sm->sm_size)
return;
sm->sm_size *=3D 2;
- mp2 =3D malloc(sm->sm_size * sizeof(Maplet));
+ mp2 =3D mymalloc(sm->sm_size * sizeof(Maplet));
for (i =3D 0; i < sm->sm_used; i++)
mp2[i] =3D sm->maplets[i];
- free(sm->maplets);
+ myfree(sm->maplets);
sm->maplets =3D mp2;
}
=20
@@ -1161,7 +1182,7 @@
nent =3D shdr[i].sh_size / sizeof(Elf_Sym);
=20
oc->n_symbols =3D nent;
- oc->symbols =3D malloc(oc->n_symbols * sizeof(char*));
+ oc->symbols =3D mymalloc(oc->n_symbols * sizeof(char*));
=20
for (j =3D 0; j < nent; j++) {
=20
@@ -1180,7 +1201,7 @@
# else
ad =3D calloc(1, stab[j].st_size);
# endif
- assert( Ptr_to_ULong(ad) < 0xF0000000ULL );
+ // assert( Ptr_to_ULong(ad) < 0xF0000000ULL );
=20
if (0)
fprintf(stderr, "COMMON symbol, size %lld name %s allocd %p=
\n",
@@ -1308,7 +1329,7 @@
}
}
=20
- oc =3D malloc(sizeof(ObjectCode));
+ oc =3D mymalloc(sizeof(ObjectCode));
=20
oc->formatName =3D "ELF";
=20
@@ -1316,7 +1337,7 @@
if (r =3D=3D -1) { return 0; }
=20
/* sigh, strdup() isn't a POSIX function, so do it the long way */
- oc->fileName =3D malloc( strlen(path)+1 );
+ oc->fileName =3D mymalloc( strlen(path)+1 );
strcpy(oc->fileName, path);
=20
oc->fileSize =3D st.st_size;
@@ -1343,8 +1364,9 @@
relocations for jump distances > 64M. */
=20
pagesize =3D getpagesize();
- p =3D memalign(pagesize, N_FIXUP_PAGES * pagesize
- + oc->fileSize);
+ // p =3D memalign(pagesize, N_FIXUP_PAGES * pagesize
+ // + oc->fileSize);
+ p =3D mymalloc(N_FIXUP_PAGES * pagesize + oc->fileSize);
if (0) fprintf(stderr,"XXXX p =3D %p\n", p);
if (p =3D=3D NULL) {
fprintf(stderr,"loadObj: failed to allocate space for `%s'\n", pat=
h);
Modified: trunk/switchback/linker.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/switchback/linker.h 2005-07-18 11:38:58 UTC (rev 1273)
+++ trunk/switchback/linker.h 2005-07-18 11:39:47 UTC (rev 1274)
@@ -1,3 +1,5 @@
=20
extern
void* linker_top_level_LINK ( int n_object_names, char** object_names );
+
+extern void* mymalloc ( int );
Modified: trunk/switchback/switchback.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/switchback/switchback.c 2005-07-18 11:38:58 UTC (rev 1273)
+++ trunk/switchback/switchback.c 2005-07-18 11:39:47 UTC (rev 1274)
@@ -67,8 +67,8 @@
/* 2: show selected insns */
/* 1: show after reg-alloc */
/* 0: show final assembly */
-#define TEST_FLAGS (1<<7)|(1<<3)|(1<<2)|(1<<1) //|(1<<0)
-#define DEBUG_TRACE_FLAGS 0//(1<<7)|(0<<6)|(0<<5)|(0<<4)|(1<<3)|(1<<2)|(=
1<<1)|(1<<0)
+#define TEST_FLAGS (1<<7)|(1<<3)|(1<<2)|(1<<1)|(0<<0)
+#define DEBUG_TRACE_FLAGS 0 //(1<<7)|(0<<6)|(0<<5)|(0<<4)|(1<<3)|(1<<2)|=
(1<<1)|(0<<0)
=20
=20
/* guest state */
@@ -79,8 +79,10 @@
/* only used for the switchback transition */
/* i386: helper1 =3D &gst, helper2 =3D %EFLAGS */
/* amd64: helper1 =3D &gst, helper2 =3D %EFLAGS */
+/* ppc32: helper1 =3D &gst, helper2 =3D %CR, helper3 =3D %XER */
HWord sb_helper1 =3D 0;
HWord sb_helper2 =3D 0;
+HWord sb_helper3 =3D 0;
=20
/* translation cache */
#define N_TRANS_CACHE 1000000
@@ -214,24 +216,24 @@
" lwz %r31,sb_helper1@l(%r31)\n" // load word of guest_state_ptr to r=
31
=20
// LR
-" lwz %r3,388(%r31)\n" // guest_LR
+" lwz %r3,900(%r31)\n" // guest_LR
" mtlr %r3\n" // move to LR
=20
// CR
" lis %r3,sb_helper2@ha\n" // get hi-wd of flags addr
" lwz %r3,sb_helper2@l(%r3)\n" // load flags word to r3
" mtcr %r3\n" // move r3 to CR
-" lwz %r3,408(%r31)\n" // guest_CR0to6
-" mtcrf 0x3F,%r3\n" // set remaining fields of CR
=20
// CTR
-" lwz %r3,392(%r31)\n" // guest_CTR
+" lwz %r3,904(%r31)\n" // guest_CTR
" mtctr %r3\n" // move r3 to CTR
=20
// XER
-" lwz %r3,416(%r31)\n" // guest_XER
-" mtxer %r3\n" // move r3 to XER
+" lis %r3,sb_helper3@ha\n" // get hi-wd of xer addr
+" lwz %r3,sb_helper3@l(%r3)\n" // load xer word to r3
+" mtxer %r3\n" // move r3 to XER
=20
+
// GPR's
" lwz %r0, 0(%r31)\n"
" lwz %r1, 4(%r31)\n" // switch stacks (r1 =3D SP)
@@ -292,7 +294,7 @@
printf("nbytes =3D %d, nopstart =3D %d\n", nbytes, off_nopstart);
=20
/* copy it into mallocville */
- UChar* copy =3D malloc(nbytes);
+ UChar* copy =3D mymalloc(nbytes);
assert(copy);
for (i =3D 0; i < nbytes; i++)
copy[i] =3D sa_start[i];
@@ -303,6 +305,12 @@
Addr32 where_to_go =3D gst.guest_CIA;
Int diff =3D ((Int)where_to_go) - ((Int)addr_of_nop);
=20
+#if 0
+ printf("addr of first nop =3D 0x%x\n", addr_of_nop);
+ printf("where to go =3D 0x%x\n", where_to_go);
+ printf("diff =3D 0x%x\n", diff);
+#endif
+
if (diff < -0x2000000 || diff >=3D 0x2000000) {
// we're hosed. Give up
printf("hosed -- offset too large\n");
@@ -310,16 +318,12 @@
}
=20
sb_helper1 =3D (HWord)&gst;
- sb_helper2 =3D LibVEX_GuestPPC32_get_cr7(&gst);
+ sb_helper2 =3D LibVEX_GuestPPC32_get_CR(&gst);
+ sb_helper3 =3D LibVEX_GuestPPC32_get_XER(&gst);
=20
/* stay sane ... */
assert(p[0] =3D=3D 24<<26); /* nop */
=20
-#if 0
- printf("addr of first nop =3D 0x%x\n", addr_of_nop);
- printf("where to go =3D 0x%x\n", where_to_go);
- printf("diff =3D %d\n", diff);
-#endif
/* branch to diff */
p[0] =3D ((18<<26) | (((diff >> 2) & 0xFFFFFF) << 2) | (0<<1) | (0<<0=
));
=20
@@ -489,7 +493,7 @@
*/
Bool run_translation ( HWord translation )
{
- if (DEBUG_TRACE_FLAGS) {
+ if (0 && DEBUG_TRACE_FLAGS) {
printf(" run translation %p\n", (void*)translation );
printf(" simulated bb: %llu\n", n_bbs_done);
}
@@ -776,7 +780,7 @@
LibVEX_default_VexControl(&vcon);
vcon.guest_max_insns=3D50;
vcon.guest_chase_thresh=3D0;
-// vcon.iropt_level=3D2;
+ vcon.iropt_level=3D2;
=20
LibVEX_Init( failure_exit, log_bytes, 1, False, &vcon );
LibVEX_Guest_initialise(&gst);
|
|
From: <sv...@va...> - 2005-07-18 11:39:03
|
Author: sewardj
Date: 2005-07-18 12:38:58 +0100 (Mon, 18 Jul 2005)
New Revision: 1273
Log:
Track API changes in r1272.
Modified:
trunk/auxprogs/genoffsets.c
Modified: trunk/auxprogs/genoffsets.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/genoffsets.c 2005-07-18 11:38:02 UTC (rev 1272)
+++ trunk/auxprogs/genoffsets.c 2005-07-18 11:38:58 UTC (rev 1273)
@@ -91,12 +91,9 @@
printf("#define OFFSET_ppc32_CIA %3d\n",
offsetof(VexGuestPPC32State,guest_CIA));
=20
- printf("#define OFFSET_ppc32_CC_OP %3d\n",
- offsetof(VexGuestPPC32State,guest_CC_OP));
+ printf("#define OFFSET_ppc32_CR0_0 %3d\n",
+ offsetof(VexGuestPPC32State,guest_CR0_0));
=20
- printf("#define OFFSET_ppc32_CC_DEP1 %3d\n",
- offsetof(VexGuestPPC32State,guest_CC_DEP1));
-
printf("\n");
=20
return 0;
|
|
From: <sv...@va...> - 2005-07-18 11:38:07
|
Author: sewardj
Date: 2005-07-18 12:38:02 +0100 (Mon, 18 Jul 2005)
New Revision: 1272
Log:
Some changes to the ppc32 compilation pipeline, with two aims:
* to achieve code quality comparable with x86/amd64 pipelines
* to make the value flow clearer to memcheck, in the hope of=20
reducing the very high false error rate it gives on ppc
Code quality is substantially improved, but the error rate is just as
high as it was before. Needs investigation.
Many instructions are now commented out -- mostly they just need
commenting back in. Simple integer programs (date, ls, xfontsel)
work.
Front end changes
~~~~~~~~~~~~~~~~
Change the way CR and XER are represented, and hence redo the way
integer comparisons and conditional branches work:
* Introduce a two new IR primops CmpORD32S and CmpORD32U; these do
ppc-style 3-way comparisons (<, >, =3D=3D). It's hard to simulate ppc
efficiently without them. Use these to implement integer compares.
* Get rid of all thunks for condition codes -- CR and XER state
is always up to date now.
* Split XER into four fields and CR into 16 fields, so that
their various components can be accessed directly without
endless shifting and masking. Created suitable impedance
matching functions to read/write XER and CR as a whole.
* Use hardware BI numbering throughout.
Back end changes
~~~~~~~~~~~~~~~
* Simplify condition code handling and use hardware BI numbering
throughout
* Reduce the number of instruction kinds by merging integer subtracts
and shifts into PPC32Instr_Alu32. Use rlwimi to do Shl/Shr by
immediate.
* Create a copy of PPC32RI (reg-or-imm) called PPC32RH
(reg-or-halfword-imm), and give the latter a flag indicating whether
the imm is regarded as signed or not. Use PPC32RH in most places
where PPC32RI was used before.
* Add instruction selection functions to compute a value into a
PPC32RI, a PPC32RH of specified signedness, and a PPC32RH variant in
which the immediate is unsigned and in the range 1 .. 31 inclusive
(used for shifts-by-immediate).
* Simplify PPC32Instr_MulL; all 3 operands are now simply registers.
* Add a new (fake) insn PPC32Instr_LI32 to get arbitrary 32-bit
immediates into int registers; this hides all the ugly li vs lis/ori=20
details.
* Handle CmpORD32{S,U}.
Modified:
trunk/priv/guest-ppc32/gdefs.h
trunk/priv/guest-ppc32/ghelpers.c
trunk/priv/guest-ppc32/toIR.c
trunk/priv/host-ppc32/hdefs.c
trunk/priv/host-ppc32/hdefs.h
trunk/priv/host-ppc32/isel.c
trunk/priv/ir/irdefs.c
trunk/priv/ir/iropt.c
trunk/pub/libvex_guest_ppc32.h
trunk/pub/libvex_ir.h
[... diff too large to include ...]
|
|
From: Duncan S. <bal...@fr...> - 2005-07-18 11:27:50
|
> More floating point problems: wrong mantissa. > This could also be due to floating point > accuracy problems introduced by valgrind > causing the calculated mantissa to be off. This passes with valgrind-2.4.0. Ciao, Duncan. |
|
From: Duncan S. <bal...@fr...> - 2005-07-18 11:26:43
|
> Excessive floating point precision loss when run > under valgrind. I guess valgrind is not perfectly > IEEE conformant. These all pass with valgrind-2.4.0. Ciao, Duncan. |