Bug 222604 - Add a "stop" frame to suppressions to do exact matches
Summary: Add a "stop" frame to suppressions to do exact matches
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.6 SVN
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-13 22:41 UTC by leiz
Modified: 2010-08-26 13:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch to implement a stop frame (5.01 KB, patch)
2010-01-13 22:41 UTC, leiz
Details
improved patch, don't mess with string_match() (4.71 KB, patch)
2010-01-19 20:46 UTC, leiz
Details
Rename stop to end, add a bit of documentation. (5.73 KB, patch)
2010-02-27 03:54 UTC, leiz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description leiz 2010-01-13 22:41:59 UTC
Created attachment 39856 [details]
patch to implement a stop frame

I would like to be able to write a suppression that matches:

Memcheck:Leak
fun:foo
fun:bar

but not:

Memcheck:Leak
fun:foo
fun:bar
fun:qux

The proposal is to add a 'stop' frame to indicate when we should stop matching. i.e.

{
   exact_suppression
   Memcheck:Leak
   fun:foo
   fun:bar
   STOP
}

The stop frame would only make sense as the last frame. Attached is an unpolished patch that implements this.
Comment 1 leiz 2010-01-19 20:46:54 UTC
Created attachment 40054 [details]
improved patch, don't mess with string_match()
Comment 2 Julian Seward 2010-02-09 20:42:24 UTC
This is an interesting idea.  If you'd explained the motivation in a
bit more detail, as per http://wiki.winehq.org/Wine_and_Valgrind section
"Additional Patches", it might have gotten looked at sooner :-/

A terminological query.  I'm pretty much regexp-clueless, but I do
know regexps have some symbol which matches the end-of-input.  Is
that generally known as a "stop" symbol?  I ask because I'd prefer
to stick with existing regexp terminology if possible.
Comment 3 Julian Seward 2010-02-21 14:41:57 UTC
Ping?
Comment 4 leiz 2010-02-27 03:54:14 UTC
Created attachment 41154 [details]
Rename stop to end, add a bit of documentation.

Pong. (life got in the way)

I'm also somewhat regexp-clueless. Typically for string matching, $ is the end of line. Maybe "end frame" is a better name?
Comment 5 Bart Van Assche 2010-08-26 12:56:36 UTC
How about replacing the text "STOP" by "end-of-stack:" ?
Comment 6 Timur Iskhodzhanov 2010-08-26 13:31:23 UTC
FYI, Perl multiline-equivalent for "$" is "\z" (for "^" it's "\A")
http://en.wikipedia.org/wiki/Regular_expression_examples

What is the need for the end-of-stack thing?

Recently I was re-writing the suppression mechanism in Dr. Memory (which is a Valgrind analog with Windows and Linux support) and during the review we've decided full-stack matches are not necessary.

My experience of using Valgrind on Chromium shows that
a) stack frames below main or start_thread are platform-specific in the reports
b) frames below something like MessageLoop::ProcessMessage() differ between different runs due to different scheduling