lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strange memory corruption when using vector (works with deque)


From: Reinhold Kainhofer
Subject: Strange memory corruption when using vector (works with deque)
Date: Fri, 20 Nov 2009 18:35:44 +0100
User-agent: KMail/1.12.3 (Linux/2.6.31-14-generic; KDE/4.3.3; i686; ; )

While fixing bug 676, I ran into a very strange memory corruption situation: 
Like in the tie-engraver.cc, I used vectors in tie-performer.cc to store the 
moment together with the Audio_element_info.

Now, this always led to memory corruption as soon as I called push_back. 
Before the push_back call, the size() of the vector was 0, after the 
push_back, the size() would be reported as 3303820998 (instead of 1)?!?!?

Using a deque instead of a vector works just fine. 

In particular, the commit 4ba35b32beca41dce222a95a5e0ed0c959e867dd using 
vector will always crash with the following file:

\version "2.11.58"
\score {
 { c ~ d c d }
 \layout { }
 \midi { }
}

On the other hand, changing vector to deque in commit 
b238aa006f301fe8c194a1329af75f9db9b3024b will work just fine.

The size() issue I mentioned above can be seen by commenting out the two 
message(..) calls in the latter commit and switching back from deques to 
vectors.


Any idea what might be the problem here?

Cheers,
Reinhold

-- 
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]