musescore / musescore/MuseScore

[Asan + msvc] Test 'iex_capella_tests' failed with new-delete-type-mismatch on windows

Open
#33,576 0 comments 0 reactions 1 assignee View on GitHub

@RomanPudashkin is already working on this.

Since May 26, 2026.

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

Description

Our MSVC team regularly builds popular open-source projects, including yours, with development versions of the build tools in order to find and fix regressions in the compiler and libraries before they can ship and cause trouble for the world. This also allows us to provide advance notice of breaking changes, which is the case here.

Description with steps to reproduce

Building MuseScore with Asan on windows has test ‘iex_capella_tests’ failed. Could you please help to take a look at it? Thanks in advance!

Repro steps:

1. git clone https://github.com/musescore/MuseScore.git C:\gitP\musescore\MuseScore
2. Open VS2022 x64 command line tool
3. set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64 -winsdk=10.0.26100.0 & set _CL_= /Bcapture_repro C:\logs\MuseScore\preprocessed_repro_setup /fsanitize=address /GS- /wd5072 & set _LINK_= /onfailrepro:C:\logs\MuseScore\link_repro_setup /InferASanLibs /incremental:no /debug
4. set PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;%PATH%
5. set _CL_=/await:strict %_CL_%
6. cd /d C:\gitP\musescore\MuseScore\build
7. pip install aqtinstall
8. python -m aqt install-qt windows desktop 6.10.2 win64_msvc2022_64 --modules qtshadertools qt5compat qtnetworkauth qtscxml --outputdir C:\Qt
9. cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.26100.0  -DBUILD_UNIT_TESTS=ON -DMUE_COMPILE_QT5_COMPAT=ON -DCMAKE_PREFIX_PATH="C:\Qt\6.10.2\msvc2022_64" ..
10. msbuild /m /p:Platform=x64 /p:Configuration=Release MuseScore.sln /t:Rebuild
11. set PATH=C:\Program Files\Git\usr\bin;%PATH%
12. set PATH=C:\Qt\6.10.2\msvc2022_64\bin;%PATH%
13. set PATH=C:\gitP\musescore\MuseScore\dependencies\libx64;%PATH%
14. set QT_PLUGIN_PATH=C:\Qt\6.10.2\msvc2022_64\plugins
15. ctest --build-config Release --output-on-failure -V -R “iex_capella_tests”

Failures:

