Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NVIDIA] Clicking an already-open applet in the panel crashes the panel #12

Closed
jacobgkau opened this issue Aug 29, 2022 · 7 comments
Closed

Comments

@jacobgkau
Copy link
Member

Version: 5749874.

Steps to recreate:

  1. Log in on an NVIDIA system (I'm seeing the issue on oryp8 with an RTX 3080, only when booted in NVIDIA mode; I am not seeing the issue on lemp10).
  2. Click an applet in the top panel (e.g. the clock).
  3. After it's open, click it again.

Actual behavior: All panels (top and bottom) disappear from the screen after a brief pause. The following is logged:

Aug 29 16:03:32 pop-os kernel: show_signal_msg: 42 callbacks suppressed
Aug 29 16:03:32 pop-os kernel: cosmic-panel[4057]: segfault at 55c7b13f6826 ip 00007f93c6297f74 sp 00007ffddaa028f8 error 4 in libc.so.6[7f93c6228000+195000]
Aug 29 16:03:32 pop-os kernel: Code: 14 00 e8 ff 1e fa ff 48 8d 0d e8 98 14 00 ba 53 02 00 00 48 8d 35 2a 16 14 00 48 8d 3d 4e 16 14 00 e8 e0 1e fa ff f3 0f 1e fa <8b> 47 10 89 c2 81 e2 7f 01 00 00 90 83 e0 7c 0f 85 a7 00 00 00 53
Aug 29 16:03:33 pop-os cosmic-session[3996]: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os cosmic-session[3996]: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os /usr/libexec/gdm-wayland-session[3996]: 2022-08-29T22:03:33.166752Z ERROR cosmic-panel: cosmic_session::generic: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os /usr/libexec/gdm-wayland-session[3996]: 2022-08-29T22:03:33.166777Z ERROR cosmic-panel: cosmic_session::generic: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os /usr/libexec/gdm-wayland-session[3996]: 2022-08-29T22:03:33.166783Z ERROR cosmic-panel: cosmic_session::generic: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os /usr/libexec/gdm-wayland-session[3996]: 2022-08-29T22:03:33.166789Z ERROR cosmic-panel: cosmic_session::generic: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os /usr/libexec/gdm-wayland-session[3996]: 2022-08-29T22:03:33.166811Z ERROR cosmic-panel: cosmic_session::generic: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os /usr/libexec/gdm-wayland-session[3996]: 2022-08-29T22:03:33.166818Z ERROR cosmic-panel: cosmic_session::generic: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os /usr/libexec/gdm-wayland-session[3996]: 2022-08-29T22:03:33.166824Z ERROR cosmic-panel: cosmic_session::generic: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os /usr/libexec/gdm-wayland-session[3996]: 2022-08-29T22:03:33.166841Z ERROR cosmic-panel: cosmic_session::generic: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os /usr/libexec/gdm-wayland-session[3996]: 2022-08-29T22:03:33.166847Z ERROR cosmic-panel: cosmic_session::generic: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os cosmic-session[3996]: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os cosmic-session[3996]: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os cosmic-session[3996]: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os cosmic-session[3996]: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os cosmic-session[3996]: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os cosmic-session[3996]: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os cosmic-session[3996]: Gdk-Message: 16:03:33.166: Error reading events from display: Broken pipe
Aug 29 16:03:33 pop-os cosmic-session[3996]: 'cosmic-panel' exited with status signal: 11 (SIGSEGV) (core dumped)
Aug 29 16:03:33 pop-os /usr/libexec/gdm-wayland-session[3996]: 2022-08-29T22:03:33.183719Z  INFO cosmic-panel: cosmic_session::process: 'cosmic-panel' exited with status signal: 11 (SIGSEGV) (core dumped)
Aug 29 16:03:33 pop-os /usr/libexec/gdm-wayland-session[3996]: 2022-08-29T22:03:33.183765Z ERROR cosmic-panel: cosmic_session::generic: exited with status signal: 11 (SIGSEGV) (core dumped)
Aug 29 16:03:33 pop-os cosmic-session[3996]: exited with status signal: 11 (SIGSEGV) (core dumped)

Expected behavior: Clicking an applet that's already open should close the applet.

Other notes: I wasn't sure if this should be opened in cosmic-panel, cosmic-session (since the logs refer to that more), or cosmic-comp (since it's specific to NVIDIA). Feel free to transfer.

@ids1024
Copy link
Member

ids1024 commented Aug 30, 2022

Hm, interesting, on Nvidia I don't see most of the applets rendering to begin with (I think everything should be up to date on this computer...), but clicking on something like the clock does bring up a popup. And I'm able to get a similar SIGSEGV.

We'll want to work on the best way to handle debugging and logging, especially when we'll be dealing with issues on end user systems, but for further detail on this sort of issue, it's possible to run cosmic-panel manually, in gdb, and get a backtrace for the segfault.

I see it segfault somewhere in the C code invoked by WlEglSurface::drop, apparently being invoked as a result of self.popups.retain_mut().

@wash2
Copy link
Collaborator

wash2 commented Aug 31, 2022

Ya, I've been trying to work on a fix for this, but I haven't got it figured out. It's the main blocker for merging the 0.30 refactor for applet host that i've been working on :(

@n3m0-22
Copy link

n3m0-22 commented Aug 31, 2022

I'm seeing this issue too. If I run cosmic-panel after it crashes and then click on something to crash it again it get this output.

cosmic-panel.txt

@ids1024
Copy link
Member

ids1024 commented Aug 31, 2022

Okay, I think I see what's causing the segfault.

I seem to be able to fix it by calling self.egl_surface.take() in WrapperPopup::drop, ensuring the EGLSurface is freed before the WlSurface is. This isn't quite the correct solution though, since self.egl_surface contains an Rc.

EGLSurface contains a Box<dyn EGLNativeSurface + Send + 'static>. The native surface here in ClientEglSurface defined in xdg-shell-wrapper, Which contains the WlEglSurface as a member. struct wl_egl_window contains a struct wl_surface *surface member.

So it's no surprise if wl_egl_window_destroy ends up segfaulting if the wl_surface has already been destroyed and the pointer is invalid.

I'm not sure if this should be regarded as an issue in the wayland-egl crate, or in xdg-shell-wrapper, but one way or another ClientEglSurface should probably hold a reference to the WlSurface and ensure it isn't freed until after the EglSurface is destroyed.

In addition to the segfault, is everyone else seeing the issue where only the first applet in the panel is rendered, or is that somehow more specific to my system? I guess it's creating more than one EglSurface from one WlSurface, and for some reason only the first is rendering properly on Nvidia?

@wash2
Copy link
Collaborator

wash2 commented Aug 31, 2022

Ok thanks, I'll look into fixing that as you've suggested :)

In addition to the segfault, is everyone else seeing the issue where only the first applet in the panel is rendered, or is that somehow more specific to my system? I guess it's creating more than one EglSurface from one WlSurface, and for some reason only the first is rendering properly on Nvidia?

Personally, I don't have that issue, and every applet seems to be rendered, but there are issues with swapping buffers that seems specific to nvidia. If I swap with None, it renders correctly for applets and popups, otherwise it only renders correctly a few times, then appears to stop rendering.

@ids1024
Copy link
Member

ids1024 commented Sep 1, 2022

Opened #13 about that issue.

@wash2
Copy link
Collaborator

wash2 commented Sep 22, 2022

I think this should be fixed now and can be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants