[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2021-10-25 Thread Roger Light
https://bugs.kde.org/show_bug.cgi?id=396290

Roger Light  changed:

   What|Removed |Added

 Attachment #118745|0   |1
is obsolete||
 Attachment #118746|0   |1
is obsolete||
 Attachment #118747|0   |1
is obsolete||
 Attachment #118748|0   |1
is obsolete||

--- Comment #35 from Roger Light  ---
Created attachment 142878
  --> https://bugs.kde.org/attachment.cgi?id=142878=edit
Patch against 3.18.1

This is the old patches combined and refreshed for 3.18.1.

It also includes the failgrind-helper utility, which makes it easy to run
failgrind against an executable repeatedly until it completes with all memory
allocations/syscalls in the program run succeeding, or the executable segfaults
- at which point you can see which failures caused the segfault. It is
imperfect, but a big improvement over manual testing.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2019-03-12 Thread Roger Light
https://bugs.kde.org/show_bug.cgi?id=396290

--- Comment #34 from Roger Light  ---
Created attachment 118748
  --> https://bugs.kde.org/attachment.cgi?id=118748=edit
Patch 4/4, function tracing code from callgrind

This adds a cut down version of the function tracing code from callgrind to
failgrind, which allows the syscall failure code to work, as well as the
--alloc-toggle-fn option, which is likely to be a very common way this tool is
used. The tests work under this patch as well.

This patch is for demonstrating the tool operation, but I don't think it is a
sensible patch for inclusion due to the huge amount of duplication with
callgrind.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2019-03-12 Thread Roger Light
https://bugs.kde.org/show_bug.cgi?id=396290

--- Comment #33 from Roger Light  ---
Created attachment 118747
  --> https://bugs.kde.org/attachment.cgi?id=118747=edit
Patch 3/4, support for syscall failures

This adds the Failgrind code that handles syscall failures, in terms of the
command line options, keeping track of already seen syscall call stacks, the
gdb monitor and client requests and similar, but does not include any
instrumentation code, so it doesn't work on its own.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2019-03-12 Thread Roger Light
https://bugs.kde.org/show_bug.cgi?id=396290

--- Comment #32 from Roger Light  ---
Created attachment 118746
  --> https://bugs.kde.org/attachment.cgi?id=118746=edit
Patch 2/4, add VG_(force_syscall_error)

This adds VG_(force_syscall_error) to coregrind, which allows tools to force an
error value when a syscall fails. This is necessary for the next patch.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2019-03-12 Thread Roger Light
https://bugs.kde.org/show_bug.cgi?id=396290

Roger Light  changed:

   What|Removed |Added

 Attachment #115711|0   |1
is obsolete||
 Attachment #115713|0   |1
is obsolete||
 Attachment #115744|0   |1
is obsolete||

--- Comment #31 from Roger Light  ---
Created attachment 118745
  --> https://bugs.kde.org/attachment.cgi?id=118745=edit
Patch 1/4, heap memory allocation failures only

This patch adds the failgrind tool, with support for failing heap allocations
with a variety of control. There is no instrumentation and hence no command
line capability of controlling when the failures are enabled. The gdb interface
and client requests are available and can be used to control when failures are
enabled, but I doubt either of those are used as widely as just command line
options.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2018-10-19 Thread Tom Hughes
https://bugs.kde.org/show_bug.cgi?id=396290

Tom Hughes  changed:

   What|Removed |Added

 CC||t...@compton.nu

--- Comment #30 from Tom Hughes  ---
Nick beat you to it and applied something very similar a few hours ago in
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;a=commitdiff;h=8b689c66d9b7f12852048db0e842560761bbf904.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2018-10-19 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=396290

roger.li...@cedalo.com changed:

   What|Removed |Added

 Attachment #115712|0   |1
is obsolete||

--- Comment #29 from roger.li...@cedalo.com ---
Created attachment 115744
  --> https://bugs.kde.org/attachment.cgi?id=115744=edit
Updated apply_ExeContext after comments.

Thanks for your comments. The epoch parameter was there because I hadn't seen
that an ExeContext contains its own epoch. You're also right that it could just
call apply_StackTrace. I've updated the patch to do that.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2018-10-18 Thread Philippe Waroquiers
https://bugs.kde.org/show_bug.cgi?id=396290

--- Comment #28 from Philippe Waroquiers  ---
(In reply to roger.light from comment #25)
> Created attachment 115712 [details]
> Patch that implements VG_(apply_ExeContext)().

2 comments:
* As ExeContext maintains internally its epoch, I do not understand
  why there is a parameter 'ep' in VG_(apply_ExeContext).
  There should be no reason to call VG_(apply_ExeContext) with another ep
  than the ExeContext ep, and so VG_(apply_ExeContext) can retrieve it
  itself.
* The code of VG_(apply_ExeContext) looks very similar to 
   VG_(apply_stacktrace). It looks like VG_(apply_ExeContext) can just
   make a call to VG_(apply_stacktrace).

Thanks
Philippe

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2018-10-17 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=396290

--- Comment #27 from roger.li...@cedalo.com ---
I've just added some updated patches. The two small ones add some coregrind
features that are needed for this tool - implementing VG_(apply_ExeContext)()
and adding a way for a tool to force a syscall to fail in the pre_syscall
callback.

The big one is the patch for the tool. This now has a lot of control over how
the allocation failures occur. It can be turned on/off at the start of the run,
set to toggle on entry and exit from named functions, limited to a certain
number of failures per run, automatically accepted based on size of allocation
requested, automatically accepted based on matching function name,
automatically accepted based on a dice roll, or to some degree controlled with
gdb  or client requests.

It also implements syscall failures, which is turned off by default. If you
turn it on, then all syscalls (bar those that are marked as always succeeding)
will fail with errno set to EINVAL. You can change to have all syscalls fail
with a different errno, and/or set individual syscalls to fail with specific
errors. You can set all syscalls with a matching name to be automatically
accepted. You can set all syscalls that aren't given a specific error to be
automatically accepted. You can accept based on the number of failures in a
run, or based on a dice roll, or to some degree controlled with gdb or client
requests.

There are tests for most features, but they haven't been tried on different
Linux releases or distributions (Kubuntu 18.04 only) nor on Mac or Solaris.

The documentation is pretty complete with examples for most situations.

The bits that are missing - I've taken a lot of code from callgrind to support
the function enter/leave feature, but I may have taken too much out. The bit
that needs looking at is function name wildcard support which I initially
removed but now see it was included in callgrind to allow C++ names to be dealt
with correctly. That needs putting back in, but I could do with a break from
this for a few days at least and was hoping for some feedback.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2018-10-17 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=396290

roger.li...@cedalo.com changed:

   What|Removed |Added

 Attachment #114630|0   |1
is obsolete||
 Attachment #114817|0   |1
is obsolete||

--- Comment #26 from roger.li...@cedalo.com ---
Created attachment 115713
  --> https://bugs.kde.org/attachment.cgi?id=115713=edit
Tool patch October 2018

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2018-10-17 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=396290

--- Comment #25 from roger.li...@cedalo.com ---
Created attachment 115712
  --> https://bugs.kde.org/attachment.cgi?id=115712=edit
Patch that implements VG_(apply_ExeContext)().

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2018-10-17 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=396290

--- Comment #24 from roger.li...@cedalo.com ---
Created attachment 115711
  --> https://bugs.kde.org/attachment.cgi?id=115711=edit
Patch that allows tools to set a syscall error.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2018-09-06 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=396290

--- Comment #23 from roger.li...@cedalo.com ---
Created attachment 114817
  --> https://bugs.kde.org/attachment.cgi?id=114817=edit
Patch with function enter/leave detection code from callgrind.

This patch is the same as 114630, but with code borrowed from callgrind for
tracking the callstack for detecting function entering/leaving. I've minimised
the code from callgrind as much as I think is sensible, but it may be possible
to remove more with some thought. It is still 3800 lines of text from callgrind
compared to 1100 for the rest of failgrind.

There's effectively a lot of duplicate code here, so I'll be interested to hear
your comments.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2018-08-26 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=396290

roger.li...@cedalo.com changed:

   What|Removed |Added

 Attachment #114553|0   |1
is obsolete||

--- Comment #22 from roger.li...@cedalo.com ---
Created attachment 114630
  --> https://bugs.kde.org/attachment.cgi?id=114630=edit
Updated patch - tests and other improvements

This new patch includes a set of tests covering the majority of the command
line options and client requests. The documentation is improved as well. I've
added more client requests for more effective use with a test suite - if there
were 0 allocations rejected you know the test covered all options, for example.

This has the toggle function removed. I still believe it is a very important
feature for the tool, but I haven't got it working yet without ~4000 lines of
code from callgrind. The patch is otherwise "complete".

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396290] [PATCH] Possible tool - failgrind

2018-08-26 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=396290

roger.li...@cedalo.com changed:

   What|Removed |Added

Summary|[PATCH] Possible tool - |[PATCH] Possible tool -
   |allocfail   |failgrind

-- 
You are receiving this mail because:
You are watching all bug changes.