tildearrow / kwin-lowlatency

archived - X11 full-screen unredirection and lots'a settings for KWin
373 stars 10 forks source link

Crashes on login with nvidia / optimus-manager #80

Open rnd-ash opened 4 years ago

rnd-ash commented 4 years ago

When using optimus manager to use the nvidia GPU, every single cold reboot results in kwin crashing back to the lockscreen after logging in.

It would appear a temp solution to this would be for me to issue the reboot command, then things work normally at the next login...but then i find myself having to constantly re-enable OpenGL in the compositor settings.

I know this is something to do with Kwin-lowlatency as this never happens with the standard compositor from Arch repos. I've also tried 2 branches of kwin-lowlatency, the 5.18.5 branch (stable), and 5.18.90 with the kde-unstable repos in arch, both have this problem.

Stack track:

Process 1286 (kwin_x11) of user 1000 dumped core.

                                                Stack trace of thread 1286:
                                                #0  0x00007f9653609cef _ZN6KCrash19defaultCrashHandlerEi (libKF5Crash.so.5 + 0x3cef)
                                                #1  0x00007f9651d643e0 __restore_rt (libc.so.6 + 0x3c3e0)
                                                #2  0x00007f9651d64355 raise (libc.so.6 + 0x3c355)
                                                #3  0x00007f9651d4d853 abort (libc.so.6 + 0x25853)
                                                #4  0x00007f9651da7878 __libc_message (libc.so.6 + 0x7f878)
                                                #5  0x00007f9651daed3a malloc_printerr (libc.so.6 + 0x86d3a)
                                                #6  0x00007f9651dafbf8 malloc_consolidate (libc.so.6 + 0x87bf8)
                                                #7  0x00007f9651db1a35 _int_malloc (libc.so.6 + 0x89a35)
                                                #8  0x00007f9651db35a9 malloc (libc.so.6 + 0x8b5a9)
                                                #9  0x00007f9651d71bd7 realpath@@GLIBC_2.3 (libc.so.6 + 0x49bd7)
                                                #10 0x00007f96523367e7 n/a (libQt5Core.so.5 + 0x23e7e7)
                                                #11 0x00007f96522d4569 _ZNK9QFileInfo17canonicalFilePathEv (libQt5Core.so.5 + 0x1dc569)
                                                #12 0x00007f96523aec24 _ZN16QCoreApplication19applicationFilePathEv (libQt5Core.so.5 + 0x2b6c24)
                                                #13 0x000055f26eddfece n/a (kwin_x11 + 0x7ece)
                                                #14 0x00007f9653609db9 _ZN6KCrash19defaultCrashHandlerEi (libKF5Crash.so.5 + 0x3db9)
                                                #15 0x00007f9651d643e0 __restore_rt (libc.so.6 + 0x3c3e0)
                                                #16 0x00007f965082536b n/a (libKF5GlobalAccel.so.5 + 0x1536b)
                                                #17 0x00007f965081ba85 n/a (libKF5GlobalAccel.so.5 + 0xba85)
                                                #18 0x00007f96523e1906 n/a (libQt5Core.so.5 + 0x2e9906)
                                                #19 0x00007f96523dab50 _ZN7QObject9destroyedEPS_ (libQt5Core.so.5 + 0x2e2b50)
                                                #20 0x00007f96523dfc27 _ZN7QObjectD2Ev (libQt5Core.so.5 + 0x2e7c27)
                                                #21 0x00007f9652e7218a _ZN7QActionD0Ev (libQt5Widgets.so.5 + 0x15618a)
                                                #22 0x00007f96523d4c3e _ZN14QObjectPrivate14deleteChildrenEv (libQt5Core.so.5 + 0x2dcc3e)
                                                #23 0x00007f96523dfaa5 _ZN7QObjectD2Ev (libQt5Core.so.5 + 0x2e7aa5)
                                                #24 0x00007f965370c4c0 n/a (libkwin.so.5 + 0xe34c0)
                                                #25 0x00007f96523d4c3e _ZN14QObjectPrivate14deleteChildrenEv (libQt5Core.so.5 + 0x2dcc3e)
                                                #26 0x00007f96523dfaa5 _ZN7QObjectD2Ev (libQt5Core.so.5 + 0x2e7aa5)
                                                #27 0x00007f964b0da45a _ZN4KWin21X11StandalonePlatformD0Ev (KWinX11Platform.so + 0x2645a)
                                                #28 0x00007f96523a0062 n/a (libQt5Core.so.5 + 0x2a8062)
                                                #29 0x00007f96523a42ed n/a (libQt5Core.so.5 + 0x2ac2ed)
                                                #30 0x00007f96523a17b9 n/a (libQt5Core.so.5 + 0x2a97b9)
                                                #31 0x00007f9651d6724e __cxa_finalize (libc.so.6 + 0x3f24e)
                                                #32 0x00007f96521a9308 n/a (libQt5Core.so.5 + 0xb1308)
                                                #33 0x00007f96539e048b _dl_fini (ld-linux-x86-64.so.2 + 0x1148b)
                                                #34 0x00007f9651d66c57 __run_exit_handlers (libc.so.6 + 0x3ec57)
                                                #35 0x00007f9651d66dfe exit (libc.so.6 + 0x3edfe)
                                                #36 0x00007f964c70d277 n/a (libQt5XcbQpa.so.5 + 0x34277)
                                                #37 0x00007f964c73806e n/a (libQt5XcbQpa.so.5 + 0x5f06e)
                                                #38 0x00007f96523a901c _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2b101c)
                                                #39 0x00007f96523b14a4 _ZN16QCoreApplication4execEv (libQt5Core.so.5 + 0x2b94a4)
                                                #40 0x000055f26eddf57b n/a (kwin_x11 + 0x757b)
                                                #41 0x00007f9651d4f002 __libc_start_main (libc.so.6 + 0x27002)
                                                #42 0x000055f26eddfabe _start (kwin_x11 + 0x7abe)

                                                Stack trace of thread 1322:
                                                #0  0x00007f9651e1d15e ppoll (libc.so.6 + 0xf515e)
                                                #1  0x00007f96523ff17b _Z12qt_safe_pollP6pollfdmPK8timespec (libQt5Core.so.5 + 0x30717b)
                                                #2  0x00007f96524008bd _ZN20QEventDispatcherUNIX13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x3088bd)
                                                #3  0x00007f96523a901c _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2b101c)
                                                #4  0x00007f96521c4c32 _ZN7QThread4execEv (libQt5Core.so.5 + 0xccc32)
                                                #5  0x00007f9650c8d789 n/a (libQt5Qml.so.5 + 0x30b789)
                                                #6  0x00007f96521c5e0f n/a (libQt5Core.so.5 + 0xcde0f)
                                                #7  0x00007f9651665422 start_thread (libpthread.so.0 + 0x9422)
                                                #8  0x00007f9651e27bf3 __clone (libc.so.6 + 0xffbf3)
