Accepting request 49170 from devel:tools

Copy from devel:tools/valgrind based on submit request 49170 from user coolo

OBS-URL: https://build.opensuse.org/request/show/49170
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/valgrind?expand=0&rev=37
This commit is contained in:
OBS User autobuild 2010-09-27 13:43:56 +00:00 committed by Git OBS Bridge
commit 4fe3f403d6
3 changed files with 111 additions and 3 deletions

101
bigger-default-stack.diff Normal file
View File

@ -0,0 +1,101 @@
------------------------------------------------------------------------
r11215 | sewardj | 2010-07-21 11:49:27 +0200 (Mi, 21. Jul 2010) | 6 Zeilen
Increase Valgrind's (per-thread) stack size from 64kB to 1MB,
so as to avoid demangler crashes on very long names. Fixes
#197988 (possibly only temporary; the demangler could overflow
the stack again, given extremely long names.)
------------------------------------------------------------------------
Index: coregrind/pub_core_aspacemgr.h
===================================================================
--- coregrind/pub_core_aspacemgr.h (Revision 11214)
+++ coregrind/pub_core_aspacemgr.h (Revision 11215)
@@ -373,10 +373,10 @@ extern Bool VG_(am_relocate_nooverlap_cl
#if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
# define VG_STACK_GUARD_SZB 65536 // 1 or 16 pages
-# define VG_STACK_ACTIVE_SZB 131072 // 2 or 32 pages
+# define VG_STACK_ACTIVE_SZB (4096 * 256) // 1Mb
#else
# define VG_STACK_GUARD_SZB 8192 // 2 pages
-# define VG_STACK_ACTIVE_SZB 65536 // 16 pages
+# define VG_STACK_ACTIVE_SZB (4096 * 256) // 1Mb
#endif
typedef
------------------------------------------------------------------------
r11343 | sewardj | 2010-09-08 10:30:31 +0200 (Mi, 08. Sep 2010) | 7 Zeilen
Don't scan the entire Valgrind stack to check for impending
stack-overflow situations. This causes an immense number of L2 misses
which are completely pointless, and the recent increase of the
Valgrind per-thread stack size from 64k to 1M greatly aggravates the
situation.
------------------------------------------------------------------------
Index: coregrind/m_aspacemgr/aspacemgr-common.c
===================================================================
--- coregrind/m_aspacemgr/aspacemgr-common.c (Revision 11342)
+++ coregrind/m_aspacemgr/aspacemgr-common.c (Revision 11343)
@@ -432,15 +432,18 @@ VgStack* VG_(am_alloc_VgStack)( /*OUT*/A
/* Figure out how many bytes of the stack's active area have not
been used. Used for estimating if we are close to overflowing it. */
-Int VG_(am_get_VgStack_unused_szB)( VgStack* stack )
+SizeT VG_(am_get_VgStack_unused_szB)( VgStack* stack, SizeT limit )
{
- Int i;
+ SizeT i;
UInt* p;
p = (UInt*)&stack->bytes[VG_STACK_GUARD_SZB];
- for (i = 0; i < VG_STACK_ACTIVE_SZB/sizeof(UInt); i++)
+ for (i = 0; i < VG_STACK_ACTIVE_SZB/sizeof(UInt); i++) {
if (p[i] != 0xDEADBEEF)
break;
+ if (i * sizeof(UInt) >= limit)
+ break;
+ }
return i * sizeof(UInt);
}
Index: coregrind/m_scheduler/scheduler.c
===================================================================
--- coregrind/m_scheduler/scheduler.c (Revision 11342)
+++ coregrind/m_scheduler/scheduler.c (Revision 11343)
@@ -1753,9 +1753,11 @@ void VG_(sanity_check_general) ( Bool fo
stack
= (VgStack*)
VG_(get_ThreadState)(tid)->os_state.valgrind_stack_base;
+ SizeT limit
+ = 4096; // Let's say. Checking more causes lots of L2 misses.
remains
- = VG_(am_get_VgStack_unused_szB)(stack);
- if (remains < VKI_PAGE_SIZE)
+ = VG_(am_get_VgStack_unused_szB)(stack, limit);
+ if (remains < limit)
VG_(message)(Vg_DebugMsg,
"WARNING: Thread %d is within %ld bytes "
"of running out of stack!\n",
Index: coregrind/pub_core_aspacemgr.h
===================================================================
--- coregrind/pub_core_aspacemgr.h (Revision 11342)
+++ coregrind/pub_core_aspacemgr.h (Revision 11343)
@@ -396,10 +396,10 @@ typedef
extern VgStack* VG_(am_alloc_VgStack)( /*OUT*/Addr* initial_sp );
-/* Figure out how many bytes of the stack's active area have not
- been used. Used for estimating if we are close to overflowing it. */
-
-extern Int VG_(am_get_VgStack_unused_szB)( VgStack* stack );
+/* Figure out how many bytes of the stack's active area have not been
+ used. Used for estimating if we are close to overflowing it. If
+ the free area is larger than 'limit', just return 'limit'. */
+extern SizeT VG_(am_get_VgStack_unused_szB)( VgStack* stack, SizeT limit );
// DDD: this is ugly
#if defined(VGO_darwin)

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Sep 23 13:16:16 CEST 2010 - dmueller@suse.de
- increase stack size (bnc#640793)
-------------------------------------------------------------------
Fri May 7 13:44:18 CEST 2010 - dmueller@suse.de

View File

@ -28,15 +28,16 @@ Group: Development/Tools/Debuggers
Summary: Valgrind Suite of Tools for Debugging and Profiling
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Version: 3.5.0
Release: 5
Release: 12
Source0: %{name}-%{version}.tar.bz2
# svn di svn://svn.valgrind.org/valgrind/tags/VALGRIND_3_2_1 svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_2_BRANCH > 3_2_BRANCH.diff
# svn di svn://svn.valgrind.org/vex/tags/VEX_3_2_1 svn://svn.valgrind.org/vex/branches/VEX_3_2_BRANCH > VEX_3_2_BRANCH.diff
# svn di svn://svn.valgrind.org/valgrind/tags/VALGRIND_3_5_0 svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_5_BRANCH > 3_5_BRANCH.diff
# svn di svn://svn.valgrind.org/vex/tags/VEX_3_5_0 svn://svn.valgrind.org/vex/branches/VEX_3_5_BRANCH > VEX_3_5_BRANCH.diff
Patch1: jit-register-unregister.diff
Patch2: deprecated.diff
Patch3: glibc-211.diff
Patch4: bnc558964.diff
Patch5: prefer-cfi.diff
Patch6: bigger-default-stack.diff
Provides: callgrind = %version
Obsoletes: callgrind < %version
ExclusiveArch: %ix86 x86_64 ppc ppc64
@ -126,6 +127,7 @@ cd ..
%if %suse_version >= 1120
%patch5
%endif
%patch6
%build
export CFLAGS="$RPM_OPT_FLAGS"