https://bugs.kde.org/show_bug.cgi?id=413892

--- Comment #6 from Méven Car <meve...@gmail.com> ---
Copying better stack trace from duplicate
https://bugs.kde.org/show_bug.cgi?id=417864:

Thread 1 (Thread 0x7f6411926800 (LWP 7501)):
[KCrash Handler]
#6  0x00007f63ffd89564 in KWayland::Client::OutputDevice::enabled
(this=0x560bc9a8fd30) at ./src/client/outputdevice.cpp:535
#7  0x00007f63d3df5566 in KScreen::WaylandOutput::updateKScreenOutput
(this=this@entry=0x560bd9240f00, output=...) at
./backends/kwayland/waylandoutput.cpp:102
#8  0x00007f63d3df67fc in KScreen::WaylandOutput::toKScreenOutput
(this=0x560bd9240f00) at ./backends/kwayland/waylandoutput.cpp:94
#9  0x00007f63d3dede0e in KScreen::WaylandConfig::currentConfig
(this=0x560bd91bbfe0) at ./backends/kwayland/waylandconfig.cpp:294
#10 0x00007f63d3debcb3 in KScreen::WaylandBackend::<lambda()>::operator()
(__closure=<optimized out>) at ./backends/kwayland/waylandbackend.cpp:45
#11 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void,
KScreen::WaylandBackend::WaylandBackend()::<lambda()> >::call (arg=<optimized
out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:146
#12 QtPrivate::Functor<KScreen::WaylandBackend::WaylandBackend()::<lambda()>,
0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...) at
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:256
#13
QtPrivate::QFunctorSlotObject<KScreen::WaylandBackend::WaylandBackend()::<lambda()>,
0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *,
void **, bool *) (which=1, this_=<optimized out>, r=<optimized out>,
a=<optimized out>, ret=<optimized out>) at
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:439
#14 0x00007f640d79391f in QtPrivate::QSlotObjectBase::call (a=0x7fff51f2c8c0,
r=0x560bd926d010, this=<optimized out>) at
../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394
#15 QMetaObject::activate (sender=sender@entry=0x560bd91bbfe0,
signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0,
argv=<optimized out>, argv@entry=0x0) at kernel/qobject.cpp:3789
#16 0x00007f640d793ec7 in QMetaObject::activate
(sender=sender@entry=0x560bd91bbfe0, m=m@entry=0x7f63d3ffec80
<KScreen::WaylandConfig::staticMetaObject>,
local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at
kernel/qobject.cpp:3660
#17 0x00007f63d3dfb050 in KScreen::WaylandConfig::configChanged
(this=this@entry=0x560bd91bbfe0) at
./obj-x86_64-linux-gnu/backends/kwayland/KSC_KWayland_autogen/EWIEGA46WW/moc_waylandconfig.cpp:143
#18 0x00007f63d3df208c in KScreen::WaylandConfig::removeOutput
(this=0x560bd91bbfe0, output=<optimized out>) at
./backends/kwayland/waylandconfig.cpp:253
#19 0x00007f640d79391f in QtPrivate::QSlotObjectBase::call (a=0x7fff51f2ca20,
r=0x560bd91bbfe0, this=<optimized out>) at
../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394
#20 QMetaObject::activate (sender=0x560bd9240f00, signalOffset=<optimized out>,
local_signal_index=<optimized out>, argv=<optimized out>) at
kernel/qobject.cpp:3789
#21 0x00007f640d79391f in QtPrivate::QSlotObjectBase::call (a=0x7fff51f2cb20,
r=0x560bd9240f00, this=<optimized out>) at
../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394
#22 QMetaObject::activate (sender=0x560bd91c82a0, signalOffset=<optimized out>,
local_signal_index=<optimized out>, argv=<optimized out>) at
kernel/qobject.cpp:3789
#23 0x00007f640d79391f in QtPrivate::QSlotObjectBase::call (a=0x7fff51f2cc80,
r=0x560bd91c82a0, this=<optimized out>) at
../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394
#24 QMetaObject::activate (sender=0x560bd9138a00, signalOffset=<optimized out>,
local_signal_index=local_signal_index@entry=77, argv=<optimized out>,
argv@entry=0x7fff51f2cc80) at kernel/qobject.cpp:3789
#25 0x00007f640d793ec7 in QMetaObject::activate (sender=<optimized out>,
m=m@entry=0x7f6400003360 <KWayland::Client::Registry::staticMetaObject>,
local_signal_index=local_signal_index@entry=77, argv=argv@entry=0x7fff51f2cc80)
at kernel/qobject.cpp:3660
#26 0x00007f63ffdbff81 in KWayland::Client::Registry::interfaceRemoved
(this=<optimized out>, _t1=<optimized out>) at
./obj-x86_64-linux-gnu/src/client/KF5WaylandClient_autogen/EWIEGA46WW/moc_registry.cpp:1597


It seems that in KScreen :

void WaylandConfig::removeOutput(WaylandOutput *output)
{
    if (m_initializingOutputs.removeOne(output)) {
        // output was not yet fully initialized, just remove here and return
        delete output;
        return;
    }

    // remove the output from output mapping
    Q_ASSERT(m_outputMap.take(output->id()) == output);
    m_screen->setOutputs(m_outputMap.values());
    delete output;

    if (!m_blockSignals) {
        Q_EMIT configChanged();
    }
}

Somehow does not remove the output from m_outputMap causing down the line a
classic null pointer segfault.
Could output be nullpointer ?

The issue could be in WaylandConfig::addOutput and how the WaylandOutput is set
up :

void WaylandConfig::addOutput(quint32 name, quint32 version)
{
    WaylandOutput *waylandoutput = new WaylandOutput(++s_outputId, this);
    m_initializingOutputs << waylandoutput;

    connect(waylandoutput, &WaylandOutput::deviceRemoved, this, [this,
waylandoutput]() {
        removeOutput(waylandoutput);
    });
    waylandoutput->createOutputDevice(m_registry, name, version);

    // finalize: when the output is done, we put it in the known outputs map,
    // remove if from the list of initializing outputs, and emit
configChanged()
    connect(waylandoutput, &WaylandOutput::complete, this, [this,
waylandoutput]{
        m_outputMap.insert(waylandoutput->id(), waylandoutput);
        m_initializingOutputs.removeOne(waylandoutput);
        checkInitialized();

        if (!m_blockSignals && m_initializingOutputs.empty()) {
            m_screen->setOutputs(m_outputMap.values());
            Q_EMIT configChanged();
        }

        connect(waylandoutput, &WaylandOutput::changed, this, [this]() {
            if (!m_blockSignals) {
                Q_EMIT configChanged();
            }
        });
    });
}

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to