tildearrow commented 4 years ago

Ugh I am so sorry but I don't have my NVIDIA graphics card anymore...

Let's see what I can do here.

rnd-ash commented 4 years ago

Sorry to add some more bad news. (Again with both branches):

If the laptop sleeps, then resumes, the same crash will occur with Kwin. The only work around is to reboot the system. It will kick you back to the lock screen, then until you reboot, every login will result in this crash

tildearrow commented 4 years ago

Hmm... can you compile this with debug symbols enabled so that I could take a closer look at the backtrace?

To do so, open /etc/makepkg.conf, find the OPTIONS and:

Then rebuild the package.

tildearrow commented 4 years ago

I am just going to disassemble and trace the function in the assembly in the meanwhile...

libkwin.so.5 + 0xe34c0

...by the way, is that stacktrace generated with 5.18.5 or 5.18.90?

tildearrow commented 4 years ago
00000000001e34b2 <_ZNSt11_Tuple_implILm1EJSt14default_deleteIN12KDecoration222DecoratedC
lientPrivateEEEEC1IS0_IN4KWin10Decoration19DecoratedClientImplEEEEOT_>:                 
        constexpr _Tuple_impl(_UHead&& __head)                                          
  1e34b2:       55                      push   rbp                                      
  1e34b3:       48 89 e5                mov    rbp,rsp                                  
  1e34b6:       48 83 ec 10             sub    rsp,0x10                                 
  1e34ba:       48 89 7d f8             mov    QWORD PTR [rbp-0x8],rdi                  
  1e34be:       48 89 75 f0             mov    QWORD PTR [rbp-0x10],rsi                 
        : _Base(std::forward<_UHead>(__head)) { }                                       
  1e34c2:       48 8b 45 f0             mov    rax,QWORD PTR [rbp-0x10]                 
  1e34c6:       48 89 c7                mov    rdi,rax                                  
  1e34c9:       e8 1d f4 ff ff          call   1e28eb <_ZSt7forwardISt14default_deleteIN
4KWin10Decoration19DecoratedClientImplEEEOT_RNSt16remove_referenceIS5_E4typeE>          
  1e34ce:       48 89 c2                mov    rdx,rax                                  
  1e34d1:       48 8b 45 f8             mov    rax,QWORD PTR [rbp-0x8]                  
  1e34d5:       48 89 d6                mov    rsi,rdx                                  
  1e34d8:       48 89 c7                mov    rdi,rax
rnd-ash commented 4 years ago

So i tried to re-compile Kwin under the current 5.19 branch, and have tried about 100 times to replicate the issue for you and get nothing.

But, if i roll back kwin to the 5.19 branch as it was on the 19th (When i compiled the buggy build), the bug comes back.

I can try tomorrow to downgrade to 5.18 and see if the issue persists, but something on the 5.19 branch thats been committed last week appears to have fixed it :)

tildearrow commented 4 years ago

Hmmm... I got to see it, so that I can backport the accidental fix to 5.18...