Memory access violation in MasterSynth::allNotesOff() when pushing play button

• Dec 31, 2012 - 22:17
Type
Functional
Severity
S2 - Critical
Status
closed
Project

Hello,
I've been working with MuseScore extensively these few weeks for a class project, and I ran into some random crashes that were hard to organize into reproducible bugs. I think I have one here that should be kind of reproducible.

=== SUMMARY ===
When executing MuseScore and playing the default score the program crashes after pushing "play". The exact error message is that in synth.cpp in MasterSynth::allNotesOff(int channel) on line 277 function call synti->allNotesOff(channel) it gives an EXC_BAD_ACCESS error in the IOThread. (See screenshot)

=== DEVELOPMENT ENVIRONMENT ===
- OS: iMac OS X 10.8.2
- IDE: Xcode 4.5.2. Specifically using Apple LLVM compiler 4.1
- QT: open source 4.8.4
- the other stuff like libsndfile, port audio, cmake, I recently downloaded. Let me know if you need versions.

=== CODE BASE ===
I used the git commit with SHA: e04dc04df259e6a1dd2f2d5897910fe438d7ff85
ffrom Nov. 27 with commit message "fix getText usage". (from github)

=== STEPS TO REPRODUCE ===
- downloaded the newest repo from github and did checkout on above commit
- prepare for Xcode as written in the guide. "make -f Makefile.osx Xcode" and then "open build.xcode/mscore.xcodeproj"
- in Xcode, in project Info set OS X Deployment Target to 10.8. In Build Settings set Base SDK to "Latest OS X (OS X 10.8"
- run ALL_BUILD, ZERO_CHECK and install scheme.
- run mscore scheme. The bug is kind of random, but to reproduce it I did the above steps for a completely clean downloaded code, and it would throw that bug about every third or forth time. Start to execute mscore, let it load the given promenade score and the press the "play" button. I've also been coming across that issue by myself many many times.

=== DISCUSSION ===
When looking at gdb and doing a "print *synti* one can see that "_vptr$Synth = 0x0". (See screenshot) From googling and what I understand so far is that the virtual pointer points to a virtual table that contains pointers to class methods. The memory violation probably occurred since it can't find the address for allNotesOff() ? I am however able to call other functions, for example "call synti->active()". However when doing "call synti->allNotesOff(-1) it gives me exactly that memory access violation error "Cannot access memory at address 0x98". Vptr normally shouldn't be null, but I'm not sure where that happened? (i.e. access after freeing object or something like that)

I haven't really worked on a big C++ project, and debugging is quite painful for me, esp. under XCode, so I'm not sure how to further trace down this issue. But, hope this bug report helps ;-)

Attachment Size
bugreport.png 396.99 KB

Comments

Hi

Thanks for reporting - could you try in a newer revision? The one you are using is from November and likely to be out of date.

Crashes and data loss are critical, by the way :).

Yes, still happens, 3 out of 6 times.
Did on commit 4f9d80a7afd0b55b21bd0766c82a1840a6247b53 from today.
Wonder if this might be just due to my development environment.

No, doesn't happen there. All right, I guess it's my development environment. From what I've heard lasconic is using an older xcode and os x version.