Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing project crashes MS instance #20692

Open
Fristover opened this issue Dec 24, 2023 · 18 comments
Open

Closing project crashes MS instance #20692

Fristover opened this issue Dec 24, 2023 · 18 comments
Assignees
Labels
crash Issues involving a crash of MuseScore needs info More information is required before action can be taken

Comments

@Fristover
Copy link

Fristover commented Dec 24, 2023

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)

@muse-bot muse-bot added the crash Issues involving a crash of MuseScore label Dec 24, 2023
@bkunda
Copy link

bkunda commented Dec 29, 2023

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!

@bkunda bkunda added the needs info More information is required before action can be taken label Dec 29, 2023
@Fristover
Copy link
Author

Sure! Sending now...

oops.zip

Really hope this helps, it is quite annoying. 😓

@Eism
Copy link
Contributor

Eism commented Jan 8, 2024

@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
Copy link

bkunda commented Jan 16, 2024

@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
Copy link
Author

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

@Fristover
Copy link
Author

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

@Eism
Copy link
Contributor

Eism commented Jan 17, 2024

@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 #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<unsigned char,mu::audio::AudioSignalVal>::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::_Tmap_traits<int,std::shared_ptr<mu::audio::Track>,std::less<int>,std::allocator<std::pair<int const ,std::shared_ptr<mu::audio::Track> > >,0> >::_Erase_unchecked(std::_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<int const ,std::shared_ptr<mu::audio::Track> > > >,std::_Iterator_base0>,std::_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<int const ,std::shared_ptr<mu::audio::Track> > > >,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<<lambda_043dadd8e5763f1980dc61df743e4cef> >::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<std::tuple<<lambda_c81d4b0265f46663551cebde49914b34> >,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<unsigned int (__cdecl*)(void *),1>(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
Copy link
Author

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
Copy link
Author

Fristover commented Jan 17, 2024

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
Copy link
Contributor

Eism commented Jan 19, 2024

@Fristover
Good news - I can reproduce the crash on your score. Another good news - I also see that solution #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
Copy link
Author

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
Copy link
Author

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

@Fristover Fristover reopened this Feb 5, 2024
@DmitryArefiev
Copy link
Contributor

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

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

@Fristover
Copy link
Author

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
Copy link
Contributor

Note that #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
Copy link
Contributor

@cbjeukendrup Tested. I left a comment in PR

@Fristover
Copy link
Author

Fristover commented Jul 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Issues involving a crash of MuseScore needs info More information is required before action can be taken
Projects
None yet
Development

No branches or pull requests

7 participants