Am Mittwoch, 24. August 2011, 18:18:33 schrieben Sie:
> On Wed, Aug 24, 2011 at 02:08:41PM +0200, Reinhold Kainhofer wrote:
> > Shall I open a bug report for each regtest where valgrind shows a warning
> > (the guile GC warnings are of course filtered out using a suppressions
> > file)?
> 
> I wouldn't be surprised if you get some duplicate bugs, though --
> I mean, if there was one line in the slur code that produced a
> memory error, I'd expect it to show up in dozens of regtests.

You'd be surprised: With the --disable-optimising configure option, there are 
basically just two relevant warnings!

One in grid-lines.ly and one in laissez-vibrer-tie-beam.ly. I'm attaching my 
suppressions file and the output of valgrind.

I have the following alias in my ~/.bashrc (or rather in ~/.aliases, which I 
source from .bashrc):
alias valgrind-ly='valgrind --trace-children=yes --
suppressions=/home/reinhold/lilypond/guile_supp --track-origins=yes --num-
callers=25 lilypond '

Then call valgrind in input/regression/ as:
valgrind-ly grid-lines.ly laissez-vibrer-tie-beam.ly



There is, however, one caveat with the suppressions: Some uninitialized 
variables might be handled to guile (e.g. scm_from_int) and they will only 
show up as uninitialized variables in the garbage collection handling.

The (suppressed) output would then look something like:
»mozart-hrn-3.ly« wird verarbeitet
[...]
==14418== Use of uninitialised value of size 4
==14418==    at 0x827C877: Stencil::mark_smob(scm_unused_struct*) 
(stencil.cc:54)
==14418==    by 0x409F48B: scm_gc_mark (in /usr/lib/libguile.so.17.3.1)
==14418==    by 0x409F639: scm_mark_locations (in /usr/lib/libguile.so.17.3.1)
==14418==    by 0x40F6001: scm_threads_mark_stacks (in 
/usr/lib/libguile.so.17.3.1)
[...]
Text_interface::interpret_string(scm_unused_struct*, scm_unused_struct*, 
scm_unused_struct*) (text-interface.cc:64)
==14418==    by 0x8290045: 
Text_interface::interpret_markup(scm_unused_struct*, scm_unused_struct*, 
scm_unused_struct*) (text-interface.cc:95)
[...]
==14418==  Uninitialised value was created by a stack allocation
==14418==    at 0x828FA36: 
Text_interface::interpret_string(scm_unused_struct*, scm_unused_struct*, 
scm_unused_struct*) (text-interface.cc:58)

I don't see whether in this case where are some uninitialized values in the 
lilypond code, though.


Such a case were the uninitialized variables that I fixed yesterday, which 
were immediately passed to scm_from_int and triggered the warning only in the 
GC. Unfortunately, most warnings in the GC are really from guile.



An optimized build basically gives basically the same warnings.

Cheers,
Reinhold

-- 
------------------------------------------------------------------
Reinhold Kainhofer, reinh...@kainhofer.com, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org
{
   guile1
   Memcheck:Cond
   ...
   fun:scm_i_gc
}

{
   guile2
   Memcheck:Value4
   ...
   fun:scm_i_gc
}

{
   guile3
   Memcheck:Cond
   ...
   fun:scm_gc_mark
}

{
   guile4
   Memcheck:Value4
   ...
   fun:scm_gc_mark
}

{
   guile5
   Memcheck:Cond
   fun:scm_i_sweep_card
}

