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
(14) |
2
(12) |
3
(14) |
4
(12) |
5
(15) |
6
(12) |
7
(20) |
|
8
(10) |
9
(2) |
10
(8) |
11
(12) |
12
(20) |
13
(12) |
14
(15) |
|
15
(12) |
16
(17) |
17
(16) |
18
(10) |
19
(7) |
20
(7) |
21
(9) |
|
22
(4) |
23
(8) |
24
(4) |
25
|
26
(8) |
27
(5) |
28
(10) |
|
29
(6) |
30
(20) |
31
(9) |
|
|
|
|
|
From: <sv...@va...> - 2015-03-10 21:31:14
|
Author: florian
Date: Tue Mar 10 21:31:06 2015
New Revision: 14999
Log:
Update release notes with ICC contact.
Modified:
trunk/docs/internals/release-HOWTO.txt
Modified: trunk/docs/internals/release-HOWTO.txt
==============================================================================
--- trunk/docs/internals/release-HOWTO.txt (original)
+++ trunk/docs/internals/release-HOWTO.txt Tue Mar 10 21:31:06 2015
@@ -57,6 +57,8 @@
- Consider upgrading the C++ demangler.
auxprogs/update-demangler helps with that
+- Contact Gregory Czajkowski ( gre...@ya... ) and ask him
+ to build (make && make check) valgrind with ICC.
For each release candidate (should do release candidates for feature
releases, bug-fix-only releases might not need one):
|
|
From: <sv...@va...> - 2015-03-10 20:48:15
|
Author: florian
Date: Tue Mar 10 20:48:07 2015
New Revision: 14998
Log:
Announce support for Intel's ICC compiler. Fixes BZ #339542.
Modified:
trunk/NEWS
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Tue Mar 10 20:48:07 2015
@@ -34,6 +34,9 @@
number of threads valgrind can handle. The default is 500 threads
which should be more than enough for most applications.
+* Valgrind can be built with Intel's ICC compiler. The required
+ compiler version is 14.0 or later.
+
* ==================== FIXED BUGS ====================
The following bugs have been fixed or resolved. Note that "n-i-bz"
@@ -68,6 +71,7 @@
339156 gdbsrv not called for fatal signal
339288 support Cavium Octeon MIPS specific BBIT*32 instructions
339442 Fix testsuite build failure on OS X 10.9
+339542 Enable compilation with Intel's ICC compiler
339688 Mac-specific ASM does not support .version directive (cpuid,
tronical and pushfpopf tests)
339745 Valgrind crash when check Marmalade app (partial fix)
|
|
From: <sv...@va...> - 2015-03-10 20:47:06
|
Author: florian
Date: Tue Mar 10 20:46:58 2015
New Revision: 14997
Log:
Issue a warning if a function has more than 5 million bytes of
code. Previously functions exceeding that size were observed in the
field. Assert for 100x that amount.
Modified:
trunk/coregrind/m_debuginfo/storage.c
Modified: trunk/coregrind/m_debuginfo/storage.c
==============================================================================
--- trunk/coregrind/m_debuginfo/storage.c (original)
+++ trunk/coregrind/m_debuginfo/storage.c Tue Mar 10 20:46:58 2015
@@ -692,13 +692,19 @@
/* sanity */
vg_assert(len > 0);
- /* If this fails, the implication is you have a single procedure
+ /* Issue a warning if LEN is unexpectedly large (exceeds 5 million).
+ The implication is you have a single procedure
with more than 5 million bytes of code. Which is pretty
unlikely. Either that, or the debuginfo reader is somehow
broken. 5 million is of course arbitrary; but it's big enough
to be bigger than the size of any plausible piece of code that
- would fall within a single procedure. */
- vg_assert(len < 5000000);
+ would fall within a single procedure. But occasionally it does
+ happen (c.f. BZ #339542). */
+ if (len >= 5000000)
+ VG_(message)(Vg_DebugMsg,
+ "warning: DiCfSI %#lx .. %#lx is huge; length = %u (%s)\n",
+ base, base + len - 1, len, di->soname);
+ vg_assert(len < 500000000);
vg_assert(di->fsm.have_rx_map && di->fsm.have_rw_map);
/* Find mapping where at least one end of the CFSI falls into. */
|
|
From: <sv...@va...> - 2015-03-10 18:53:23
|
Author: carll
Date: Tue Mar 10 18:53:15 2015
New Revision: 14996
Log:
Updated the NEWS file
bugzilla 343597 - ppc64le: incorrect use of offseof macro fixed 3/10/2015
Issue found by Florian Krohm who also suggested the fix. The fix was
made and tested by Carl Love.
VEX commit number 3100
Modified:
trunk/NEWS
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Tue Mar 10 18:53:15 2015
@@ -133,7 +133,7 @@
n-i-bz Old STABS code is still being compiled, but never used. Remove it.
n-i-bz Fix compilation on distros with glibc < 2.5
n-i-bz (vex 3098) Avoid generation of Neon insns on non-Neon hosts
-
+343597 ppc64le: incorrect use of offseof macro
Release 3.10.1 (25 November 2014)
|
|
From: <sv...@va...> - 2015-03-10 18:51:43
|
Author: carll
Date: Tue Mar 10 18:51:36 2015
New Revision: 3100
Log:
Fix for bugzilla 343597 - ppc64le: incorrect use of offseof macro
Issue found by Florian Krohm who also suggested the fix. The fix was
made and tested by Carl Love.
Modified:
trunk/priv/guest_ppc_toIR.c
Modified: trunk/priv/guest_ppc_toIR.c
==============================================================================
--- trunk/priv/guest_ppc_toIR.c (original)
+++ trunk/priv/guest_ppc_toIR.c Tue Mar 10 18:51:36 2015
@@ -1171,38 +1171,38 @@
if (host_endness == VexEndnessLE) {
switch (archreg) {
- case 0: return offsetofPPCGuestState(guest_VSR0 + 8);
- case 1: return offsetofPPCGuestState(guest_VSR1 + 8);
- case 2: return offsetofPPCGuestState(guest_VSR2 + 8);
- case 3: return offsetofPPCGuestState(guest_VSR3 + 8);
- case 4: return offsetofPPCGuestState(guest_VSR4 + 8);
- case 5: return offsetofPPCGuestState(guest_VSR5 + 8);
- case 6: return offsetofPPCGuestState(guest_VSR6 + 8);
- case 7: return offsetofPPCGuestState(guest_VSR7 + 8);
- case 8: return offsetofPPCGuestState(guest_VSR8 + 8);
- case 9: return offsetofPPCGuestState(guest_VSR9 + 8);
- case 10: return offsetofPPCGuestState(guest_VSR10 + 8);
- case 11: return offsetofPPCGuestState(guest_VSR11 + 8);
- case 12: return offsetofPPCGuestState(guest_VSR12 + 8);
- case 13: return offsetofPPCGuestState(guest_VSR13 + 8);
- case 14: return offsetofPPCGuestState(guest_VSR14 + 8);
- case 15: return offsetofPPCGuestState(guest_VSR15 + 8);
- case 16: return offsetofPPCGuestState(guest_VSR16 + 8);
- case 17: return offsetofPPCGuestState(guest_VSR17 + 8);
- case 18: return offsetofPPCGuestState(guest_VSR18 + 8);
- case 19: return offsetofPPCGuestState(guest_VSR19 + 8);
- case 20: return offsetofPPCGuestState(guest_VSR20 + 8);
- case 21: return offsetofPPCGuestState(guest_VSR21 + 8);
- case 22: return offsetofPPCGuestState(guest_VSR22 + 8);
- case 23: return offsetofPPCGuestState(guest_VSR23 + 8);
- case 24: return offsetofPPCGuestState(guest_VSR24 + 8);
- case 25: return offsetofPPCGuestState(guest_VSR25 + 8);
- case 26: return offsetofPPCGuestState(guest_VSR26 + 8);
- case 27: return offsetofPPCGuestState(guest_VSR27 + 8);
- case 28: return offsetofPPCGuestState(guest_VSR28 + 8);
- case 29: return offsetofPPCGuestState(guest_VSR29 + 8);
- case 30: return offsetofPPCGuestState(guest_VSR30 + 8);
- case 31: return offsetofPPCGuestState(guest_VSR31 + 8);
+ case 0: return offsetofPPCGuestState(guest_VSR0) + 8;
+ case 1: return offsetofPPCGuestState(guest_VSR1) + 8;
+ case 2: return offsetofPPCGuestState(guest_VSR2) + 8;
+ case 3: return offsetofPPCGuestState(guest_VSR3) + 8;
+ case 4: return offsetofPPCGuestState(guest_VSR4) + 8;
+ case 5: return offsetofPPCGuestState(guest_VSR5) + 8;
+ case 6: return offsetofPPCGuestState(guest_VSR6) + 8;
+ case 7: return offsetofPPCGuestState(guest_VSR7) + 8;
+ case 8: return offsetofPPCGuestState(guest_VSR8) + 8;
+ case 9: return offsetofPPCGuestState(guest_VSR9) + 8;
+ case 10: return offsetofPPCGuestState(guest_VSR10) + 8;
+ case 11: return offsetofPPCGuestState(guest_VSR11) + 8;
+ case 12: return offsetofPPCGuestState(guest_VSR12) + 8;
+ case 13: return offsetofPPCGuestState(guest_VSR13) + 8;
+ case 14: return offsetofPPCGuestState(guest_VSR14) + 8;
+ case 15: return offsetofPPCGuestState(guest_VSR15) + 8;
+ case 16: return offsetofPPCGuestState(guest_VSR16) + 8;
+ case 17: return offsetofPPCGuestState(guest_VSR17) + 8;
+ case 18: return offsetofPPCGuestState(guest_VSR18) + 8;
+ case 19: return offsetofPPCGuestState(guest_VSR19) + 8;
+ case 20: return offsetofPPCGuestState(guest_VSR20) + 8;
+ case 21: return offsetofPPCGuestState(guest_VSR21) + 8;
+ case 22: return offsetofPPCGuestState(guest_VSR22) + 8;
+ case 23: return offsetofPPCGuestState(guest_VSR23) + 8;
+ case 24: return offsetofPPCGuestState(guest_VSR24) + 8;
+ case 25: return offsetofPPCGuestState(guest_VSR25) + 8;
+ case 26: return offsetofPPCGuestState(guest_VSR26) + 8;
+ case 27: return offsetofPPCGuestState(guest_VSR27) + 8;
+ case 28: return offsetofPPCGuestState(guest_VSR28) + 8;
+ case 29: return offsetofPPCGuestState(guest_VSR29) + 8;
+ case 30: return offsetofPPCGuestState(guest_VSR30) + 8;
+ case 31: return offsetofPPCGuestState(guest_VSR31) + 8;
default: break;
}
} else {
|
Author: florian
Date: Tue Mar 10 16:13:59 2015
New Revision: 14995
Log:
Add support for building with -fsanitize=undefined.
- add configure option --enable-ubsan
- add __ubsan helpers (by Julian)
This requires gcc 4.9.2 or later. Not all platforms are supported, though.
With this change and VEX r3099 regression tests pass on amd64
with a valgrind compiled with -fsanitize=undefined.
Modified:
trunk/Makefile.all.am
trunk/auxprogs/Makefile.am
trunk/configure.ac
trunk/coregrind/Makefile.am
trunk/coregrind/m_compiler.c
trunk/coregrind/m_libcbase.c
trunk/memcheck/tests/vbit-test/Makefile.am
Modified: trunk/Makefile.all.am
==============================================================================
--- trunk/Makefile.all.am (original)
+++ trunk/Makefile.all.am Tue Mar 10 16:13:59 2015
@@ -111,6 +111,7 @@
@FLAG_W_FORMAT@ \
@FLAG_W_FORMAT_SECURITY@ \
@FLAG_FNO_STACK_PROTECTOR@ \
+ @FLAG_FSANITIZE@ \
-fno-strict-aliasing \
-fno-builtin
Modified: trunk/auxprogs/Makefile.am
==============================================================================
--- trunk/auxprogs/Makefile.am (original)
+++ trunk/auxprogs/Makefile.am Tue Mar 10 16:13:59 2015
@@ -72,7 +72,7 @@
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = $(AM_CFLAGS_PRI)
+getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
if HAVE_DLINFO_RTLD_DI_TLS_MODID
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = $(LDADD) -ldl
endif
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Tue Mar 10 16:13:59 2015
@@ -827,6 +827,16 @@
VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml
fi
+#----------------------------------------------------------------------------
+# Undefined behaviour sanitiser
+#----------------------------------------------------------------------------
+# Check whether we should build with the undefined beahviour sanitiser.
+
+AC_CACHE_CHECK([for using the undefined behaviour sanitiser], vg_cv_ubsan,
+ [AC_ARG_ENABLE(ubsan,
+ [ --enable-ubsan enables the undefined behaviour sanitiser],
+ [vg_cv_ubsan=$enableval],
+ [vg_cv_ubsan=no])])
#----------------------------------------------------------------------------
# Define MIPS_PAGE_SHIFT (--with-pagesize)
@@ -1777,6 +1787,28 @@
AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
+
+# Does this compiler support -fsanitize=undefined?
+# Only checked for if --enable-ubsan was given.
+if test "x${vg_cv_ubsan}" = "xyes"; then
+AC_MSG_CHECKING([if gcc accepts -fsanitize=undefined])
+safe_CFLAGS=$CFLAGS
+CFLAGS="-fsanitize=undefined"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+ return 0;
+]])], [
+FLAG_FSANITIZE="-fsanitize=undefined"
+LIB_UBSAN="-static-libubsan"
+AC_MSG_RESULT([yes])
+], [
+FLAG_FSANITIZE=""
+LIB_UBSAN=""
+AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+AC_SUBST(FLAG_FSANITIZE)
+AC_SUBST(LIB_UBSAN)
+fi
# does this compiler support --param inline-unit-growth=... ?
AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
Modified: trunk/coregrind/Makefile.am
==============================================================================
--- trunk/coregrind/Makefile.am (original)
+++ trunk/coregrind/Makefile.am Tue Mar 10 16:13:59 2015
@@ -48,7 +48,7 @@
valgrind_CPPFLAGS = $(AM_CPPFLAGS_PRI)
valgrind_CFLAGS = $(AM_CFLAGS_PRI)
valgrind_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-valgrind_LDFLAGS = $(AM_CFLAGS_PRI)
+valgrind_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
valgrind_LDFLAGS += -Wl,-read_only_relocs -Wl,suppress
endif
@@ -77,7 +77,7 @@
vgdb_CPPFLAGS = $(AM_CPPFLAGS_PRI)
vgdb_CFLAGS = $(AM_CFLAGS_PRI)
vgdb_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-vgdb_LDFLAGS = $(AM_CFLAGS_PRI)
+vgdb_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
if VGCONF_PLATVARIANT_IS_ANDROID
vgdb_CFLAGS += -static
endif
Modified: trunk/coregrind/m_compiler.c
==============================================================================
--- trunk/coregrind/m_compiler.c (original)
+++ trunk/coregrind/m_compiler.c Tue Mar 10 16:13:59 2015
@@ -39,6 +39,8 @@
#include "config.h"
#include "pub_core_basics.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
+#include "pub_core_debuglog.h"
#ifndef HAVE_BUILTIN_POPCOUT
@@ -218,6 +220,81 @@
#endif
+
+/*====================================================================*/
+/*=== gcc -fsanitize=undefined helper function support ===*/
+/*====================================================================*/
+
+void __ubsan_handle_type_mismatch ( void );
+void __ubsan_handle_type_mismatch ( void )
+{
+ VG_(debugLog)(0, "main:ubsan", "In %s", __func__);
+ vg_assert(0);
+}
+
+void __ubsan_handle_mul_overflow ( void );
+void __ubsan_handle_mul_overflow ( void )
+{
+ VG_(debugLog)(0, "main:ubsan", "In %s", __func__);
+ vg_assert(0);
+}
+
+void __ubsan_handle_add_overflow ( void );
+void __ubsan_handle_add_overflow ( void )
+{
+ VG_(debugLog)(0, "main:ubsan", "In %s", __func__);
+ vg_assert(0);
+}
+
+void __ubsan_handle_sub_overflow ( void );
+void __ubsan_handle_sub_overflow ( void )
+{
+ VG_(debugLog)(0, "main:ubsan", "In %s", __func__);
+ vg_assert(0);
+}
+
+void __ubsan_handle_divrem_overflow ( void );
+void __ubsan_handle_divrem_overflow ( void )
+{
+ VG_(debugLog)(0, "main:ubsan", "In %s", __func__);
+ vg_assert(0);
+}
+
+void __ubsan_handle_negate_overflow ( void );
+void __ubsan_handle_negate_overflow ( void )
+{
+ VG_(debugLog)(0, "main:ubsan", "In %s", __func__);
+ vg_assert(0);
+}
+
+void __ubsan_handle_out_of_bounds ( void );
+void __ubsan_handle_out_of_bounds ( void )
+{
+ VG_(debugLog)(0, "main:ubsan", "In %s", __func__);
+ vg_assert(0);
+}
+
+void __ubsan_handle_shift_out_of_bounds ( void );
+void __ubsan_handle_shift_out_of_bounds ( void )
+{
+ VG_(debugLog)(0, "main:ubsan", "In %s", __func__);
+ vg_assert(0);
+}
+
+void __ubsan_handle_vla_bound_not_positive ( void );
+void __ubsan_handle_vla_bound_not_positive ( void )
+{
+ VG_(debugLog)(0, "main:ubsan", "In %s", __func__);
+ vg_assert(0);
+}
+
+void __ubsan_handle_nonnull_arg ( void );
+void __ubsan_handle_nonnull_arg ( void )
+{
+ VG_(debugLog)(0, "main:ubsan", "In %s", __func__);
+ vg_assert(0);
+}
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_libcbase.c
==============================================================================
--- trunk/coregrind/m_libcbase.c (original)
+++ trunk/coregrind/m_libcbase.c Tue Mar 10 16:13:59 2015
@@ -694,28 +694,30 @@
void* VG_(memset) ( void *destV, Int c, SizeT sz )
{
- Int c4;
- HChar* d = (HChar*)destV;
+ UInt c4;
+ UChar* d = destV;
+ UChar uc = c;
+
while ((!VG_IS_4_ALIGNED(d)) && sz >= 1) {
- d[0] = c;
+ d[0] = uc;
d++;
sz--;
}
if (sz == 0)
return destV;
- c4 = c & 0xFF;
+ c4 = uc;
c4 |= (c4 << 8);
c4 |= (c4 << 16);
while (sz >= 16) {
- ((Int*)d)[0] = c4;
- ((Int*)d)[1] = c4;
- ((Int*)d)[2] = c4;
- ((Int*)d)[3] = c4;
+ ((UInt*)d)[0] = c4;
+ ((UInt*)d)[1] = c4;
+ ((UInt*)d)[2] = c4;
+ ((UInt*)d)[3] = c4;
d += 16;
sz -= 16;
}
while (sz >= 4) {
- ((Int*)d)[0] = c4;
+ ((UInt*)d)[0] = c4;
d += 4;
sz -= 4;
}
Modified: trunk/memcheck/tests/vbit-test/Makefile.am
==============================================================================
--- trunk/memcheck/tests/vbit-test/Makefile.am (original)
+++ trunk/memcheck/tests/vbit-test/Makefile.am Tue Mar 10 16:13:59 2015
@@ -40,4 +40,4 @@
vbit_test_CFLAGS = $(AM_CFLAGS_PRI) -std=c99
vbit_test_DEPENDENCIES =
vbit_test_LDADD =
-vbit_test_LDFLAGS = $(AM_CFLAGS_PRI) -std=c99
+vbit_test_LDFLAGS = $(AM_CFLAGS_PRI) -std=c99 @LIB_UBSAN@
|
Author: florian
Date: Tue Mar 10 16:11:58 2015
New Revision: 3099
Log:
Fix a few undefined behaviours that were found by compiling valgrind
with GCC 4.9.2 using -fsanitize=undefined and running the testsuite.
Modified:
trunk/priv/guest_amd64_helpers.c
trunk/priv/guest_amd64_toIR.c
trunk/priv/guest_x86_helpers.c
trunk/priv/guest_x86_toIR.c
trunk/priv/host_amd64_defs.c
trunk/priv/host_amd64_isel.c
trunk/priv/host_generic_simd128.c
trunk/priv/host_x86_defs.c
trunk/priv/ir_opt.c
Modified: trunk/priv/guest_amd64_helpers.c
==============================================================================
--- trunk/priv/guest_amd64_helpers.c (original)
+++ trunk/priv/guest_amd64_helpers.c Tue Mar 10 16:11:58 2015
@@ -151,7 +151,7 @@
static inline Long lshift ( Long x, Int n )
{
if (n >= 0)
- return x << n;
+ return (ULong)x << n;
else
return x >> (-n);
}
@@ -190,8 +190,8 @@
#define ACTIONS_ADD(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
- Long argL, argR, res; \
+ { ULong cf, pf, af, zf, sf, of; \
+ ULong argL, argR, res; \
argL = CC_DEP1; \
argR = CC_DEP2; \
res = argL + argR; \
@@ -211,8 +211,8 @@
#define ACTIONS_SUB(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
- Long argL, argR, res; \
+ { ULong cf, pf, af, zf, sf, of; \
+ ULong argL, argR, res; \
argL = CC_DEP1; \
argR = CC_DEP2; \
res = argL - argR; \
@@ -232,8 +232,8 @@
#define ACTIONS_ADC(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
- Long argL, argR, oldC, res; \
+ { ULong cf, pf, af, zf, sf, of; \
+ ULong argL, argR, oldC, res; \
oldC = CC_NDEP & AMD64G_CC_MASK_C; \
argL = CC_DEP1; \
argR = CC_DEP2 ^ oldC; \
@@ -257,8 +257,8 @@
#define ACTIONS_SBB(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
- Long argL, argR, oldC, res; \
+ { ULong cf, pf, af, zf, sf, of; \
+ ULong argL, argR, oldC, res; \
oldC = CC_NDEP & AMD64G_CC_MASK_C; \
argL = CC_DEP1; \
argR = CC_DEP2 ^ oldC; \
@@ -282,7 +282,7 @@
#define ACTIONS_LOGIC(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
+ { ULong cf, pf, af, zf, sf, of; \
cf = 0; \
pf = parity_table[(UChar)CC_DEP1]; \
af = 0; \
@@ -298,8 +298,8 @@
#define ACTIONS_INC(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
- Long argL, argR, res; \
+ { ULong cf, pf, af, zf, sf, of; \
+ ULong argL, argR, res; \
res = CC_DEP1; \
argL = res - 1; \
argR = 1; \
@@ -318,8 +318,8 @@
#define ACTIONS_DEC(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
- Long argL, argR, res; \
+ { ULong cf, pf, af, zf, sf, of; \
+ ULong argL, argR, res; \
res = CC_DEP1; \
argL = res + 1; \
argR = 1; \
@@ -339,7 +339,7 @@
#define ACTIONS_SHL(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
+ { ULong cf, pf, af, zf, sf, of; \
cf = (CC_DEP2 >> (DATA_BITS - 1)) & AMD64G_CC_MASK_C; \
pf = parity_table[(UChar)CC_DEP1]; \
af = 0; /* undefined */ \
@@ -357,7 +357,7 @@
#define ACTIONS_SHR(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
+ { ULong cf, pf, af, zf, sf, of; \
cf = CC_DEP2 & 1; \
pf = parity_table[(UChar)CC_DEP1]; \
af = 0; /* undefined */ \
@@ -377,7 +377,7 @@
#define ACTIONS_ROL(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long fl \
+ { ULong fl \
= (CC_NDEP & ~(AMD64G_CC_MASK_O | AMD64G_CC_MASK_C)) \
| (AMD64G_CC_MASK_C & CC_DEP1) \
| (AMD64G_CC_MASK_O & (lshift(CC_DEP1, \
@@ -394,7 +394,7 @@
#define ACTIONS_ROR(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long fl \
+ { ULong fl \
= (CC_NDEP & ~(AMD64G_CC_MASK_O | AMD64G_CC_MASK_C)) \
| (AMD64G_CC_MASK_C & (CC_DEP1 >> (DATA_BITS-1))) \
| (AMD64G_CC_MASK_O & (lshift(CC_DEP1, \
@@ -410,7 +410,7 @@
DATA_U2TYPE, NARROWto2U) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
+ { ULong cf, pf, af, zf, sf, of; \
DATA_UTYPE hi; \
DATA_UTYPE lo \
= NARROWtoU( ((DATA_UTYPE)CC_DEP1) \
@@ -436,7 +436,7 @@
DATA_S2TYPE, NARROWto2S) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
+ { ULong cf, pf, af, zf, sf, of; \
DATA_STYPE hi; \
DATA_STYPE lo \
= NARROWtoS( ((DATA_STYPE)CC_DEP1) \
@@ -461,7 +461,7 @@
#define ACTIONS_UMULQ \
{ \
PREAMBLE(64); \
- { Long cf, pf, af, zf, sf, of; \
+ { ULong cf, pf, af, zf, sf, of; \
ULong lo, hi; \
mullU64( (ULong)CC_DEP1, (ULong)CC_DEP2, &hi, &lo ); \
cf = (hi != 0); \
@@ -479,7 +479,7 @@
#define ACTIONS_SMULQ \
{ \
PREAMBLE(64); \
- { Long cf, pf, af, zf, sf, of; \
+ { ULong cf, pf, af, zf, sf, of; \
Long lo, hi; \
mullS64( (Long)CC_DEP1, (Long)CC_DEP2, &hi, &lo ); \
cf = (hi != (lo >>/*s*/ (64-1))); \
@@ -497,7 +497,7 @@
#define ACTIONS_ANDN(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
+ { ULong cf, pf, af, zf, sf, of; \
cf = 0; \
pf = 0; \
af = 0; \
@@ -513,7 +513,7 @@
#define ACTIONS_BLSI(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
+ { ULong cf, pf, af, zf, sf, of; \
cf = ((DATA_UTYPE)CC_DEP2 != 0); \
pf = 0; \
af = 0; \
@@ -545,7 +545,7 @@
#define ACTIONS_BLSR(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Long cf, pf, af, zf, sf, of; \
+ { ULong cf, pf, af, zf, sf, of; \
cf = ((DATA_UTYPE)CC_DEP2 == 0); \
pf = 0; \
af = 0; \
Modified: trunk/priv/guest_amd64_toIR.c
==============================================================================
--- trunk/priv/guest_amd64_toIR.c (original)
+++ trunk/priv/guest_amd64_toIR.c Tue Mar 10 16:11:58 2015
@@ -474,17 +474,17 @@
static ULong extend_s_8to64 ( UChar x )
{
- return (ULong)((((Long)x) << 56) >> 56);
+ return (ULong)((Long)(((ULong)x) << 56) >> 56);
}
static ULong extend_s_16to64 ( UShort x )
{
- return (ULong)((((Long)x) << 48) >> 48);
+ return (ULong)((Long)(((ULong)x) << 48) >> 48);
}
static ULong extend_s_32to64 ( UInt x )
{
- return (ULong)((((Long)x) << 32) >> 32);
+ return (ULong)((Long)(((ULong)x) << 32) >> 32);
}
/* Figure out whether the mod and rm parts of a modRM byte refer to a
Modified: trunk/priv/guest_x86_helpers.c
==============================================================================
--- trunk/priv/guest_x86_helpers.c (original)
+++ trunk/priv/guest_x86_helpers.c Tue Mar 10 16:11:58 2015
@@ -113,7 +113,7 @@
inline static Int lshift ( Int x, Int n )
{
if (n >= 0)
- return x << n;
+ return (UInt)x << n;
else
return x >> (-n);
}
@@ -130,7 +130,7 @@
= __data_bits==8 ? 0xFF \
: (__data_bits==16 ? 0xFFFF \
: 0xFFFFFFFF); \
- /* const */ UInt SIGN_MASK = 1 << (__data_bits - 1); \
+ /* const */ UInt SIGN_MASK = 1u << (__data_bits - 1); \
/* const */ UInt CC_DEP1 = cc_dep1_formal; \
/* const */ UInt CC_DEP2 = cc_dep2_formal; \
/* const */ UInt CC_NDEP = cc_ndep_formal; \
@@ -148,8 +148,8 @@
#define ACTIONS_ADD(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Int cf, pf, af, zf, sf, of; \
- Int argL, argR, res; \
+ { UInt cf, pf, af, zf, sf, of; \
+ UInt argL, argR, res; \
argL = CC_DEP1; \
argR = CC_DEP2; \
res = argL + argR; \
@@ -169,8 +169,8 @@
#define ACTIONS_SUB(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Int cf, pf, af, zf, sf, of; \
- Int argL, argR, res; \
+ { UInt cf, pf, af, zf, sf, of; \
+ UInt argL, argR, res; \
argL = CC_DEP1; \
argR = CC_DEP2; \
res = argL - argR; \
@@ -190,8 +190,8 @@
#define ACTIONS_ADC(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Int cf, pf, af, zf, sf, of; \
- Int argL, argR, oldC, res; \
+ { UInt cf, pf, af, zf, sf, of; \
+ UInt argL, argR, oldC, res; \
oldC = CC_NDEP & X86G_CC_MASK_C; \
argL = CC_DEP1; \
argR = CC_DEP2 ^ oldC; \
@@ -215,8 +215,8 @@
#define ACTIONS_SBB(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Int cf, pf, af, zf, sf, of; \
- Int argL, argR, oldC, res; \
+ { UInt cf, pf, af, zf, sf, of; \
+ UInt argL, argR, oldC, res; \
oldC = CC_NDEP & X86G_CC_MASK_C; \
argL = CC_DEP1; \
argR = CC_DEP2 ^ oldC; \
@@ -240,7 +240,7 @@
#define ACTIONS_LOGIC(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Int cf, pf, af, zf, sf, of; \
+ { UInt cf, pf, af, zf, sf, of; \
cf = 0; \
pf = parity_table[(UChar)CC_DEP1]; \
af = 0; \
@@ -256,8 +256,8 @@
#define ACTIONS_INC(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Int cf, pf, af, zf, sf, of; \
- Int argL, argR, res; \
+ { UInt cf, pf, af, zf, sf, of; \
+ UInt argL, argR, res; \
res = CC_DEP1; \
argL = res - 1; \
argR = 1; \
@@ -276,8 +276,8 @@
#define ACTIONS_DEC(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Int cf, pf, af, zf, sf, of; \
- Int argL, argR, res; \
+ { UInt cf, pf, af, zf, sf, of; \
+ UInt argL, argR, res; \
res = CC_DEP1; \
argL = res + 1; \
argR = 1; \
@@ -297,7 +297,7 @@
#define ACTIONS_SHL(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Int cf, pf, af, zf, sf, of; \
+ { UInt cf, pf, af, zf, sf, of; \
cf = (CC_DEP2 >> (DATA_BITS - 1)) & X86G_CC_MASK_C; \
pf = parity_table[(UChar)CC_DEP1]; \
af = 0; /* undefined */ \
@@ -315,7 +315,7 @@
#define ACTIONS_SHR(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Int cf, pf, af, zf, sf, of; \
+ { UInt cf, pf, af, zf, sf, of; \
cf = CC_DEP2 & 1; \
pf = parity_table[(UChar)CC_DEP1]; \
af = 0; /* undefined */ \
@@ -335,7 +335,7 @@
#define ACTIONS_ROL(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Int fl \
+ { UInt fl \
= (CC_NDEP & ~(X86G_CC_MASK_O | X86G_CC_MASK_C)) \
| (X86G_CC_MASK_C & CC_DEP1) \
| (X86G_CC_MASK_O & (lshift(CC_DEP1, \
@@ -352,7 +352,7 @@
#define ACTIONS_ROR(DATA_BITS,DATA_UTYPE) \
{ \
PREAMBLE(DATA_BITS); \
- { Int fl \
+ { UInt fl \
= (CC_NDEP & ~(X86G_CC_MASK_O | X86G_CC_MASK_C)) \
| (X86G_CC_MASK_C & (CC_DEP1 >> (DATA_BITS-1))) \
| (X86G_CC_MASK_O & (lshift(CC_DEP1, \
@@ -368,7 +368,7 @@
DATA_U2TYPE, NARROWto2U) \
{ \
PREAMBLE(DATA_BITS); \
- { Int cf, pf, af, zf, sf, of; \
+ { UInt cf, pf, af, zf, sf, of; \
DATA_UTYPE hi; \
DATA_UTYPE lo \
= NARROWtoU( ((DATA_UTYPE)CC_DEP1) \
@@ -394,7 +394,7 @@
DATA_S2TYPE, NARROWto2S) \
{ \
PREAMBLE(DATA_BITS); \
- { Int cf, pf, af, zf, sf, of; \
+ { UInt cf, pf, af, zf, sf, of; \
DATA_STYPE hi; \
DATA_STYPE lo \
= NARROWtoS( ((DATA_STYPE)CC_DEP1) \
Modified: trunk/priv/guest_x86_toIR.c
==============================================================================
--- trunk/priv/guest_x86_toIR.c (original)
+++ trunk/priv/guest_x86_toIR.c Tue Mar 10 16:11:58 2015
@@ -326,12 +326,12 @@
static UInt extend_s_8to32( UInt x )
{
- return (UInt)((((Int)x) << 24) >> 24);
+ return (UInt)((Int)(x << 24) >> 24);
}
static UInt extend_s_16to32 ( UInt x )
{
- return (UInt)((((Int)x) << 16) >> 16);
+ return (UInt)((Int)(x << 16) >> 16);
}
/* Fetch a byte from the guest insn stream. */
Modified: trunk/priv/host_amd64_defs.c
==============================================================================
--- trunk/priv/host_amd64_defs.c (original)
+++ trunk/priv/host_amd64_defs.c Tue Mar 10 16:11:58 2015
@@ -2059,16 +2059,15 @@
static Bool fits8bits ( UInt w32 )
{
Int i32 = (Int)w32;
- return toBool(i32 == ((i32 << 24) >> 24));
+ return toBool(i32 == ((Int)(w32 << 24) >> 24));
}
/* Can the lower 32 bits be signedly widened to produce the whole
64-bit value? In other words, are the top 33 bits either all 0 or
all 1 ? */
static Bool fitsIn32Bits ( ULong x )
{
- Long y0 = (Long)x;
- Long y1 = y0;
- y1 <<= 32;
+ Long y1;
+ y1 = x << 32;
y1 >>=/*s*/ 32;
return toBool(x == y1);
}
Modified: trunk/priv/host_amd64_isel.c
==============================================================================
--- trunk/priv/host_amd64_isel.c (original)
+++ trunk/priv/host_amd64_isel.c Tue Mar 10 16:11:58 2015
@@ -283,9 +283,8 @@
all 1 ? */
static Bool fitsIn32Bits ( ULong x )
{
- Long y0 = (Long)x;
- Long y1 = y0;
- y1 <<= 32;
+ Long y1;
+ y1 = x << 32;
y1 >>=/*s*/ 32;
return toBool(x == y1);
}
@@ -348,7 +347,7 @@
/* If uimm64 can be expressed as the sign extension of its
lower 32 bits, we can do it the easy way. */
Long simm64 = (Long)uimm64;
- if ( simm64 == ((simm64 << 32) >> 32) ) {
+ if ( simm64 == ((Long)(uimm64 << 32) >> 32) ) {
addInstr( env, AMD64Instr_Push(AMD64RMI_Imm( (UInt)uimm64 )) );
} else {
HReg tmp = newVRegI(env);
Modified: trunk/priv/host_generic_simd128.c
==============================================================================
--- trunk/priv/host_generic_simd128.c (original)
+++ trunk/priv/host_generic_simd128.c Tue Mar 10 16:11:58 2015
@@ -44,7 +44,7 @@
static inline UInt mul32 ( Int xx, Int yy )
{
- Int t = ((Int)xx) * ((Int)yy);
+ Long t = ((Long)xx) * ((Long)yy);
return toUInt(t);
}
Modified: trunk/priv/host_x86_defs.c
==============================================================================
--- trunk/priv/host_x86_defs.c (original)
+++ trunk/priv/host_x86_defs.c Tue Mar 10 16:11:58 2015
@@ -1894,7 +1894,7 @@
static Bool fits8bits ( UInt w32 )
{
Int i32 = (Int)w32;
- return toBool(i32 == ((i32 << 24) >> 24));
+ return toBool(i32 == ((Int)(w32 << 24) >> 24));
}
Modified: trunk/priv/ir_opt.c
==============================================================================
--- trunk/priv/ir_opt.c (original)
+++ trunk/priv/ir_opt.c Tue Mar 10 16:11:58 2015
@@ -1414,17 +1414,17 @@
break;
case Iop_8Sto32: {
- /* signed */ Int s32 = e->Iex.Unop.arg->Iex.Const.con->Ico.U8;
- s32 <<= 24;
- s32 >>= 24;
- e2 = IRExpr_Const(IRConst_U32((UInt)s32));
+ UInt u32 = e->Iex.Unop.arg->Iex.Const.con->Ico.U8;
+ u32 <<= 24;
+ u32 = (Int)u32 >> 24; /* signed shift */
+ e2 = IRExpr_Const(IRConst_U32(u32));
break;
}
case Iop_16Sto32: {
- /* signed */ Int s32 = e->Iex.Unop.arg->Iex.Const.con->Ico.U16;
- s32 <<= 16;
- s32 >>= 16;
- e2 = IRExpr_Const(IRConst_U32( (UInt)s32) );
+ UInt u32 = e->Iex.Unop.arg->Iex.Const.con->Ico.U16;
+ u32 <<= 16;
+ u32 = (Int)u32 >> 16; /* signed shift */
+ e2 = IRExpr_Const(IRConst_U32(u32));
break;
}
case Iop_8Uto64:
@@ -1440,10 +1440,10 @@
0xFF & e->Iex.Unop.arg->Iex.Const.con->Ico.U8));
break;
case Iop_8Sto16: {
- /* signed */ Short s16 = e->Iex.Unop.arg->Iex.Const.con->Ico.U8;
- s16 <<= 8;
- s16 >>= 8;
- e2 = IRExpr_Const(IRConst_U16( (UShort)s16) );
+ UShort u16 = e->Iex.Unop.arg->Iex.Const.con->Ico.U8;
+ u16 <<= 8;
+ u16 = (Short)u16 >> 8; /* signed shift */
+ e2 = IRExpr_Const(IRConst_U16(u16));
break;
}
case Iop_8Uto16:
@@ -1529,17 +1529,17 @@
& e->Iex.Unop.arg->Iex.Const.con->Ico.U32));
break;
case Iop_16Sto64: {
- /* signed */ Long s64 = e->Iex.Unop.arg->Iex.Const.con->Ico.U16;
- s64 <<= 48;
- s64 >>= 48;
- e2 = IRExpr_Const(IRConst_U64((ULong)s64));
+ ULong u64 = e->Iex.Unop.arg->Iex.Const.con->Ico.U16;
+ u64 <<= 48;
+ u64 = (Long)u64 >> 48; /* signed shift */
+ e2 = IRExpr_Const(IRConst_U64(u64));
break;
}
case Iop_32Sto64: {
- /* signed */ Long s64 = e->Iex.Unop.arg->Iex.Const.con->Ico.U32;
- s64 <<= 32;
- s64 >>= 32;
- e2 = IRExpr_Const(IRConst_U64((ULong)s64));
+ ULong u64 = e->Iex.Unop.arg->Iex.Const.con->Ico.U32;
+ u64 <<= 32;
+ u64 = (Long)u64 >> 32; /* signed shift */
+ e2 = IRExpr_Const(IRConst_U64(u64));
break;
}
|
|
From: <sv...@va...> - 2015-03-10 11:05:23
|
Author: sewardj
Date: Tue Mar 10 11:05:10 2015
New Revision: 14994
Log:
PRE(sys_prctl): handle PR_SET_SECCOMP.
Modified:
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/include/vki/vki-linux.h
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c Tue Mar 10 11:05:10 2015
@@ -1018,6 +1018,21 @@
case VKI_PR_SET_PTRACER:
PRE_REG_READ2(int, "prctl", int, option, int, ptracer_process_ID);
break;
+ case VKI_PR_SET_SECCOMP:
+ /* This is a bit feeble in that it uses |option| before checking
+ it, but at least both sides of the conditional check it. */
+ if (ARG2 == VKI_SECCOMP_MODE_FILTER) {
+ PRE_REG_READ3(int, "prctl", int, option, int, mode, char*, filter);
+ if (ARG3) {
+ /* Should check that ARG3 points at a valid struct sock_fprog.
+ Sounds complex; hence be lame. */
+ PRE_MEM_READ( "prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, filter)",
+ ARG3, 1 );
+ }
+ } else {
+ PRE_REG_READ2(int, "prctl", int, option, int, mode);
+ }
+ break;
default:
PRE_REG_READ5(long, "prctl",
int, option, unsigned long, arg2, unsigned long, arg3,
Modified: trunk/include/vki/vki-linux.h
==============================================================================
--- trunk/include/vki/vki-linux.h (original)
+++ trunk/include/vki/vki-linux.h Tue Mar 10 11:05:10 2015
@@ -2508,6 +2508,9 @@
# define VKI_PR_ENDIAN_BIG 0
# define VKI_PR_ENDIAN_LITTLE 1 /* True little endian mode */
# define VKI_PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */
+
+#define VKI_PR_SET_SECCOMP 22
+
#define VKI_PR_SET_PTRACER 0x59616d61
//----------------------------------------------------------------------
@@ -4601,6 +4604,12 @@
VKI_KCMP_TYPES
};
+//----------------------------------------------------------------------
+// From linux-3.19-rc5/include/uapi/linux/seccomp.h
+//----------------------------------------------------------------------
+
+#define VKI_SECCOMP_MODE_FILTER 2
+
#endif // __VKI_LINUX_H
/*--------------------------------------------------------------------*/
|