Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 923217 - media-sound/musescore-4.2.1-r1: seg fault on saving file
Summary: media-sound/musescore-4.2.1-r1: seg fault on saving file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal critical
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-29 06:58 UTC by William Sherwin
Modified: 2025-01-07 19:29 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Traceback log (mscore_save.err,5.08 KB, text/plain)
2024-01-29 07:00 UTC, William Sherwin
Details
emerge --info (mscore-emerge.info,7.51 KB, text/plain)
2024-01-29 07:04 UTC, William Sherwin
Details
Updated Traceback (mscore-save2.err,10.85 KB, text/plain)
2024-01-29 17:37 UTC, William Sherwin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description William Sherwin 2024-01-29 06:58:54 UTC
As an end-user running MuseScore 4.2.1-r1, when either I create a new file or open an existing file and make a change and attempt to save, I get a segmentation fault just after the Save dialog box (pointing to the file system) appears.

Reproducible: Always

Steps to Reproduce:
1. Open MuseScore.
2. Open a file (new or existing).
3. Make a change.
4. Type CTRL+S (or choose File > Save).
5. Select "Save to My Computer".
Actual Results:  
Segmentation fault. With Address Sanitizer configured, the attached traceback is issued when running from a terminal window.

Expected Results:  
The Save File dialog box is displayed, and the User is able to save the file.

