Copying chords results in crash

• Nov 4, 2013 - 11:32
Type
Functional
Severity
S2 - Critical
Status
closed
Project

1. Load attached score (not my copyright so please do not distribute)
2. Right click first chord
3. Select>All similar elements
4. CTRL+C

Result: MuseScore crashes

Windows 8 Pro
MuseScore 2 self build from commit e03ddb3

Attachment Size
God_beside.mscz 2.29 KB

Comments

I cannot reproduce on Linux (Mint 14, self compiled under Qt lib 5.1.0, today commit ea9bf0494 2013-10-05): the given procedure does work and I could paste the full chord name sequence in another point of the score.

(I assume that by "first chord" you mean the first chord name; but I tried with 'regular' chords too and it also works).

M.

Crashes for me still on Windows 7 with source updates a few minutes ago. I looked in the debugger and saw where the crash was - "seg" was 0 and being dereferenced in select.cpp line 707. This happened on about the third or fourth iteration through the loop. And yes, this was selecting the chord *symbol*.

This is strange, I don't think that dereferencing null pointers could be OS-dependent.

If Marc can spend some time on this (or Michael, if he is familiar with the debugger), it would help to try selecting each pair of contiguous chord symbols (D - F#, F# - G, G - A7, A7 - D, D- F#, F# - G, G - A) and note which pair causes the crash and which is the value of numSegs at the moment of the crash.

Sorry to burden you, but without being able to reproduce the crash, I have to 'fly by the instruments'.

Thanks,

M.

Already on it :-). Before seeing your message, this is what I've found so far:

Crash actually happens second time through the loop. That's because the call to seg->nextCR(currTrack) is returning 0. I'm thinking that's because currTrack is 961, and assuming this is supposed to indicate a normal track number, that's obviously bogus.

Looking further up, currTrack is 961 because in line 663, track is set to "iter->first >> 32", and that's evaluating to 961. Actually, iter->first is itself 961; either I don't understand >> or it's not working. But I'm guessing 961 is bogus in the first place. Seems more like a tick value than a track value, no?

Some more info:

No crash if I don't actually left click the D before right clicking. But also, no copy takes place - Ctrl+C does nothing that I can see (doesn't hit my breakpoints, subsequent Ctrl+V does nothing).

EDIT: and to answer your question, the crash occurs if all I do is ctrl-click the first two chords.

It seems the first run to the outer (iter) loop, currTrack gets set to 1, and the code works fine. It's the second pass through the outer (iter) loop where currTrack gets set to 961, and then it's the second pass through the inner (seg) loop where the crash occurs, because nextCR(961) returns 0.

I think I got it!!! It is a 32 / 64 bit issue. I'm working on a fix!

Thanks to Marc and Michael for their collaboration,

m.