==28412== Memcheck, a memory error detector
==28412== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==28412== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==28412== Command: /home/reinhold/.bin/lilypond grid-lines.ly 
laissez-vibrer-tie-beam.ly
==28412== 
==28412== Memcheck, a memory error detector
==28412== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==28412== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==28412== Command: /home/reinhold/lilypond/lilypond/out/bin/lilypond --relocate 
grid-lines.ly laissez-vibrer-tie-beam.ly
==28412== 
GNU LilyPond 2.15.9
»grid-lines.ly« wird verarbeitet
Analysieren...
Interpretation der Musik...
Vorverarbeitung der grafischen Elemente...==28412== Invalid read of size 4
==28412==    at 0x8074823: 
Axis_group_interface::adjacent_pure_heights(scm_unused_struct*) 
(axis-group-interface.cc:254)
==28412==    by 0x4090F18: scm_dapply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4097807: scm_apply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4099160: scm_call_1 (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x812748A: Grob::try_callback_on_alist(scm_unused_struct**, 
scm_unused_struct*, scm_unused_struct*) (grob-property.cc:227)
==28412==    by 0x81271D6: Grob::internal_get_property(scm_unused_struct*) 
const (grob-property.cc:184)
==28412==    by 0x8073D5A: 
Axis_group_interface::part_of_line_pure_height(Grob*, bool, int, int) 
(axis-group-interface.cc:147)
==28412==    by 0x8073F23: 
Axis_group_interface::begin_of_line_pure_height(Grob*, int) 
(axis-group-interface.cc:171)
==28412==    by 0x8073B6F: 
Axis_group_interface::sum_partial_pure_heights(Grob*, int, int) 
(axis-group-interface.cc:130)
==28412==    by 0x8074E97: Axis_group_interface::relative_pure_height(Grob*, 
int, int) (axis-group-interface.cc:316)
==28412==    by 0x8077C6C: Axis_group_interface::pure_group_height(Grob*, int, 
int) (axis-group-interface.cc:545)
==28412==    by 0x8131A7D: 
Hara_kiri_group_spanner::pure_height(scm_unused_struct*, scm_unused_struct*, 
scm_unused_struct*) (hara-kiri-group-spanner.cc:58)
==28412==    by 0x4091397: scm_dapply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x409476A: ??? (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x40914E9: scm_dapply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4097807: scm_apply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x409898B: scm_apply_0 (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x8127800: call_pure_function(scm_unused_struct*, 
scm_unused_struct*, int, int) (grob-property.cc:327)
==28412==    by 0x8127304: Grob::internal_get_pure_property(scm_unused_struct*, 
int, int) const (grob-property.cc:196)
==28412==    by 0x8120300: Grob::pure_height(Grob*, int, int) (grob.cc:463)
==28412==    by 0x805FD51: get_skylines(Grob*, std::vector<Grob*, 
std::allocator<Grob*> >*, Axis, bool, int, int, std::vector<Skyline_pair, 
std::allocator<Skyline_pair> >*) (align-interface.cc:101)
==28412==    by 0x8060349: 
Align_interface::internal_get_minimum_translations(Grob*, std::vector<Grob*, 
std::allocator<Grob*> > const&, Axis, bool, bool, int, int) 
(align-interface.cc:200)
==28412==    by 0x8060104: 
Align_interface::get_pure_minimum_translations(Grob*, std::vector<Grob*, 
std::allocator<Grob*> > const&, Axis, int, int) (align-interface.cc:158)
==28412==    by 0x8060E22: Align_interface::get_pure_child_y_translation(Grob*, 
Grob*, int, int) (align-interface.cc:315)
==28412==    by 0x811FC7D: Grob::pure_relative_y_coordinate(Grob const*, int, 
int) (grob.cc:357)
==28412==  Address 0x74f8500 is 0 bytes after a block of size 8 alloc'd
==28412==    at 0x402641D: operator new(unsigned int) (vg_replace_malloc.c:255)
==28412==    by 0x80CCDDF: __gnu_cxx::new_allocator<unsigned 
int>::allocate(unsigned int, void const*) (new_allocator.h:89)
==28412==    by 0x80CB593: std::_Vector_base<unsigned int, 
std::allocator<unsigned int> >::_M_allocate(unsigned int) (in 
/home/reinhold/lilypond/lilypond/lily/out/lilypond)
==28412==    by 0x80C9C86: std::_Vector_base<unsigned int, 
std::allocator<unsigned int> >::_Vector_base(unsigned int, 
std::allocator<unsigned int> const&) (stl_vector.h:113)
==28412==    by 0x80C7BC8: std::vector<unsigned int, std::allocator<unsigned 
int> >::vector(std::vector<unsigned int, std::allocator<unsigned int> > const&) 
(stl_vector.h:242)
==28412==    by 0x81DD944: Paper_score::get_break_ranks() const 
(paper-score.cc:113)
==28412==    by 0x80744DC: 
Axis_group_interface::adjacent_pure_heights(scm_unused_struct*) 
(axis-group-interface.cc:217)
==28412==    by 0x4090F18: scm_dapply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4097807: scm_apply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4099160: scm_call_1 (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x812748A: Grob::try_callback_on_alist(scm_unused_struct**, 
scm_unused_struct*, scm_unused_struct*) (grob-property.cc:227)
==28412==    by 0x81271D6: Grob::internal_get_property(scm_unused_struct*) 
const (grob-property.cc:184)
==28412==    by 0x8073D5A: 
Axis_group_interface::part_of_line_pure_height(Grob*, bool, int, int) 
(axis-group-interface.cc:147)
==28412==    by 0x8073F23: 
Axis_group_interface::begin_of_line_pure_height(Grob*, int) 
(axis-group-interface.cc:171)
==28412==    by 0x8073B6F: 
Axis_group_interface::sum_partial_pure_heights(Grob*, int, int) 
(axis-group-interface.cc:130)
==28412==    by 0x8074E97: Axis_group_interface::relative_pure_height(Grob*, 
int, int) (axis-group-interface.cc:316)
==28412==    by 0x8077C6C: Axis_group_interface::pure_group_height(Grob*, int, 
int) (axis-group-interface.cc:545)
==28412==    by 0x8131A7D: 
Hara_kiri_group_spanner::pure_height(scm_unused_struct*, scm_unused_struct*, 
scm_unused_struct*) (hara-kiri-group-spanner.cc:58)
==28412==    by 0x4091397: scm_dapply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x409476A: ??? (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x40914E9: scm_dapply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4097807: scm_apply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x409898B: scm_apply_0 (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x8127800: call_pure_function(scm_unused_struct*, 
scm_unused_struct*, int, int) (grob-property.cc:327)
==28412==    by 0x8127304: Grob::internal_get_pure_property(scm_unused_struct*, 
int, int) const (grob-property.cc:196)
==28412== 

Ideale Seitenanzahl wird gefunden...
Musik wird auf eine Seite angepasst...
Systeme erstellen...
Layout nach »grid-lines.ps« ausgeben...
Konvertierung nach »./grid-lines.pdf«...
»laissez-vibrer-tie-beam.ly« wird verarbeitet
Analysieren...
Interpretation der Musik...
Vorverarbeitung der grafischen Elemente...==28412== Invalid read of size 4
==28412==    at 0x829C447: 
Tie_formatting_problem::set_column_chord_outline(std::vector<Item*, 
std::allocator<Item*> >, Direction, int) (tie-formatting-problem.cc:155)
==28412==    by 0x829D3F2: 
Tie_formatting_problem::set_chord_outline(std::vector<Item*, 
std::allocator<Item*> >, Direction) (tie-formatting-problem.cc:293)
==28412==    by 0x829DD64: 
Tie_formatting_problem::from_semi_ties(std::vector<Grob*, std::allocator<Grob*> 
> const&, Direction) (tie-formatting-problem.cc:418)
==28412==    by 0x82232F6: 
Semi_tie_column::calc_positioning_done(scm_unused_struct*) 
(semi-tie-column.cc:62)
==28412==    by 0x4090F18: scm_dapply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4097807: scm_apply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4099160: scm_call_1 (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x812748A: Grob::try_callback_on_alist(scm_unused_struct**, 
scm_unused_struct*, scm_unused_struct*) (grob-property.cc:227)
==28412==    by 0x81271D6: Grob::internal_get_property(scm_unused_struct*) 
const (grob-property.cc:184)
==28412==    by 0x8295245: Tie::calc_direction(scm_unused_struct*) (tie.cc:173)
==28412==    by 0x4090F18: scm_dapply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4097807: scm_apply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4099160: scm_call_1 (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x812748A: Grob::try_callback_on_alist(scm_unused_struct**, 
scm_unused_struct*, scm_unused_struct*) (grob-property.cc:227)
==28412==    by 0x81271D6: Grob::internal_get_property(scm_unused_struct*) 
const (grob-property.cc:184)
==28412==    by 0x8222B40: Semi_tie::calc_control_points(scm_unused_struct*) 
(semi-tie.cc:46)
==28412==    by 0x4090F18: scm_dapply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4097807: scm_apply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4099160: scm_call_1 (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x812748A: Grob::try_callback_on_alist(scm_unused_struct**, 
scm_unused_struct*, scm_unused_struct*) (grob-property.cc:227)
==28412==    by 0x81271D6: Grob::internal_get_property(scm_unused_struct*) 
const (grob-property.cc:184)
==28412==    by 0x8295F4B: Tie::print(scm_unused_struct*) (tie.cc:259)
==28412==    by 0x40932FC: ??? (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x40914E9: scm_dapply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4097807: scm_apply (in /usr/lib/libguile.so.17.3.1)
==28412==  Address 0xcbaf99c is 0 bytes after a block of size 4 alloc'd
==28412==    at 0x402641D: operator new(unsigned int) (vg_replace_malloc.c:255)
==28412==    by 0x8099C79: __gnu_cxx::new_allocator<int>::allocate(unsigned 
int, void const*) (new_allocator.h:89)
==28412==    by 0x8099B41: std::_Vector_base<int, std::allocator<int> 
>::_M_allocate(unsigned int) (in 
/home/reinhold/lilypond/lilypond/lily/out/lilypond)
==28412==    by 0x809978E: std::__flower_vector<int, std::allocator<int> 
>::_M_insert_aux(__gnu_cxx::__normal_iterator<int*, std::__flower_vector<int, 
std::allocator<int> > >, int const&) (vector.tcc:322)
==28412==    by 0x809955C: std::__flower_vector<int, std::allocator<int> 
>::push_back(int const&) (stl_vector.h:749)
==28412==    by 0x826D1EF: Stem::note_head_positions(Grob*) (stem.cc:205)
==28412==    by 0x829C431: 
Tie_formatting_problem::set_column_chord_outline(std::vector<Item*, 
std::allocator<Item*> >, Direction, int) (tie-formatting-problem.cc:154)
==28412==    by 0x829D3F2: 
Tie_formatting_problem::set_chord_outline(std::vector<Item*, 
std::allocator<Item*> >, Direction) (tie-formatting-problem.cc:293)
==28412==    by 0x829DD64: 
Tie_formatting_problem::from_semi_ties(std::vector<Grob*, std::allocator<Grob*> 
> const&, Direction) (tie-formatting-problem.cc:418)
==28412==    by 0x82232F6: 
Semi_tie_column::calc_positioning_done(scm_unused_struct*) 
(semi-tie-column.cc:62)
==28412==    by 0x4090F18: scm_dapply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4097807: scm_apply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4099160: scm_call_1 (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x812748A: Grob::try_callback_on_alist(scm_unused_struct**, 
scm_unused_struct*, scm_unused_struct*) (grob-property.cc:227)
==28412==    by 0x81271D6: Grob::internal_get_property(scm_unused_struct*) 
const (grob-property.cc:184)
==28412==    by 0x8295245: Tie::calc_direction(scm_unused_struct*) (tie.cc:173)
==28412==    by 0x4090F18: scm_dapply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4097807: scm_apply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4099160: scm_call_1 (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x812748A: Grob::try_callback_on_alist(scm_unused_struct**, 
scm_unused_struct*, scm_unused_struct*) (grob-property.cc:227)
==28412==    by 0x81271D6: Grob::internal_get_property(scm_unused_struct*) 
const (grob-property.cc:184)
==28412==    by 0x8222B40: Semi_tie::calc_control_points(scm_unused_struct*) 
(semi-tie.cc:46)
==28412==    by 0x4090F18: scm_dapply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4097807: scm_apply (in /usr/lib/libguile.so.17.3.1)
==28412==    by 0x4099160: scm_call_1 (in /usr/lib/libguile.so.17.3.1)
==28412== 

Ideale Seitenanzahl wird gefunden...
Musik wird auf eine Seite angepasst...
Systeme erstellen...
Layout nach »laissez-vibrer-tie-beam.ps« ausgeben...
Konvertierung nach »./laissez-vibrer-tie-beam.pdf«...
Erfolg: Kompilation erfolgreich beendet
==28412== 
==28412== HEAP SUMMARY:
==28412==     in use at exit: 90,746,815 bytes in 28,167 blocks
==28412==   total heap usage: 209,091 allocs, 180,924 frees, 110,434,134 bytes 
allocated
==28412== 
==28412== LEAK SUMMARY:
==28412==    definitely lost: 10,617 bytes in 35 blocks
==28412==    indirectly lost: 20,028 bytes in 952 blocks
==28412==      possibly lost: 287,932 bytes in 895 blocks
==28412==    still reachable: 90,428,238 bytes in 26,285 blocks
==28412==         suppressed: 0 bytes in 0 blocks
==28412== Rerun with --leak-check=full to see details of leaked memory
==28412== 
==28412== For counts of detected and suppressed errors, rerun with: -v
==28412== ERROR SUMMARY: 3 errors from 2 contexts (suppressed: 36941 from 92)
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to