musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.35k stars 2.67k forks source link

Closing project crashes MS instance #20692

Open Fristover opened 11 months ago

Fristover commented 11 months ago

Issue type

Crash or freeze

Bug description

Sometimes, when you close a project, the currently running MS instance crashes instead of taking you to the home screen, I have not been able to find a pattern on this since it just randomly happens even when not doing any changes to the score.

Doesn't matter how many instances are running, the behavior is exactly the same.

Steps to reproduce

  1. Open any score
  2. Close it
  3. Repeat until you get a crash

Screenshots/Screen recordings

No response

MuseScore Version

4.2 Release

Regression

No.

Operating system

Windows 11, latest canary build

Additional context

This has been a thing since the first MS4 build I've tried, I thought this was already reported... (I'll try to update this once I find anything that could be useful, though I haven't found anything for the past year so my expectations are really low)

cbjeukendrup commented 11 months ago

This might be related to https://github.com/orgs/musescore/discussions/20631 https://sentry.musescore.org/musescore/mu4/issues/90463/ https://sentry.musescore.org/musescore/mu4/issues/90506/

bkunda commented 11 months ago

Could you please send us diagnostic info (from the diagnostic menu > Save diagnostic file) so we can try and identify what's going on in your specific case? Thanks!

Fristover commented 10 months ago

Sure! Sending now...

oops.zip

Really hope this helps, it is quite annoying. 😓

Eism commented 10 months ago

@Fristover Thank you for the info! I see that you're using the portable version. Unfortunately, due to technical reasons, we can't identify the issue with the portable version. Could you please use the non-portable version(last 4.2.1 builds), reproduce the crash, and send us diagnostic info?

bkunda commented 10 months ago

