[Dune] [#1006] valgrind and dune-grid

Dune flyspray at dune-project.org
Thu Dec 22 16:25:37 CET 2011


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - Elias Pipping (pipping) 

Attached to Project - Dune
Summary - valgrind and dune-grid
Task Type - Bug Report
Category - Grid
Status - Unconfirmed
Assigned To - 
Operating System - Linux
Severity - Low
Priority - Normal
Reported Version - SVN (pre2.2)
Due in Version - Undecided
Due Date - Undecided
Details - I find the following rather odd:

Imagine I have a piece of code like the following:

% < foo.cpp
int
main()
{
  return 0;
}
%

Which I compile into foo.o:

% g++ -c foo.cpp

Linking it and running valgrind on the executable yields nothing surprising:

% g++ foo.o -o foo
% valgrind ./foo
==4727== Memcheck, a memory error detector
==4727== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==4727== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info
==4727== Command: ./foo
==4727== 
==4727== 
==4727== HEAP SUMMARY:
==4727==     in use at exit: 0 bytes in 0 blocks
==4727==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==4727== 
==4727== All heap blocks were freed -- no leaks are possible
==4727== 
==4727== For counts of detected and suppressed errors, rerun with: -v
==4727== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
% 

If I, however, link against the library dune-grid library as well:

% libtool --mode link g++ foo.o <DUNE>/dune-grid/build_clang/lib/libdunegrid.la -o foo
libtool: link: g++ foo.o -o .libs/foo  <DUNE>/dune-grid/build_clang/lib/.libs/libdunegrid.so
% 

Valgrind will tell me:

% libtool --mode execute valgrind ./foo
==5029== Memcheck, a memory error detector
==5029== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==5029== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info
==5029== Command: <HOME>/.libs/lt-foo
==5029== 
==5029== Invalid free() / delete / delete[]
==5029==    at 0x4C240FD: free (vg_replace_malloc.c:366)
==5029==    by 0x5DBB95A: free_mem (in /lib/libc-2.11.2.so)
==5029==    by 0x5DBB4F1: __libc_freeres (in /lib/libc-2.11.2.so)
==5029==    by 0x4A2067B: _vgnU_freeres (vg_preloaded.c:62)
==5029==    by 0x5CE158D: __run_exit_handlers (exit.c:93)
==5029==    by 0x5CE1634: exit (exit.c:100)
==5029==    by 0x5CC9C53: (below main) (libc-start.c:260)
==5029==  Address 0x4049008 is not stack'd, malloc'd or (recently) free'd
==5029== 
==5029== 
==5029== HEAP SUMMARY:
==5029==     in use at exit: 0 bytes in 0 blocks
==5029==   total heap usage: 48 allocs, 50 frees, 10,693 bytes allocated
==5029== 
==5029== All heap blocks were freed -- no leaks are possible
==5029== 
==5029== For counts of detected and suppressed errors, rerun with: -v
==5029== ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 4 from 4)
% 

In the above output, I've manually replaced the path to foo.o with
<HOME> and the path to dune-grid with <DUNE>.

More information can be found at the following URL:
http://www.dune-project.org/flyspray/index.php?do=details&task_id=1006

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.




More information about the Dune mailing list