diff --git a/bigger-default-stack.diff b/bigger-default-stack.diff new file mode 100644 index 0000000..d88fce3 --- /dev/null +++ b/bigger-default-stack.diff @@ -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) diff --git a/bnc558964.diff b/bnc558964.diff index 433e643..9521a53 100644 --- a/bnc558964.diff +++ b/bnc558964.diff @@ -63,11 +63,13 @@ const UInt ML_(syscall_table_size) = --- coregrind/m_syswrap/syswrap-ppc64-linux.c +++ coregrind/m_syswrap/syswrap-ppc64-linux.c -@@ -1507,7 +1507,7 @@ +@@ -1506,8 +1506,8 @@ + LINX_(__NR_eventfd2, sys_eventfd2), // 314 LINXY(__NR_epoll_create1, sys_epoll_create1), // 315 // (__NR_dup3, sys_ni_syscall) // 316 - LINXY(__NR_pipe2, sys_pipe2) // 317 +- LINXY(__NR_pipe2, sys_pipe2) // 317 - // (__NR_inotify_init1, sys_ni_syscall) // 318 ++ LINXY(__NR_pipe2, sys_pipe2), // 317 + LINXY(__NR_inotify_init1, sys_inotify_init1), // 318 }; diff --git a/prefer-cfi.diff b/prefer-cfi.diff new file mode 100644 index 0000000..79cc155 --- /dev/null +++ b/prefer-cfi.diff @@ -0,0 +1,46 @@ +--- coregrind/m_stacktrace.c ++++ coregrind/m_stacktrace.c +@@ -153,11 +153,18 @@ + /* Try to derive a new (ip,sp,fp) triple from the current + set. */ + +- /* On x86, first try the old-fashioned method of following the +- %ebp-chain. Code which doesn't use this (that is, compiled +- with -fomit-frame-pointer) is not ABI compliant and so +- relatively rare. Besides, trying the CFI first almost always +- fails, and is expensive. */ ++ /* That didn't work out, so see if there is any CF info to hand ++ which can be used. */ ++ if ( VG_(use_CF_info)( &ip, &sp, &fp, fp_min, fp_max ) ) { ++ if (0 == ip || 1 == ip) break; ++ if (sps) sps[i] = sp; ++ if (fps) fps[i] = fp; ++ ips[i++] = ip - 1; /* -1: refer to calling insn, not the RA */ ++ if (debug) ++ VG_(printf)(" ipsC[%d]=0x%08lx\n", i-1, ips[i-1]); ++ ip = ip - 1; /* as per comment at the head of this loop */ ++ continue; ++ } + /* Deal with frames resulting from functions which begin "pushl% + ebp ; movl %esp, %ebp" which is the ABI-mandated preamble. */ + if (fp_min <= fp && +@@ -183,19 +190,6 @@ + ip = ip - 1; /* as per comment at the head of this loop */ + continue; + } +- +- /* That didn't work out, so see if there is any CF info to hand +- which can be used. */ +- if ( VG_(use_CF_info)( &ip, &sp, &fp, fp_min, fp_max ) ) { +- if (0 == ip || 1 == ip) break; +- if (sps) sps[i] = sp; +- if (fps) fps[i] = fp; +- ips[i++] = ip - 1; /* -1: refer to calling insn, not the RA */ +- if (debug) +- VG_(printf)(" ipsC[%d]=0x%08lx\n", i-1, ips[i-1]); +- ip = ip - 1; /* as per comment at the head of this loop */ +- continue; +- } + + /* And, similarly, try for MSVC FPO unwind info. */ + if ( VG_(use_FPO_info)( &ip, &sp, &fp, fp_min, fp_max ) ) { diff --git a/valgrind.changes b/valgrind.changes index c7c15b2..91d6c95 100644 --- a/valgrind.changes +++ b/valgrind.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +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 + +- fix build for ppc64 + +------------------------------------------------------------------- +Mon Apr 26 16:14:02 CEST 2010 - dmueller@suse.de + +- handle pthread apps better (bnc#599585) +- prefer CFI for better stack unwinding (bnc#559061) + ------------------------------------------------------------------- Fri Mar 26 13:56:19 CET 2010 - dmueller@suse.de diff --git a/valgrind.spec b/valgrind.spec index b2509b0..328eabe 100644 --- a/valgrind.spec +++ b/valgrind.spec @@ -28,14 +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: 4 +Release: 5 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 @@ -122,6 +124,10 @@ cd .. %patch2 %patch3 %patch4 +%if %suse_version >= 1120 +%patch5 +%endif +%patch6 %build export CFLAGS="$RPM_OPT_FLAGS"