@Fristover were you able to reproduce this crash using a non-portable version? (I note that we already have numerous issues relating to this crash – it is a known issue! So we may end up closing this as there doesn't seem to be anything specific in the reproduction steps that could help us here).

Fristover commented 10 months ago

Oops, haven't tried it, I surely can reproduce it so I'll try to send the files today.

Fristover commented 10 months ago

oopsbutnotportable.zip Here, taken from release 4.2, installed through the Hub.

Eism commented 10 months ago

@Fristover Thank you for the information.

From the crash dumps, it is evident where the crash occurs - when deleting mixer objects. It might be related to https://github.com/musescore/MuseScore/issues/9467, but the dump files are different.

Dump file ``` Operating system: Windows NT 10.0.26016 1000 CPU: amd64 family 25 model 80 stepping 0 12 CPUs GPU: UNKNOWN Crash reason: EXCEPTION_ACCESS_VIOLATION_READ Crash address: 0x1 Process uptime: 75778 seconds Thread 2 (crashed) 0 MuseScore4.exe!static int mtx_do_lock(struct _Mtx_internal_imp_t *, const struct _timespec64 *) [mutex.cpp : 100 + 0x7] rax = 0x0000000000000001 rdx = 0x0000000000000000 rcx = 0x00000000d57cca08 rbx = 0x0000000099ba0dd0 rsi = 0x00000000d57cca00 rdi = 0x000000000cbac6e0 rbp = 0x00000000d57cca00 rsp = 0x000000000799f800 r8 = 0x0000000000000000 r9 = 0x0000000000000000 r10 = 0x0000000000000000 r11 = 0x00000000741372c0 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x00000001422889c0 Found by: given as instruction pointer in context 1 MuseScore4.exe!deto::async::AbstractInvoker::~AbstractInvoker() [abstractinvoker.cpp : 17 + 0x8] rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799f860 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x000000014079c8f7 Found by: call frame info 2 MuseScore4.exe!deto::async::Channel::ChannelInvoker::`scalar deleting destructor'(unsigned int) + 0x26 rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799f8a0 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x000000014113c0e6 Found by: call frame info 3 MuseScore4.exe!mu::audio::AudioSignalsNotifier::~AudioSignalsNotifier() + 0x77 rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799f8d0 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x000000014112f807 Found by: call frame info 4 MuseScore4.exe!mu::audio::MixerChannel::~MixerChannel() + 0x1e rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799f900 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x000000014113013e Found by: call frame info 5 MuseScore4.exe!mu::audio::MixerChannel::`scalar deleting destructor'(unsigned int) + 0x14 rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799f930 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x000000014113cba4 Found by: call frame info 6 MuseScore4.exe!mu::audio::Track::~Track() [track.h : 74 + 0x66] rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799f960 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x0000000141130d66 Found by: call frame info 7 MuseScore4.exe!mu::audio::EventTrack::`scalar deleting destructor'(unsigned int) + 0x20 rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799f990 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x000000014113c760 Found by: call frame info 8 MuseScore4.exe!std::_Tree,std::less,std::allocator > >,0> >::_Erase_unchecked(std::_Tree_unchecked_const_iterator > > >,std::_Iterator_base0>,std::_Tree_unchecked_const_iterator > > >,std::_Iterator_base0>) [xtree : 1304 + 0xc7] rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799f9c0 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x0000000141140ef7 Found by: call frame info 9 MuseScore4.exe!mu::audio::TrackSequence::removeTrack(int) [tracksequence.cpp : 226 + 0x78] rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799f9f0 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x000000014115b8c3 Found by: call frame info 10 MuseScore4.exe!mu::audio::TrackSequence::removeAllTracks() [tracksequence.cpp : 239 + 0x11] rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799fc80 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x000000014115adc1 Found by: call frame info 11 MuseScore4.exe!mu::audio::TrackSequence::~TrackSequence() [tracksequence.cpp : 62 + 0x8] rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799fd10 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x0000000141130f2e Found by: call frame info 12 MuseScore4.exe!mu::audio::TrackSequence::`scalar deleting destructor'(unsigned int) + 0x14 rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799fd60 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x000000014113d2a4 Found by: call frame info 13 MuseScore4.exe!void deto::async::AsyncImpl::Functor< >::call() [asyncimpl.h : 27 + 0xe2] rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799fd90 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x00000001410c8852 Found by: call frame info 14 MuseScore4.exe!deto::async::AsyncImpl::onCall(unsigned __int64) [asyncimpl.cpp : 62 + 0x18] rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799fdc0 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x00000001407b5ad1 Found by: call frame info 15 MuseScore4.exe!deto::async::QueuedInvoker::processEvents() [queuedinvoker.cpp : 36 + 0x6] rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799fe00 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x00000001407b8591 Found by: call frame info 16 MuseScore4.exe!mu::audio::AudioThread::main() [audiothread.cpp : 86 + 0x5] rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799fea0 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x0000000141098e05 Found by: call frame info 17 MuseScore4.exe!static unsigned int std::thread::_Invoke >,0>(void *) [thread : 55 + 0x8] rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799ff00 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x000000014106dfb1 Found by: call frame info 18 MuseScore4.exe!static unsigned long thread_start(void *) [thread.cpp : 97 + 0x17] rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799ff30 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x000000014233275e Found by: call frame info 19 KERNEL32.DLL + 0x2c7e7 rbx = 0x0000000099ba0dd0 rbp = 0x00000000d57cca00 rsp = 0x000000000799ff60 r12 = 0x0000000004b1ede0 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x00000000d57cca48 rip = 0x00007fff703dc7e7 Found by: call frame info 20 ntdll.dll + 0x4c7c0 rbp = 0x00000000d57cca00 rsp = 0x000000000799ff90 rip = 0x00007fff70eac7c0 Found by: stack scanning 21 KERNELBASE.dll + 0xf5130 rbp = 0x00000000d57cca00 rsp = 0x000000000799ffc0 rip = 0x00007fff6e715130 Found by: stack scanning ```

Could you provide the score on which you are reproducing the crash? The score is needed to understand what mixer objects you are creating and in what quantity.

Also, if you have time, could you test this build? (It's a build from a PR that might fix the afore mentioned issue)

Fristover commented 10 months ago

Sure! Here's the last score the issue happened with (though this happens with every score randomly, can't really find a file that reproduces this every time or anything similar, sadly):

CANTILÈNE.mscz.zip

I'm gonna comment again when I test the mentioned build, hope it works!

Fristover commented 10 months ago

Ok it almost made me think it was fixed on that build but got a crash after many attempts, attaching the diagnostic files and the score just in case it's a different issue:

ohno.zip

Journey_To_the_Island.mscz.zip (Yes, that one, just ignore it, xD)

Eism commented 10 months ago

@Fristover Good news - I can reproduce the crash on your score. Another good news - I also see that solution https://github.com/musescore/MuseScore/pull/14790 fixes the crash.

About the new crashes: From your logs, I can see that you are trying to close the project during an active export. To reproduce this crash, the user simply needs to press Ctrl+W with the export progress dialog open, for example, when exporting to MP3. However, the user can also do this when exporting to formats that don't have a progress dialog simply by quickly pressing Ctrl+W after closing the export dialog.

I notice that the export code doesn't account for this behaviour, and yes, it's a bug that needs fixing. However, this case is different from the one described in this issue (just closing the project without an active export).

If that's the case, I suggest closing this issue, marking it as a duplicate of #9467, and opening a new one specifically for the active export case, if it doesn't already exist.

@bkunda @DmitryArefiev FYI

Fristover commented 10 months ago

Oh, that's curious, I did start an export but cancelled it, then closed the score a while after the dialog disappeared, didn't think that was the cause, haha.

Anyway, glad the main issue is fixed, I guess it's fine to close it. 😁

Fristover commented 9 months ago

Uuhhhh, it's happening again... 3 times today...

Diagnostic files and one of the affected projects here:

https://www.dropbox.com/scl/fo/x356lrpw7ya44zi0yn5uo/h?rlkey=zurkprh3bhoava37xxafvz9f0&dl=0

DmitryArefiev commented 9 months ago

Can't reproduce on my side with the attached score..

@Fristover Are you using MuseScore 4.2.1 (Installed version)?

Fristover commented 9 months ago

It's on every score, that's just the last one where it happened until then

I am using the installed version of 4.2.1, yes (though the Muse Hub still says there's an update [to the same exact version] and fails every time it tries to install it...)

cbjeukendrup commented 9 months ago

Note that https://github.com/musescore/MuseScore/pull/14790, which would fix the crash according to Elnur, has (still) not been merged yet. You can try it out, using these instructions: https://github.com/musescore/MuseScore/wiki/Downloading-and-running-test-builds#downloading-builds-from-pull-requests (@DmitryArefiev Actually it would be great if you could test and merge that PR 😊)

DmitryArefiev commented 9 months ago

@cbjeukendrup Tested. I left a comment in PR

Fristover commented 4 months ago

It's been happening a lot recently (noticed today), will leave the file here just in case...

crash.zip

I should mention I only have one instance open.