Bug 373046 - Stacks registered by core are never deregistered
Summary: Stacks registered by core are never deregistered
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: 3.12 SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-28 19:30 UTC by Philippe Waroquiers
Modified: 2016-12-04 03:53 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Waroquiers 2016-11-28 19:30:47 UTC
(see master bug 323020)
* thread stacks are registered using m_stacks.c VG_(register_stack),
  but are never deregistered.
  syswrap-<machine>-linux.c are all calling VG_(register_stack).
  However, these stacks are never deregistered: the only call to
  VG_(deregister_stack) is in scheduler.c (for the client request).
  So, an application with many threads creation/destruction might end up with
  a bunch of "dead" client stacks registered in m_stacks.c
  (these dead stacks might then point anywhere, as the client thread memory
   might have been recycled e.g. for malloc).
  Also, it is unclear if and where the darwin implementation registers
  the thread stacks.
Comment 1 Philippe Waroquiers 2016-11-28 19:37:20 UTC
Fix committed in revision  16159
This fix is a good candidate for a 3.12.1, as the missing
deregister can cause a big performance degradation.

Another change will be done later to produce a warning
if overlapping stacks are registered and/or non existing stacks
are deregistered
Comment 2 Ivo Raisr 2016-11-28 21:42:15 UTC
Follow up in SVN r16160.
Comment 3 Rhys Kidd 2016-12-04 03:53:01 UTC
macOS-specific follow up in r16168.