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

node->parent == NULL when moving to screen with no application windows. #1384

Closed
jrwrigh opened this issue Nov 9, 2024 · 3 comments
Closed

Comments

@jrwrigh
Copy link

jrwrigh commented Nov 9, 2024

Crashes when changing from an empty screen (no windows) to a screen with windows. Results in the following error message:

picom: ../src/wm/tree.c:228: wm_tree_find_toplevel_for: Assertion `!__bug_on_tmp && "Original expr: " "(node->parent) == NULL"' failed.

Platform

Manjaro Linux, Kernel 6.6.60
Window Manager: qtile

GPU, drivers, and screen setup

  • GPU: Intel i5-1135G7 (Intel® Iris® Xe Graphics) (Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics])
  • Drivers: lscpi reports Kernel driver in use: i915
  • Configuration: 2 monitors, side-by-side with xrandr.
❯ xrandr
Screen 0: minimum 320 x 200, current 3840 x 1280, maximum 16384 x 16384
eDP-1 connected 1920x1280+1920+0 (normal left inverted right x axis y axis) 285mm x 190mm
...  
DP-4-1 connected primary 1920x1080+0+100 (normal left inverted right x axis y axis) 521mm x 293mm
  • glxinfo -B
❯ glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel (0x8086)
    Device: Mesa Intel(R) Xe Graphics (TGL GT2) (0x9a49)
    Version: 24.2.6
    Accelerated: yes
    Video memory: 15941MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) Xe Graphics (TGL GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 24.2.6-arch1.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 24.2.6-arch1.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 24.2.6-arch1.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Environment

qtile window manager

picom version

v12 (git@github.com:yshui/picom.git revision 4529db7)

Diagnostics
### Extensions:

* Shape: Yes
* RandR: Yes
* Present: Present

### Misc:

* Use Overlay: No

* Config file specified: None
* Config file used: /home/jrwrigh/.config/picom.conf

### Drivers (inaccurate):

modesetting
[ 11/09/2024 09:48:45.114 egl_init WARN ] The egl backend is still experimental, use with care.

### Backend: egl

* Driver vendors:
 * EGL: Mesa Project
 * EGL driver: iris
 * GL: Intel
* GL renderer: Mesa Intel(R) Xe Graphics (TGL GT2)

### Backend: glx

* Driver vendors:
 * GLX: Mesa Project and SGI
 * GL: Intel
* GL renderer: Mesa Intel(R) Xe Graphics (TGL GT2)
* Accelerated: 1

Configuration:

I see that my configuration has a few deprecated options. I'll leave them for now, but let me know if I should fix them for this debugging.

Configuration file
shadow = false;
shadow-radius = 5;
shadow-opacity = .5
shadow-offset-x = -5;
shadow-offset-y = -5;
shadow-ignore-shaped = false;
shadow-exclude = [
    "! name~=''",
    "name = 'Notification'",
    "name = 'Plank'",
    "name = 'Docky'",
    "name = 'Kupfer'",
    "name = 'xfce4-notifyd'",
    "name = 'cpt_frame_window'",
    "name *= 'VLC'",
    "name *= 'compton'",
    "name *= 'picom'",
    "name *= 'Chromium'",
    "name *= 'Chrome'",
    "name *= 'Firefox'",
    "class_g = 'Conky'",
    "class_g = 'Zoom'",
    "class_g = 'Kupfer'",
    "class_g = 'Synapse'",
    "class_g ?= 'Notify-osd'",
    "class_g ?= 'Cairo-dock'",
    "class_g ?= 'Xfce4-notifyd'",
    "class_g ?= 'Xfce4-power-manager'",
    "_GTK_FRAME_EXTENTS@:c"
];
fading = false
fade-in-step = 0.03;
fade-out-step = 0.03;
inactive-opacity = 0.8;
frame-opacity = 1.0;
inactive-opacity-override = false;
focus-exclude = [ "class_g = 'Cairo-clock'" ];
opacity-rule = [
  # "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
  "99:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_FULLSCREEN'", # don't use opacity for full screen apps
  "99:_NET_WM_STATE@[1]:32a = '_NET_WM_STATE_FULLSCREEN'",
  "99:_NET_WM_STATE@[2]:32a = '_NET_WM_STATE_FULLSCREEN'",
  "99:_NET_WM_STATE@[3]:32a = '_NET_WM_STATE_FULLSCREEN'",
  "99:_NET_WM_STATE@[4]:32a = '_NET_WM_STATE_FULLSCREEN'",
];
blur-kern = "3x3box";
blur-background-exclude = [
  "window_type = 'dock'",
  "window_type = 'desktop'",
  "_GTK_FRAME_EXTENTS@:c"
];
backend = "glx";
vsync = true
mark-wmwin-focused = true;
mark-ovredir-focused = false;
detect-rounded-corners = false;
detect-client-opacity = false;
refresh-rate = 0
use-ewmh-active-win = true
unredir-if-possible = true
detect-transient = true
detect-client-leader = false
glx-no-stencil = true
use-damage = true
log-level = "warn";
wintypes:
{
  tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
  dock = { shadow = false; }
  dnd = { shadow = false; }
  popup_menu = { opacity = 1.0; }
  dropdown_menu = { opacity = 1.0; }
};

Steps of reproduction

  1. Have one monitor empty and the other have something
  2. Switch to the other monitor (using qtile's next_screen() function and a custom function that moves the cursor to the new monitor)

Expected behavior

Picom to not crash

Current Behavior

picom crashes

Stack trace

(gdb) bt
#0  0x00007f4ae42e73f4 in ?? () from /usr/lib/libc.so.6
#1  0x00007f4ae428e120 in raise () from /usr/lib/libc.so.6
#2  0x00007f4ae42754c3 in abort () from /usr/lib/libc.so.6
#3  0x00007f4ae42753df in ?? () from /usr/lib/libc.so.6
#4  0x00007f4ae4286177 in __assert_fail () from /usr/lib/libc.so.6
#5  0x000055f9440a91f8 in wm_tree_find_toplevel_for (tree=0x55f95f1ec7a8, node=0x55f95f1ec880) at ../src/wm/tree.c:228
#6  0x000055f9440a592b in wm_find_by_client (wm=0x55f95f1ec7a0, client=1282) at ../src/wm/wm.c:193
#7  0x000055f94406043f in update_ewmh_active_win (req_base=0x55f95f2d51d0, reply_or_error=0x55f95f1f4ef0)
    at ../src/event.c:231
#8  0x000055f944079ad3 in x_complete_async_requests (c=0x55f95f1e8740, e=0x55f95f3f67f0) at ../src/x.c:1024
#9  0x000055f944079b61 in x_feed_event (c=0x55f95f1e8740, e=0x55f95f3f67f0) at ../src/x.c:1032
#10 0x000055f944079e0d in x_poll_for_event (c=0x55f95f1e8740, queued=false) at ../src/x.c:1088
#11 0x000055f94406f0ae in x_event_callback (loop=0x7f4ae48f3060, w=0x55f95f1e8600, revents=1) at ../src/picom.c:1800
#12 0x00007f4ae48e813b in ev_invoke_pending () from /usr/lib/libev.so.4
#13 0x00007f4ae48ebd22 in ev_run () from /usr/lib/libev.so.4
#14 0x000055f944073963 in session_run (ps=0x55f95f1e8600) at ../src/picom.c:2589
#15 0x000055f944073ce2 in main (argc=1, argv=0x7fff6a9a7008) at ../src/picom.c:2704

Log file with --log-level trace: picom_log_file_debug.log

Other details

picom_crash_demo2
It's kinda hard to see in the video, but notice that when the cursor appears in the middle of the right monitor, picom crashes.

@yshui
Copy link
Owner

yshui commented Nov 11, 2024

oooo, qtile sets _NET_ACTIVE_WINDOW to root. i kinda feel that's not allowed by EWMH, but OTOH EWMH is pretty vague on this.

it's not too difficult to add a check.

yshui added a commit that referenced this issue Nov 11, 2024
Some window managers (e.g. qtile) may set _NET_ACTIVE_WINDOW to the root
window, and in that case `update_ewmh_active_win` will call
`wm_find_by_client` with the root, which crashes.

Fixes #1384

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
yshui added a commit that referenced this issue Nov 11, 2024
Some window managers (e.g. qtile) may set _NET_ACTIVE_WINDOW to the root
window, and in that case `update_ewmh_active_win` will call
`wm_find_by_client` with the root, which crashes.

Fixes #1384

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
yshui added a commit that referenced this issue Nov 12, 2024
Some window managers (e.g. qtile) may set _NET_ACTIVE_WINDOW to the root
window, and in that case `update_ewmh_active_win` will call
`wm_find_by_client` with the root, which crashes.

Fixes #1384

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
yshui added a commit that referenced this issue Nov 12, 2024
Some window managers (e.g. qtile) may set _NET_ACTIVE_WINDOW to the root
window, and in that case `update_ewmh_active_win` will call
`wm_find_by_client` with the root, which crashes.

Fixes #1384

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
yshui added a commit that referenced this issue Nov 12, 2024
(cherry picked from commit b2bf3cc)

Some window managers (e.g. qtile) may set _NET_ACTIVE_WINDOW to the root
window, and in that case `update_ewmh_active_win` will call
`wm_find_by_client` with the root, which crashes.

Fixes #1384

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
@yshui yshui closed this as completed in b2bf3cc Nov 12, 2024
@jrwrigh
Copy link
Author

jrwrigh commented Nov 12, 2024

Thanks for the quick fix! Happy that it wasn't too hard to diagnose and resolve. I'll try it out in a bit to verify on my side.

@jrwrigh
Copy link
Author

jrwrigh commented Nov 13, 2024

Confirmed that the fix works on my side. Thanks again!

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

2 participants