==28536==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x12027eef5e20 in thread T0:
23:   object passed to delete has wrong type:
23:   size of the allocated type:   96 bytes;
23:   size of the deallocated type: 32 bytes.
23:     #0 0x7ff6e7ea0473 in operator delete(void *, unsigned __int64) C:\repos\msvc\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win_delete_scalar_size_thunk.cpp:41
23:     #1 0x7ff6e7ac8972 in mu::iex::capella::ChordObj::readCapxNotes(class mu::engraving::XmlReader &) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:538
23:     #2 0x7ff6e7ac35f6 in mu::iex::capella::ChordObj::readCapx(class mu::engraving::XmlReader &) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:421
23:     #3 0x7ff6e7acbaf7 in mu::iex::capella::Capella::readCapxVoice(class mu::engraving::XmlReader &, struct mu::iex::capella::CapStaff *, int) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:862
23:     #4 0x7ff6e7ac92e4 in mu::iex::capella::Capella::readCapxStaff(class mu::engraving::XmlReader &, struct mu::iex::capella::CapSystem *) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:979
23:     #5 0x7ff6e7acac13 in mu::iex::capella::Capella::readCapxSystem(class mu::engraving::XmlReader &) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:1054
23:     #6 0x7ff6e7aa99ad in mu::iex::capella::Capella::capxSystems(class mu::engraving::XmlReader &) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:1079
23:     #7 0x7ff6e7ac2f86 in mu::iex::capella::Capella::readCapx(class mu::engraving::XmlReader &) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:1401
23:     #8 0x7ff6e7ab21bd in mu::iex::capella::importCapXml(class mu::engraving::MasterScore *, class QString const &) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:1432
23:     #9 0x7ff6e6856980 in Capella_Tests::capxReadTest::__l2::<lambda_1>::operator() C:\gitP\musescore\MuseScore\src\importexport\capella\tests\capella_tests.cpp:76
23:     #10 0x7ff6e6856980 in std::invoke C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\type_traits:1811
23:     #11 0x7ff6e6856980 in std::_Func_impl_no_alloc<`Capella_Tests::capxReadTest'::`2'::<lambda_1>,enum mu::engraving::Err,mu::engraving::MasterScore *,muse::io::path_t const &>::_Do_call C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\functional:1007
23:     #12 0x7ff6e684e252 in std::_Func_class<enum mu::engraving::Err,mu::engraving::MasterScore *,muse::io::path_t const &>::operator() C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\functional:1057
23:     #13 0x7ff6e684e252 in mu::engraving::ScoreRW::readScore(class muse::String const &, bool, class std::function<(class mu::engraving::MasterScore *, struct muse::io::path_t const &)>, class std::shared_ptr<struct kors::modularity::Context> const &) C:\gitP\musescore\MuseScore\src\engraving\tests\utils\scorerw.cpp:73
23:     #14 0x7ff6e685786e in Capella_Tests::capxReadTest(char const *) C:\gitP\musescore\MuseScore\src\importexport\capella\tests\capella_tests.cpp:80
23:     #15 0x7ff6e68556ff in Capella_Tests_capxTestTuplet2_Test::TestBody(void) C:\gitP\musescore\MuseScore\src\importexport\capella\tests\capella_tests.cpp:165
23:     #16 0x7ff6e6866586 in testing::internal::HandleSehExceptionsInMethodIfSupported<class testing::Test, void>(class testing::Test *, void (__cdecl testing::Test::*)(void), char const *) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:2657
23:     #17 0x7ff6e68660db in testing::internal::HandleExceptionsInMethodIfSupported<class testing::Test, void>(class testing::Test *, void (__cdecl testing::Test::*)(void), char const *) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:2700
23:     #18 0x7ff6e68cb539 in testing::TestInfo::Run(void) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:2885
23:     #19 0x7ff6e68cba13 in testing::TestSuite::Run(void) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:3063
23:     #20 0x7ff6e68cd321 in testing::internal::UnitTestImpl::RunAllTests(void) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:6054
23:     #21 0x7ff6e68665e6 in testing::internal::HandleSehExceptionsInMethodIfSupported<class testing::internal::UnitTestImpl, bool>(class testing::internal::UnitTestImpl *, bool (__cdecl testing::internal::UnitTestImpl::*)(void), char const *) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:2657
23:     #22 0x7ff6e68664d9 in testing::internal::HandleExceptionsInMethodIfSupported<class testing::internal::UnitTestImpl, bool>(class testing::internal::UnitTestImpl *, bool (__cdecl testing::internal::UnitTestImpl::*)(void), char const *) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:2700
23:     #23 0x7ff6e68cbe1b in testing::UnitTest::Run(void) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:5594
23:     #24 0x7ff6e68455f9 in RUN_ALL_TESTS C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\include\gtest\gtest.h:2334
23:     #25 0x7ff6e68455f9 in main C:\gitP\musescore\MuseScore\muse\framework\testing\gmain.cpp:89
23:     #26 0x7ff6e7ea174e in invoke_main C:\repos\msvc\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
23:     #27 0x7ff6e7ea174e in __scrt_common_main_seh C:\repos\msvc\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
23:     #28 0x7ffa4ec7259c  (C:\Windows\System32\KERNEL32.DLL+0x18001259c)
23:     #29 0x7ffa50b2afb7  (C:\Windows\SYSTEM32\ntdll.dll+0x18005afb7)
23: 
23: 0x12027eef5e20 is located 0 bytes inside of 96-byte region [0x12027eef5e20,0x12027eef5e80)
23: allocated by thread T0 here:
23:     #0 0x7ff6e7ea03e5 in operator new(unsigned __int64) C:\repos\msvc\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win_new_scalar_thunk.cpp:40
23:     #1 0x7ff6e7ac748f in mu::iex::capella::Capella::readCapxDrawObjectArray(class mu::engraving::XmlReader &) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:779
23:     #2 0x7ff6e7ac8a14 in mu::iex::capella::BasicDurationalObj::readCapxObjectArray(class mu::engraving::XmlReader &) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:191
23:     #3 0x7ff6e7ac358d in mu::iex::capella::ChordObj::readCapx(class mu::engraving::XmlReader &) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:419
23:     #4 0x7ff6e7acbaf7 in mu::iex::capella::Capella::readCapxVoice(class mu::engraving::XmlReader &, struct mu::iex::capella::CapStaff *, int) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:862
23:     #5 0x7ff6e7ac92e4 in mu::iex::capella::Capella::readCapxStaff(class mu::engraving::XmlReader &, struct mu::iex::capella::CapSystem *) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:979
23:     #6 0x7ff6e7acac13 in mu::iex::capella::Capella::readCapxSystem(class mu::engraving::XmlReader &) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:1054
23:     #7 0x7ff6e7aa99ad in mu::iex::capella::Capella::capxSystems(class mu::engraving::XmlReader &) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:1079
23:     #8 0x7ff6e7ac2f86 in mu::iex::capella::Capella::readCapx(class mu::engraving::XmlReader &) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:1401
23:     #9 0x7ff6e7ab21bd in mu::iex::capella::importCapXml(class mu::engraving::MasterScore *, class QString const &) C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:1432
23:     #10 0x7ff6e6856980 in Capella_Tests::capxReadTest::__l2::<lambda_1>::operator() C:\gitP\musescore\MuseScore\src\importexport\capella\tests\capella_tests.cpp:76
23:     #11 0x7ff6e6856980 in std::invoke C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\type_traits:1811
23:     #12 0x7ff6e6856980 in std::_Func_impl_no_alloc<`Capella_Tests::capxReadTest'::`2'::<lambda_1>,enum mu::engraving::Err,mu::engraving::MasterScore *,muse::io::path_t const &>::_Do_call C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\functional:1007
23:     #13 0x7ff6e684e252 in std::_Func_class<enum mu::engraving::Err,mu::engraving::MasterScore *,muse::io::path_t const &>::operator() C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\functional:1057
23:     #14 0x7ff6e684e252 in mu::engraving::ScoreRW::readScore(class muse::String const &, bool, class std::function<(class mu::engraving::MasterScore *, struct muse::io::path_t const &)>, class std::shared_ptr<struct kors::modularity::Context> const &) C:\gitP\musescore\MuseScore\src\engraving\tests\utils\scorerw.cpp:73
23:     #15 0x7ff6e685786e in Capella_Tests::capxReadTest(char const *) C:\gitP\musescore\MuseScore\src\importexport\capella\tests\capella_tests.cpp:80
23:     #16 0x7ff6e68556ff in Capella_Tests_capxTestTuplet2_Test::TestBody(void) C:\gitP\musescore\MuseScore\src\importexport\capella\tests\capella_tests.cpp:165
23:     #17 0x7ff6e6866586 in testing::internal::HandleSehExceptionsInMethodIfSupported<class testing::Test, void>(class testing::Test *, void (__cdecl testing::Test::*)(void), char const *) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:2657
23:     #18 0x7ff6e68660db in testing::internal::HandleExceptionsInMethodIfSupported<class testing::Test, void>(class testing::Test *, void (__cdecl testing::Test::*)(void), char const *) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:2700
23:     #19 0x7ff6e68cb539 in testing::TestInfo::Run(void) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:2885
23:     #20 0x7ff6e68cba13 in testing::TestSuite::Run(void) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:3063
23:     #21 0x7ff6e68cd321 in testing::internal::UnitTestImpl::RunAllTests(void) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:6054
23:     #22 0x7ff6e68665e6 in testing::internal::HandleSehExceptionsInMethodIfSupported<class testing::internal::UnitTestImpl, bool>(class testing::internal::UnitTestImpl *, bool (__cdecl testing::internal::UnitTestImpl::*)(void), char const *) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:2657
23:     #23 0x7ff6e68664d9 in testing::internal::HandleExceptionsInMethodIfSupported<class testing::internal::UnitTestImpl, bool>(class testing::internal::UnitTestImpl *, bool (__cdecl testing::internal::UnitTestImpl::*)(void), char const *) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:2700
23:     #24 0x7ff6e68cbe1b in testing::UnitTest::Run(void) C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\src\gtest.cc:5594
23:     #25 0x7ff6e68455f9 in RUN_ALL_TESTS C:\gitP\musescore\MuseScore\muse\framework\testing\thirdparty\googletest\googletest\include\gtest\gtest.h:2334
23:     #26 0x7ff6e68455f9 in main C:\gitP\musescore\MuseScore\muse\framework\testing\gmain.cpp:89
23:     #27 0x7ff6e7ea174e in invoke_main C:\repos\msvc\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
23:     #28 0x7ff6e7ea174e in __scrt_common_main_seh C:\repos\msvc\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
23:     #29 0x7ffa4ec7259c  (C:\Windows\System32\KERNEL32.DLL+0x18001259c)
23:     #30 0x7ffa50b2afb7  (C:\Windows\SYSTEM32\ntdll.dll+0x18005afb7)
23: 
23: SUMMARY: AddressSanitizer: new-delete-type-mismatch C:\gitP\musescore\MuseScore\src\importexport\capella\internal\capxml.cpp:538 in mu::iex::capella::ChordObj::readCapxNotes(class mu::engraving::XmlReader &)
23: ==28536==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
23: ==28536==ABORTING
23/31 Test #23: iex_capella_tests ................***Failed   19.04 sec
Supporting files, videos and screenshots

Test (2).log

In which versions of MuseScore Studio is this issue present?

e8df477

Regression

Choose option...

Operating system

windows 11

Additional context

No response

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.