Opened 14 years ago

Closed 13 years ago

#2647 closed Patches (fixed)

valgrind error with Boost.Test

Reported by: Kevin Sopp Owned by: Gennadiy Rozental
Milestone: Boost 1.41.0 Component: test
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

Hi Gennadiy,

either the fix for this has never been committed or the fix got reverted at some point.

See this thread for the discussion and solution:

http://thread.gmane.org/gmane.comp.lib.boost.devel/180182/focus=180190

Attachments (2)

test_valgrind.patch (817 bytes ) - added by Kevin Sopp 13 years ago.
boost-test-invalid-read.patch (1.0 KB ) - added by smr@… 13 years ago.
Debian's fix

Download all attachments as: .zip

Change History (5)

by Kevin Sopp, 13 years ago

Attachment: test_valgrind.patch added

comment:1 by Kevin Sopp, 13 years ago

Milestone: Boost 1.38.0Boost 1.40.0
Type: BugsPatches

I wrote a small patch to fix this.

by smr@…, 13 years ago

Debian's fix

comment:2 by smr@…, 13 years ago

Milestone: Boost 1.40.0Boost 1.41.0

This has also been reported to distributors such as Debian (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=538946). Debian has elected to follow the suggestion of Peter Klotz; see the final message of http://www.nabble.com/-Boost.Test--valgrind-complains-about-invalid-reads-td20500154.html

In summary:

  1. The destructor of class test_unit is made virtual and public.
  2. The method framework::clear() is much simpler: no downcast needed.

Patch attached.

comment:3 by Gennadiy Rozental, 13 years ago

Resolution: fixed
Status: newclosed

(In [56467]) apparently compiler might want to examine tu.second twice: before and after calling destructor Fixes #2889 Fixes #3432 Fixes #2647

Note: See TracTickets for help on using tickets.