Review Request 126313: Use an xcb for interaction with KStartupInfo

Martin Gräßlin mgraesslin at kde.org
Tue Jan 26 06:55:41 UTC 2016



> On Jan. 25, 2016, 10:36 p.m., Luca Beltrame wrote:
> > FYI, this breaks Plasma 5 startup completely for me. kinit crashes with
> > 
> > ```gdb
> > #0  0x00007ff831e58c20 in QObject::thread() const () at /usr/lib64/libQt5Core.so.5
> > #1  0x00007ff8329d1a20 in KWindowSystem::d_func() () at /usr/lib64/libKF5WindowSystem.so.5
> > #2  0x00007ff8329d2cc9 in KWindowSystem::mapViewport() () at /usr/lib64/libKF5WindowSystem.so.5
> > #3  0x00007ff8329dce02 in NETRootInfo::currentDesktop(bool) const () at /usr/lib64/libKF5WindowSystem.so.5
> > #4  0x0000000000408d09 in launch(int, char const*, char const*, char const*, int, char const*, bool, char const*, bool, char const*) (this=0x8e4458)
> >     at /usr/include/qt5/QtCore/qbytearray.h:485
> > #5  0x0000000000408d09 in launch(int, char const*, char const*, char const*, int, char const*, bool, char const*, bool, char const*) (this=0x8e4458)
> >     at /usr/include/qt5/QtCore/qbytearray.h:479
> > #6  0x0000000000408d09 in launch(int, char const*, char const*, char const*, int, char const*, bool, char const*, bool, char const*) (argc=32767, _name=0x7ffffdb02e20 "\020c\215", args=0x8e446b "/home/lb", cwd=<optimized out>, envc=<optimized out>, envs=<optimized out>, reset_env=false, tty=0x8e55b0 "", avoid_loops=160, startup_id_str=0x1161 <error: Cannot access memory at address 0x1161>)
> >     at /home/lb/Coding/KDEsrc/kinit/src/kdeinit/kinit.cpp:643
> > #7  0x00000000008e559d in  ()
> > #8  0x0000000000000000 in  ()
> > ```
> > 
> > I had to revert it or kdeinit would crash and prevent me from having a functional session. ;)
> 
> Andreas Hartmetz wrote:
>     Same here.
> 
> Martin Gräßlin wrote:
>     sorry about that, I'm on it.

The problem is that kinit is not a QCoreApplication and it crashes when accessing the ::instance(). A possible workaround for kinit is (not yet tested):

    diff --git a/src/kdeinit/kinit.cpp b/src/kdeinit/kinit.cpp
    index 9919547..8b5c926 100644
    --- a/src/kdeinit/kinit.cpp
    +++ b/src/kdeinit/kinit.cpp
    @@ -375,7 +375,7 @@ static void init_startup_info(KStartupInfoId &id, const QByteArray &bin,
         X11_startup_notify_fd = xcb_get_file_descriptor(s_startup_notify_connection);
         NETRootInfo rootInfo(s_startup_notify_connection, NET::CurrentDesktop);
         KStartupInfoData data;
    -    data.setDesktop(rootInfo.currentDesktop());
    +    data.setDesktop(rootInfo.currentDesktop(true));
         data.setBin(QFile::decodeName(bin));
         KStartupInfo::sendChangeXcb(s_startup_notify_connection, s_startup_notify_screen, id, data);
         xcb_flush(s_startup_notify_connection);


I'll also try to harden KWindowSystem against that.


- Martin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126313/#review91596
-----------------------------------------------------------


On Jan. 25, 2016, 3:34 p.m., Martin Gräßlin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126313/
> -----------------------------------------------------------
> 
> (Updated Jan. 25, 2016, 3:34 p.m.)
> 
> 
> Review request for KDE Frameworks and David Faure.
> 
> 
> Repository: kinit
> 
> 
> Description
> -------
> 
> By changing to xcb we can use NETRootInfo to get the current desktop
> and don't need to duplicate the logic. Also it means that more code
> is ported from XLib to xcb and might allow us to drop the XLib
> dependency in future.
> 
> 
> Diffs
> -----
> 
>   CMakeLists.txt eeecab775cfb5dfe12cf9c4991c658cc261ed727 
>   src/config-kdeinit.h.cmake cfcfc61a1bb560ff9a902b89bd3b8fb27273ebf2 
>   src/kdeinit/CMakeLists.txt f94db717f2403b602648286eac243837d8714069 
>   src/kdeinit/kinit.cpp a18008a11bf00a35aa0cab450180926217cd58f5 
> 
> Diff: https://git.reviewboard.kde.org/r/126313/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Martin Gräßlin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160126/0badaa25/attachment.html>


More information about the Kde-frameworks-devel mailing list