musescore / musescore/MuseScore

Crash when using mscore from the command line (without GUI)

Open
#34,445 2 comments 0 reactions 2 assignees View on GitHub

@RomanPudashkin is already working on this.

Since Aug 4, 2026.

crash needs review regression MS4
Dominant language
C++
Stars
15.1k
Forks
3.3k
Avg merge
2d 2h
Merged PRs (30d)
91

Description

Issue type

Crash or freeze

Description with steps to reproduce

Whenever I run mscore from the command line without the graphical interface (e.g. to export parts or PDF), the application crashes right before ending due to an uncaught exception:

libc++abi: terminating due to uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument

Specifically, it seems related to the audio engine, according to my debugger it's taking place in:

kors::async::ChannelImpl<muse::audio::AudioOutputParams>::~ChannelImpl(this=0x0000000c8ed55818) at channelimpl.h:555:42

This happens right at the program's end, so whatever you wanted to generate has been successfully generated already, but it's still a crash nonetheless.

Example command to reproduce:

  1. mscore score.mscx -o score.pdf

Actual: successfully generates the PDF but then crashes
Expected: generates the PDF and closes gracefully

Supporting files, videos and screenshots
In which versions of MuseScore Studio is this issue present?

4.7.0 - 4.7.5

Regression

Yes, this used to work in a previous version of MuseScore 4.x

Operating system

macOS 26.5

Additional context

Full backtrace:

* thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    * frame #0: 0x0000000182e5a5e8 libsystem_kernel.dylib`__pthread_kill + 8
      frame #1: 0x0000000182e958d8 libsystem_pthread.dylib`pthread_kill + 296
      frame #2: 0x0000000182d9c644 libsystem_c.dylib`abort + 148
      frame #3: 0x0000000182e4c72c libc++abi.dylib`__abort_message + 132
      frame #4: 0x0000000182e39570 libc++abi.dylib`demangling_terminate_handler() + 272
      frame #5: 0x0000000182a548a4 libobjc.A.dylib`_objc_terminate() + 172
      frame #6: 0x0000000182e4975c libc++abi.dylib`std::__terminate(void (*)()) + 16
      frame #7: 0x0000000182e49710 libc++abi.dylib`std::terminate() + 108
      frame #8: 0x000000010000a018 mscore`__clang_call_terminate + 16
      frame #9: 0x0000000100b636e4 mscore`kors::async::ChannelImpl<muse::audio::AudioOutputParams>::~ChannelImpl(this=0x0000000c8ed55818) at channelimpl.h:555:42
      frame #10: 0x0000000100b60880 mscore`kors::async::ChannelImpl<muse::audio::AudioOutputParams>::~ChannelImpl(this=0x0000000c8ed55818) at channelimpl.h:554:5
      frame #11: 0x0000000100b69a94 mscore`kors::async::Channel<muse::audio::AudioOutputParams>::Data::~Data(this=0x0000000c8ed55818) at channel.h:43:12
      frame #12: 0x0000000100b69a5c mscore`kors::async::Channel<muse::audio::AudioOutputParams>::Data::~Data(this=0x0000000c8ed55818) at channel.h:43:12
      frame #13: 0x0000000100b69a34 mscore`std::__1::allocator<kors::async::Channel<muse::audio::AudioOutputParams>::Data>::destroy[abi:nqe210106](this=0x000000016fdfe577, __p=0x0000000c8ed55818) at allocator.h:156:87
      frame #14: 0x0000000100b69a0c mscore`void std::__1::allocator_traits<std::__1::allocator<kors::async::Channel<muse::audio::AudioOutputParams>::Data>>::destroy[abi:nqe210106]<kors::async::Channel<muse::audio::AudioOutputParams>::Data, 0>(__a=0x000000016fdfe577, __p=0x0000000c8ed55818) at allocator_traits.h:308:9
      frame #19: 0x0000000100b1f7d0 mscore`std::__1::shared_ptr<kors::async::Channel<muse::audio::AudioOutputParams>::Data>::~shared_ptr[abi:nqe210106](this=0x0000000c8fa95fc0) at shared_ptr.h:561:17
      frame #20: 0x0000000100b1f788 mscore`std::__1::shared_ptr<kors::async::Channel<muse::audio::AudioOutputParams>::Data>::~shared_ptr[abi:nqe210106](this=0x0000000c8fa95fc0) at shared_ptr.h:559:39
      frame #21: 0x0000000100b1f75c mscore`kors::async::Channel<muse::audio::AudioOutputParams>::~Channel(this=0x0000000c8fa95fc0) at channel.h:69:24
      frame #22: 0x0000000100b1f318 mscore`kors::async::Channel<muse::audio::AudioOutputParams>::~Channel(this=0x0000000c8fa95fc0) at channel.h:69:24
      frame #23: 0x0000000100ee8a68 mscore`muse::audio::engine::EnginePlayback::~EnginePlayback(this=0x0000000c8fa95e18) at engineplayback.h:42:7
      frame #24: 0x0000000100ee0f10 mscore`muse::audio::engine::EnginePlayback::~EnginePlayback(this=0x0000000c8fa95e18) at engineplayback.h:42:7
      frame #25: 0x0000000100eed9a0 mscore`std::__1::allocator<muse::audio::engine::EnginePlayback>::destroy[abi:nqe210106](this=0x000000016fdfe727, __p=0x0000000c8fa95e18) at allocator.h:156:87
      frame #26: 0x0000000100eed970 mscore`void std::__1::allocator_traits<std::__1::allocator<muse::audio::engine::EnginePlayback>>::destroy[abi:nqe210106]<muse::audio::engine::EnginePlayback, 0>(__a=0x000000016fdfe727, __p=0x0000000c8fa95e18) at allocator_traits.h:308:9
      frame #31: 0x0000000100ee9948 mscore`std::__1::shared_ptr<muse::audio::engine::EnginePlayback>::~shared_ptr[abi:nqe210106](this=0x0000000c8f99dd90) at shared_ptr.h:561:17
      frame #32: 0x0000000100ec3fdc mscore`std::__1::shared_ptr<muse::audio::engine::EnginePlayback>::~shared_ptr[abi:nqe210106](this=0x0000000c8f99dd90) at shared_ptr.h:559:39
      frame #33: 0x0000000100ee947c mscore`muse::audio::engine::EngineController::~EngineController(this=0x0000000c8f99dd18) at enginecontroller.h:51:7
      frame #34: 0x0000000100ee0fd4 mscore`muse::audio::engine::EngineController::~EngineController(this=0x0000000c8f99dd18) at enginecontroller.h:51:7
      frame #35: 0x0000000100b980b4 mscore`std::__1::allocator<muse::audio::engine::EngineController>::destroy[abi:nqe210106](this=0x000000016fdfe897, __p=0x0000000c8f99dd18) at allocator.h:156:87
      frame #36: 0x0000000100b98084 mscore`void std::__1::allocator_traits<std::__1::allocator<muse::audio::engine::EngineController>>::destroy[abi:nqe210106]<muse::audio::engine::EngineController, 0>(__a=0x000000016fdfe897, __p=0x0000000c8f99dd18) at allocator_traits.h:308:9
      frame #41: 0x0000000100b97748 mscore`std::__1::shared_ptr<muse::audio::engine::EngineController>::~shared_ptr[abi:nqe210106](this=0x0000000c8ee03960) at shared_ptr.h:561:17
      frame #42: 0x0000000100b09730 mscore`std::__1::shared_ptr<muse::audio::engine::EngineController>::~shared_ptr[abi:nqe210106](this=0x0000000c8ee03960) at shared_ptr.h:559:39
      frame #43: 0x0000000100b2a21c mscore`muse::audio::StartAudioController::~StartAudioController(this=0x0000000c8ee03818) at startaudiocontroller.h:42:7
      frame #44: 0x0000000100b16170 mscore`muse::audio::StartAudioController::~StartAudioController(this=0x0000000c8ee03818) at startaudiocontroller.h:42:7
      frame #45: 0x0000000100b851d0 mscore`std::__1::allocator<muse::audio::StartAudioController>::destroy[abi:nqe210106](this=0x000000016fdfea07, __p=0x0000000c8ee03818) at allocator.h:156:87
      frame #46: 0x0000000100b851a0 mscore`void std::__1::allocator_traits<std::__1::allocator<muse::audio::StartAudioController>>::destroy[abi:nqe210106]<muse::audio::StartAudioController, 0>(__a=0x000000016fdfea07, __p=0x0000000c8ee03818) at allocator_traits.h:308:9
      frame #51: 0x000000010004ba48 mscore`std::__1::shared_ptr<kors::modularity::IModuleInterface>::~shared_ptr[abi:nqe210106](this=0x0000000c8f1536b0) at shared_ptr.h:561:17
      frame #52: 0x000000010004b108 mscore`std::__1::shared_ptr<kors::modularity::IModuleInterface>::~shared_ptr[abi:nqe210106](this=0x0000000c8f1536b0) at shared_ptr.h:559:39
      frame #53: 0x00000001000b173c mscore`kors::modularity::ModulesIoC::Service::~Service(this=0x0000000c8f153690) at modulesioc.h:221:12
      frame #54: 0x00000001000b0810 mscore`kors::modularity::ModulesIoC::Service::~Service(this=0x0000000c8f153690) at modulesioc.h:221:12
      frame #55: 0x00000001000b1428 mscore`std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char>> const, kors::modularity::ModulesIoC::Service>::~pair(this=0x0000000c8f153680) at pair.h:90:8
      frame #56: 0x00000001000b13f8 mscore`std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char>> const, kors::modularity::ModulesIoC::Service>::~pair(this=0x0000000c8f153680) at pair.h:90:8
      frame #58: 0x00000001000b1378 mscore`void std::__1::allocator_traits<std::__1::allocator<std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string_view<char, std::__1::char_traits<char>>, kors::modularity::ModulesIoC::Service>, void*>>>::destroy[abi:nqe210106]<std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char>> const, kors::modularity::ModulesIoC::Service>, 0>((null)=0x00000001075b4e70, __p=0x0000000c8f153680) at allocator_traits.h:313:5
      frame #63: 0x00000001048a2948 mscore`std::__1::map<std::__1::basic_string_view<char, std::__1::char_traits<char>>, kors::modularity::ModulesIoC::Service, std::__1::less<std::__1::basic_string_view<char, std::__1::char_traits<char>>>, std::__1::allocator<std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char>> const, kors::modularity::ModulesIoC::Service>>>::~map[abi:nqe210106](this=size=98) at map:1014:117
      frame #64: 0x00000001048a291c mscore`std::__1::map<std::__1::basic_string_view<char, std::__1::char_traits<char>>, kors::modularity::ModulesIoC::Service, std::__1::less<std::__1::basic_string_view<char, std::__1::char_traits<char>>>, std::__1::allocator<std::__1::pair<std::__1::basic_string_view<char, std::__1::char_traits<char>> const, kors::modularity::ModulesIoC::Service>>>::~map[abi:nqe210106](this=size=98) at map:1014:32
      frame #65: 0x00000001048a28f0 mscore`kors::modularity::ModulesIoC::~ModulesIoC(this=0x00000001075b4e68) at modulesioc.h:36:7
      frame #66: 0x0000000104891ddc mscore`kors::modularity::ModulesIoC::~ModulesIoC(this=0x00000001075b4e68) at modulesioc.h:36:7
      frame #67: 0x0000000182d4b7f4 libsystem_c.dylib`__cxa_finalize_ranges + 416
      frame #68: 0x0000000182d4b5f4 libsystem_c.dylib`exit + 44
      frame #69: 0x0000000182aa02e4 libdyld.dylib`dyld4::LibSystemHelpers::exit(int) const + 20
      frame #70: 0x0000000182ad7f0c dyld`dyld4::LibSystemHelpersWrapper::exit(int) const + 164
      frame #71: 0x0000000182ad7e30 dyld`start + 7040
Checklist
  • This report follows the guidelines for reporting bugs and issues
  • I have verified that this issue has not been logged before, by searching the issue tracker for similar issues
  • I have attached all requested files and information to this report
  • I have attempted to identify the root problem as concisely as possible, and have used minimal reproducible examples where possible

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.