Address Sanitizer was configured as per http://wiki.gentoo.org/wiki/AddressSanitizer, and MuseScore was recompiled with it.
Comment 1 William Sherwin 2024-01-29 07:00:00 UTC
Created attachment 883514 [details]
Traceback log
Comment 2 William Sherwin 2024-01-29 07:04:49 UTC
Created attachment 883515 [details]
emerge --info
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-29 07:50:42 UTC
(In reply to William Sherwin from comment #1)
> Created attachment 883514 [details]
> Traceback log

Did you have debugging symbols for dev-qt/* (no need for it for qtwebengine) and musescore?

See https://wiki.gentoo.org/wiki/Debugging#Per-package.
Comment 4 William Sherwin 2024-01-29 08:03:53 UTC
(In reply to Sam James from comment #3)
> (In reply to William Sherwin from comment #1)
> > Created attachment 883514 [details]
> > Traceback log
> 
> Did you have debugging symbols for dev-qt/* (no need for it for qtwebengine)
> and musescore?
> 
> See https://wiki.gentoo.org/wiki/Debugging#Per-package.

I did not: I will recompile and install them.
Comment 5 Violet Purcell 2024-01-29 13:37:39 UTC
Are you using Wayland? If so, could you make sure you have dev-qt/qtgui[X] installed and try launching musescore with the QT_QPA_PLATFORM=xcb environment variable?
Comment 6 William Sherwin 2024-01-29 17:37:26 UTC
Created attachment 883570 [details]
Updated Traceback
Comment 7 William Sherwin 2024-01-29 17:38:35 UTC
(In reply to Violet Purcell from comment #5)
> Are you using Wayland? If so, could you make sure you have dev-qt/qtgui[X]
> installed and try launching musescore with the QT_QPA_PLATFORM=xcb
> environment variable?

I am not: I'm still using X11.

With the newer traceback, I actually got the Save File modal; after a few seconds, it vanished with the segfault.
Comment 8 Larry the Git Cow gentoo-dev 2024-08-04 11:24:46 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79e1d8024e0c4da90c68a43fc09395663426741f

commit 79e1d8024e0c4da90c68a43fc09395663426741f
Author:     Miroslav Šulc <fordfrog@gentoo.org>
AuthorDate: 2024-08-04 11:24:30 +0000
Commit:     Miroslav Šulc <fordfrog@gentoo.org>
CommitDate: 2024-08-04 11:24:41 +0000

    media-sound/musescore: dropped obsolete 4.2.1-r2
    
    Bug: https://bugs.gentoo.org/937234
    Closes: https://bugs.gentoo.org/927888
    Bug: https://bugs.gentoo.org/926328
    Bug: https://bugs.gentoo.org/923217
    Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>

 media-sound/musescore/Manifest                     |   1 -
 .../files/musescore-4.2.0-unbundle-deps.patch      | 119 ------------------
 media-sound/musescore/metadata.xml                 |   1 -
 media-sound/musescore/musescore-4.2.1-r2.ebuild    | 140 ---------------------
 4 files changed, 261 deletions(-)
Comment 9 Miroslav Šulc gentoo-dev 2024-08-04 11:26:57 UTC
is 4.3.2 still affected?
Comment 10 William Sherwin 2024-08-07 06:58:13 UTC
(In reply to Miroslav Šulc from comment #9)
> is 4.3.2 still affected?

Yes, it is: I just tried it.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-07 07:13:14 UTC
Your backtrace has:
```
12:34:08.341 | INFO  | main_thread     | ActionsDispatcher::dispatch | try call action: file-save
AddressSanitizer:DEADLYSIGNAL
=================================================================
==14887==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x55c21a44a744 bp 0x7fffe1d1b3f0 sp 0x7fffe1d1b170 T0)
==14887==The signal is caused by a READ memory access.
==14887==Hint: address points to the zero page.
    #0 0x55c21a44a744 in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::operator->() const /usr/include/qt5/QtCore/qscopedpointer.h:118
    #1 0x55c21a44a744 in QObject::isWidgetType() const /usr/include/qt5/QtCore/qobject.h:153
    #2 0x55c21a44a744 in mu::ui::InteractiveProvider::raiseWindowInStack(QObject*) /var/tmp/portage/media-sound/musescore-4.2.1-r1/work/MuseScore-4.2.1/src/framework/ui/view/interactiveprovider.cpp:89
    #3 0x55c21a44b958 in operator() /var/tmp/portage/media-sound/musescore-4.2.1-r1/work/MuseScore-4.2.1/src/framework/ui/view/interactiveprovider.cpp:69
    #4 0x55c21a44b958 in call /usr/include/qt5/QtCore/qobjectdefs_impl.h:146
    #5 0x55c21a44b958 in call<QtPrivate::List<QWindow*>, void> /usr/include/qt5/QtCore/qobjectdefs_impl.h:256
    #6 0x55c21a44b958 in impl /usr/include/qt5/QtCore/qobjectdefs_impl.h:443
    #7 0x7ff774ebb2f0 in QtPrivate::QSlotObjectBase::call(QObject*, void**) /var/tmp/portage/dev-qt/qtcore-5.15.12-r1/work/qtbase-everywhere-src-5.15.12/include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
[...]
```

Looking at https://github.com/musescore/MuseScore/blob/d514cf63ade94200648ee56b00a91572e7359df4/src/framework/ui/view/interactiveprovider.cpp#L88 ...

```
void InteractiveProvider::raiseWindowInStack(QObject* newActiveWindow)
{
    if (!newActiveWindow || m_stack.isEmpty() || m_stack.top().window == newActiveWindow) {
        return;
    }

    for (int i = 0; i < m_stack.size(); ++i) {
        bool found = m_stack[i].window == newActiveWindow;
        if (m_stack[i].window->isWidgetType()) {
            found = newActiveWindow->objectName() == (m_stack[i].window->objectName() + "Window");
        }
[...]
```

Maybe try (with absolutely no awareness of what `m_stack` is)
+  if (m_stack[i].window->isWidgetType()) {
-  if (m_stack[i] && m_stack[i].window && m_stack[i].window->isWidgetType()) {

I suppose the 'found' use of m_stack[i].window above may be problematic too.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-07 07:13:52 UTC
(In reply to Sam James from comment #11)
> 
> Maybe try (with absolutely no awareness of what `m_stack` is)
> +  if (m_stack[i].window->isWidgetType()) {
> -  if (m_stack[i] && m_stack[i].window && m_stack[i].window->isWidgetType())

uh, swap - and +

otherwise, please run it under gdb and try see what goes on in that function (breakpoint on the loop and p m_stack first)
Comment 14 Larry the Git Cow gentoo-dev 2025-01-07 19:29:22 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff577d6646e5b6f715f5641e2422b6ff8074b734

commit ff577d6646e5b6f715f5641e2422b6ff8074b734
Author:     Miroslav Šulc <fordfrog@gentoo.org>
AuthorDate: 2025-01-07 19:29:09 +0000
Commit:     Miroslav Šulc <fordfrog@gentoo.org>
CommitDate: 2025-01-07 19:29:17 +0000

    media-sound/musescore: dropped obsolete versions
    
    Bug: https://bugs.gentoo.org/926328
    Closes: https://bugs.gentoo.org/684722
    Closes: https://bugs.gentoo.org/937234
    Closes: https://bugs.gentoo.org/923217
    Closes: https://bugs.gentoo.org/820590
    Closes: https://bugs.gentoo.org/937729
    Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>

 media-sound/musescore/Manifest                     |   3 -
 .../files/musescore-3.0.1-man-pages.patch          |  29 -----
 .../files/musescore-3.6.1-rename-audioitem.patch   |  12 --
 .../musescore-4.2.0-uncompressed-man-pages.patch   |  29 -----
 .../files/musescore-4.2.1-missing-headers.patch    |  63 ---------
 .../files/musescore-4.3.2-unbundle-deps.patch      |  48 -------
 media-sound/musescore/metadata.xml                 |   6 -
 media-sound/musescore/musescore-3.6.2-r1.ebuild    | 127 ------------------
 media-sound/musescore/musescore-4.3.2.ebuild       | 143 ---------------------
 media-sound/musescore/musescore-4.4.3.ebuild       | 134 -------------------
 10 files changed, 594 deletions(-)