From: Philippe Waroquiers Date: Wed, 7 Sep 2016 20:12:30 +0000 (+0000) Subject: Fix 199468 - Suppressions: stack size limited to 25 while --num-callers allows more... X-Git-Tag: svn/VALGRIND_3_12_0~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5de4bad5a75e701412f001923d403876ee6165de;p=thirdparty%2Fvalgrind.git Fix 199468 - Suppressions: stack size limited to 25 while --num-callers allows more frames Nr of callers in a suppression entry had a smaller limit than the max for --num-callers. This means it was not possible to precisely suppress an error with a big stack trace. Also, --gen-suppressions was not providing the full stack trace of the error in the generated suppressions. Now, a suppression entry can have the same nr of callers as a backtrace. Generated suppressions are generated with up to --num-callers callers. This change has neglectible impact : * memory: stack array of 500*2 words is declared, instead of 24*2 words This array is declared on the interim stack (startup stack), which is largely big enough. * cpu : neglectible more cpu needed to read suppression entries (to initialise the bigger stack array when reading a supp entry), Apart of the above, no impact on performance (unless of course bigger supp entries are really used). Note that this does not impact the behaviour for existing suppression files. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15945 --- diff --git a/NEWS b/NEWS index ebc1968b70..75ef71646e 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,11 @@ n-i-bz Improved thread startup time significantly on non-Linux platforms. "nouserintercepts" can be any non-existing library name). This new functionality is not implemented for darwin/macosx. +* The maximum number of callers in a suppression entry is now equal to + the maximum size for --num-callers (500). + Note that --gen-suppressions=yes|all similarly generate suppression + containing up to --num-callers frames. + * New and modified GDB server monitor features: - Valgrind's gdbserver now accepts the command 'catch syscall'. @@ -58,6 +63,7 @@ To see details of a given bug, visit where XXXXXX is the bug number as listed below. 191069 Exiting due to signal not reported in XML output +199468 Suppressions: stack size limited to 25 while --num-callers allows more frames 212352 vex amd64 unhandled opc_aux = 0x 2, first_opcode == 0xDC (FCOM) 278744 cvtps2pd with redundant RexW 303877 valgrind doesn't support compressed debuginfo sections. diff --git a/coregrind/m_errormgr.c b/coregrind/m_errormgr.c index a46c6c36c2..8f6370279e 100644 --- a/coregrind/m_errormgr.c +++ b/coregrind/m_errormgr.c @@ -195,8 +195,8 @@ typedef } CoreSuppKind; -/* Max number of callers for context in a suppression. */ -#define VG_MAX_SUPP_CALLERS 24 +/* Max number of callers for context in a suppression is + VG_DEEPEST_BACKTRACE. */ /* For each caller specified for a suppression, record the nature of the caller name. Not of interest to tools. */ @@ -410,8 +410,7 @@ static void gen_suppression(const Error* err) // Print stack trace elements UInt n_ips = VG_(get_ExeContext_n_ips)(ec); vg_assert(n_ips > 0); - if (n_ips > VG_MAX_SUPP_CALLERS) - n_ips = VG_MAX_SUPP_CALLERS; + vg_assert(n_ips <= VG_DEEPEST_BACKTRACE); VG_(apply_StackTrace)(printSuppForIp_nonXML, text, VG_(get_ExeContext_StackTrace)(ec), @@ -1260,7 +1259,7 @@ static void load_one_suppressions_file ( Int clo_suppressions_i ) HChar* tool_names; HChar* supp_name; const HChar* err_str = NULL; - SuppLoc tmp_callers[VG_MAX_SUPP_CALLERS]; + SuppLoc tmp_callers[VG_DEEPEST_BACKTRACE]; // Check it's not a directory. if (VG_(is_dir)( filename )) { @@ -1289,7 +1288,7 @@ static void load_one_suppressions_file ( Int clo_suppressions_i ) supp->count = 0; // Initialise temporary reading-in buffer. - for (i = 0; i < VG_MAX_SUPP_CALLERS; i++) { + for (i = 0; i < VG_DEEPEST_BACKTRACE; i++) { tmp_callers[i].ty = NoName; tmp_callers[i].name_is_simple_str = False; tmp_callers[i].name = NULL; @@ -1391,7 +1390,7 @@ static void load_one_suppressions_file ( Int clo_suppressions_i ) BOMB("missing stack trace"); } } - if (i == VG_MAX_SUPP_CALLERS) + if (i == VG_DEEPEST_BACKTRACE) BOMB("too many callers in stack trace"); if (i > 0 && i >= VG_(clo_backtrace_size)) break;