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

Crash when entering fullscreen in mpv if opacity value set for _NET_WM_STATE_HIDDEN or _NET_WM_STATE_FULLSCREEN #1350

Closed
yusufaktepe opened this issue Oct 9, 2024 · 9 comments

Comments

@yusufaktepe
Copy link

Platform

Arch Linux amd64

GPU, drivers, and screen setup

AMD, single montitor

  • mesa 24.2.4-1
  • xf86-video-amdgpu 23.0.0
$ glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: AMD (0x1002)
    Device: AMD Radeon Graphics (radeonsi, renoir, LLVM 18.1.8, DRM 3.59, 6.11.2-arch1-1) (0x1636)
    Version: 24.2.4
    Accelerated: yes
    Video memory: 512MB
    Unified memory: no
    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
Memory info (GL_ATI_meminfo):
    VBO free memory - total: 168 MB, largest block: 168 MB
    VBO free aux. memory - total: 6950 MB, largest block: 6950 MB
    Texture free memory - total: 168 MB, largest block: 168 MB
    Texture free aux. memory - total: 6950 MB, largest block: 6950 MB
    Renderbuffer free memory - total: 168 MB, largest block: 168 MB
    Renderbuffer free aux. memory - total: 6950 MB, largest block: 6950 MB
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 512 MB
    Total available memory: 8189 MB
    Currently available dedicated video memory: 168 MB
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon Graphics (radeonsi, renoir, LLVM 18.1.8, DRM 3.59, 6.11.2-arch1-1)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 24.2.4-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.4-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.4-arch1.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Environment

i3wm

picom version

v12.1

Diagnostics

[ 2024-10-09 22:22:35.919 egl_init WARN ] The egl backend is still experimental, use with care.
Version: v12.1 (/startdir/picom revision c321da4)

Extensions:

  • Shape: Yes
  • RandR: Yes
  • Present: Present

Misc:

  • Use Overlay: No
    (Another compositor is already running)
  • Config file specified: None
  • Config file used: /home/yusuf/.config/picom.conf

Drivers (inaccurate):

AMDGPU, Radeon

Backend: glx

  • Driver vendors:
  • GLX: Mesa Project and SGI
  • GL: AMD
  • GL renderer: AMD Radeon Graphics (radeonsi, renoir, LLVM 18.1.8, DRM 3.59, 6.11.2-arch1-1)
  • Accelerated: 1

Backend: egl

  • Driver vendors:
  • EGL: Mesa Project
  • EGL driver: radeonsi
  • GL: AMD
  • GL renderer: AMD Radeon Graphics (radeonsi, renoir, LLVM 18.1.8, DRM 3.59, 6.11.2-arch1-1)

Configuration:

Configuration file
#################################
#             Shadows           #
#################################

# Enabled client-side shadows on windows. Note desktop windows
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
# unless explicitly requested using the wintypes option.
#
# Can be set per-window using rules.
#
# Default: false
shadow = true;

# The blur radius for shadows, in pixels.
#
# Default: 12
shadow-radius = 5;

# The opacity of shadows.
#
# Range: 0.0 - 1.0
# Default: 0.75
shadow-opacity = .5

# The left offset for shadows, in pixels.
#
# Default: -15
shadow-offset-x = -5;

# The top offset for shadows, in pixels.
#
# Default: -15
shadow-offset-y = -5;

# Hex string color value of shadow. Formatted like "#RRGGBB", e.g. "#C0FFEE".
#
# Default: #000000
# shadow-color = "#000000"

# Crop shadow of a window fully on a particular monitor to that monitor. This is
# currently implemented using the X RandR extension.
#
# Default: false
# crop-shadow-to-monitor = false


#################################
#           Fading              #
#################################

# Fade windows in/out when opening/closing and when opacity changes,
# unless no-fading-openclose is used. Can be set per-window using rules.
#
# Default: false
fading = false;

# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
fade-in-step = 0.03;

# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
fade-out-step = 0.03;

# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
# fade-delta = 4

# Do not fade on window open/close.
# no-fading-openclose = false

# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
# no-fading-destroyed-argb = false


#################################
#   Transparency / Opacity      #
#################################

# Opacity of window titlebars and borders.
#
# Range: 0.1 - 1.0
# Default: 1.0 (disabled)
frame-opacity = 1;

# Use fixed inactive dim value, instead of adjusting according to window opacity.
#
# Default: false
# inactive-dim-fixed = true

#################################
#           Corners             #
#################################

# Sets the radius of rounded window corners. When > 0, the compositor will
# round the corners of windows. Does not interact well with
# `transparent-clipping`.
#
# Default: 0 (disabled)
corner-radius = 0

#################################
#            Blur               #
#################################

# Parameters for background blurring, see BLUR section in the man page for more information.
# blur-method =
# blur-size = 12
#
# blur-deviation = false
#
# blur-strength = 5

# Blur background of semi-transparent / ARGB windows.
# Can be set per-window using rules.
#
# Default: false
# blur-background = false

# Blur background of windows when the window frame is not opaque.
# Implies:
#    blur-background
#
# Default: false
# blur-background-frame = false

# Use fixed blur strength rather than adjusting according to window opacity.
#
# Default: false
# blur-background-fixed = false


# Specify the blur convolution kernel, with the following format:
# example:
#   blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
# Can also be a pre-defined kernel, see the man page.
#
# Default: ""
# blur-kern = "3x3box";

#################################
#       General Settings        #
#################################

# Enable remote control via D-Bus. See the man page for more details.
#
# Default: false
# dbus = true

# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
# daemon = false

# Specify the backend to use: `xrender`, `glx`, or `egl`.
#
# Default: "xrender"
backend = "glx"

# GLX backend: Avoid using stencil buffer, useful if you don’t have a stencil buffer.
# Might cause incorrect opacity when rendering transparent content and may not work with --blur-background.
# My tests show a 15% performance boost. Recommended.
glx-no-stencil = true;

# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
glx-no-rebind-pixmap = true;

use-damage = false;

# Use higher precision during rendering, and apply dither when presenting the
# rendered screen. Reduces banding artifacts, but may cause performance
# degradation. Only works with OpenGL.
dithered-present = false;

# Enable/disable VSync.
#
# Default: false
vsync = true;

# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
# Reported to have no effect, though.
dbe = false;

# Try to detect windows with rounded corners and don't consider them
# shaped windows. The accuracy is not very high, unfortunately.
#
# Has nothing to do with `corner-radius`.
#
# Default: false
detect-rounded-corners = true;

# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers
# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows.
#
# Default: false
detect-client-opacity = true;

# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
# rather than listening to 'FocusIn'/'FocusOut' event. May be more accurate,
# provided that the WM supports it.
#
# Default: false
# use-ewmh-active-win = false

# Unredirect all windows if a full-screen opaque window is detected,
# to maximize performance for full-screen windows. Known to cause flickering
# when redirecting/unredirecting windows.
#
# Default: false
# unredir-if-possible = false

# Delay before unredirecting the window, in milliseconds.
#
# Default: 0.
# unredir-if-possible-delay = 0

# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
# in the same group focused at the same time.
#
# Default: false
detect-transient = true;

# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
# group focused at the same time. This usually means windows from the same application
# will be considered focused or unfocused at the same time.
# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too.
#
# Default: false
detect-client-leader = true

# Use of damage information for rendering. This cause the only the part of the
# screen that has actually changed to be redrawn, instead of the whole screen
# every time. Should improve performance.
#
# Default: false
use-damage = true;

# Use X Sync fence to wait for the completion of rendering of other windows,
# before using their content to render the current screen.
#
# Required for explicit sync drivers, such as nvidia.
#
# Default: false
# xrender-sync-fence = false

# GLX backend: Use specified GLSL fragment shader for rendering window
# contents. Read the man page for a detailed explanation of the interface.
#
# Can be set per-window using rules.
#
# window-shader-fg = "default"

# Force all windows to be painted with blending. Useful if you
# have a `window-shader-fg` that could turn opaque pixels transparent.
#
# Default: false
# force-win-blend = false

# Do not use EWMH to detect fullscreen windows.
# Reverts to checking if a window is fullscreen based only on its size and coordinates.
#
# Default: false
# no-ewmh-fullscreen = false

# Dimming bright windows so their brightness doesn't exceed this set value.
# Brightness of a window is estimated by averaging all pixels in the window,
# so this could comes with a performance hit.
# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled.
#
# Default: 1.0 (disabled)
# max-brightness = 1.0

# Make transparent windows clip other windows like non-transparent windows do,
# instead of blending on top of them. e.g. placing a transparent window on top
# of another window will cut a "hole" in that window, and show the desktop background
# underneath.
#
# Default: false
# transparent-clipping = false

# Set the log level. Possible values are:
#  "trace", "debug", "info", "warn", "error"
# in increasing level of importance. Case insensitive.
# If using the "TRACE" log level, it's better to log into a file
# using *--log-file*, since it can generate a huge stream of logs.
#
# Default: "warn"
# log-level = "warn";

# Set the log file.
# If *--log-file* is never specified, logs will be written to stderr.
# Otherwise, logs will to written to the given file, though some of the early
# logs might still be written to the stderr.
# When setting this option from the config file, it is recommended to use an absolute path.
#
# log-file = "/path/to/your/log/file"

# Write process ID to a file.
# write-pid-path = "/path/to/your/log/file"

# Rule-based per-window options.
#
# See WINDOW RULES section in the man page for how these work.
rules: ({
  match = "window_type = 'tooltip'";
  fade = true;
  shadow = false;
  opacity = 0.85;
  full-shadow = false;
  focus = true;
}, {
  match = "window_type = 'dock'    || "
          "window_type = 'desktop' || "
          "class_g = 'i3-frame'    || "
          "_GTK_FRAME_EXTENTS@";
  blur-background = false;
}, {
  match = "window_type != 'dock'";
  # shader = "my_shader.frag";
}, {
  match = "window_type = 'dock' || "
          "window_type = 'desktop'";
  corner-radius = 0;
}, {
  match = "! name~=''                    || "
          "name = 'Notification'         || "
          "name *= 'VLC'                 || "
          "name *= 'Chromium'            || "
          "name *= 'Chrome'              || "
          "class_g = 'Firefox'           || "
          "class_g = 'Conky'             || "
          "class_g ?= 'Notify-osd'       || "
          "class_g ?= 'Dmenu'            || "
          "class_g = 'i3-frame'          || "
          "class_g = 'Cairo-clock'       || "
          "_NET_WM_STATE@ *= '_NET_WM_STATE_HIDDEN' || "
          "_NET_WM_STATE@ *= '_NET_WM_STATE_STICKY' || "
          "!I3_FLOATING_WINDOW@ || "
          "_GTK_FRAME_EXTENTS@";
  shadow = false;
}, {
  match = "class_g = 'Crow Translate' || "
          "class_g = 'Spotify' || "
          "class_g = 'KeePassXC' || "
          "class_g = 'Pavucontrol' || "
          "class_g = 'TelegramDesktop' || "
          "class_i = 'web.whatsapp.com__send'";
   opacity = 0.9;
}, {
  match =
          "_NET_WM_STATE@[*] = '_NET_WM_STATE_FULLSCREEN'";
  opacity = 1;
}, {
  match =
          "_NET_WM_STATE@[*] = '_NET_WM_STATE_HIDDEN'";
  opacity = 0;
})

# `@include` directive can be used to include additional configuration files.
# Relative paths are search either in the parent of this configuration file
# (when the configuration is loaded through a symlink, the symlink will be
# resolved first). Or in `$XDG_CONFIG_HOME/picom/include`.
#
# @include "extra.conf"

Steps of reproduction

  1. Set a opacity rule for _NET_WM_STATE_HIDDEN or _NET_WM_STATE_FULLSCREEN.
  2. Open the mpv video player and toggle fullscreen.

Expected behavior

Picom should not crash when entering fullscreen in mpv.

Current Behavior

Prior to v12, I successfully used the following rules. With v12.1, these crashes picom with a fullscreen MPV window.

rules: ({
  match = "_NET_WM_STATE@[*] = '_NET_WM_STATE_FULLSCREEN'";
  opacity = 1;
}, {
  match = "_NET_WM_STATE@[*] = '_NET_WM_STATE_HIDDEN'";
  opacity = 0;
})

Stack trace

           PID: 91067 (picom)
           UID: 1000 (yusuf)
           GID: 1000 (yusuf)
        Signal: 11 (SEGV)
     Timestamp: Wed 2024-10-09 22:49:13 +03 (3s ago)
  Command Line: picom -b
    Executable: /usr/bin/picom
 Control Group: /user.slice/user-1000.slice/session-1.scope
          Unit: session-1.scope
         Slice: user-1000.slice
       Session: 1
     Owner UID: 1000 (yusuf)
       Boot ID: edc6e8641ed5491b84b1e56e166e4803
    Machine ID: 846513d7ac084ba6a31da0736e5511db
      Hostname: ysf-thinkpad
       Storage: /var/lib/systemd/coredump/core.picom.1000.edc6e8641ed5491b84b1e56e166e4803.91067.1728503353000000.zst (present)
  Size on Disk: 2.8M
       Message: Process 91067 (picom) of user 1000 dumped core.

                Stack trace of thread 91067:
                #0  0x00005f441cd773e4 n/a (picom + 0x153e4)
                #1  0x00005f441cdb65b5 n/a (picom + 0x545b5)
                #2  0x00005f441cd8afa5 n/a (picom + 0x28fa5)
                #3  0x00005f441cde0d03 n/a (picom + 0x7ed03)
                #4  0x00005f441cd89250 n/a (picom + 0x27250)
                #5  0x000074422e23c13b ev_invoke_pending (libev.so.4 + 0x513b)
                #6  0x000074422e23fd22 ev_run (libev.so.4 + 0x8d22)
                #7  0x00005f441cd6ec07 n/a (picom + 0xcc07)
                #8  0x000074422db98e08 n/a (libc.so.6 + 0x25e08)
                #9  0x000074422db98ecc __libc_start_main (libc.so.6 + 0x25ecc)
                #10 0x00005f441cd70f95 _start (picom + 0xef95)

                Stack trace of thread 91068:
                #0  0x000074422dc03a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000074422dc06479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000074422aacecae n/a (libgallium-24.2.4-arch1.1.so + 0xcecae)
                #3  0x000074422aaab6bc n/a (libgallium-24.2.4-arch1.1.so + 0xab6bc)
                #4  0x000074422aacebdd n/a (libgallium-24.2.4-arch1.1.so + 0xcebdd)
                #5  0x000074422dc0739d n/a (libc.so.6 + 0x9439d)
                #6  0x000074422dc8c49c n/a (libc.so.6 + 0x11949c)

                Stack trace of thread 91069:
                #0  0x000074422dc03a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000074422dc06479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000074422aacecae n/a (libgallium-24.2.4-arch1.1.so + 0xcecae)
                #3  0x000074422aaab6bc n/a (libgallium-24.2.4-arch1.1.so + 0xab6bc)
                #4  0x000074422aacebdd n/a (libgallium-24.2.4-arch1.1.so + 0xcebdd)
                #5  0x000074422dc0739d n/a (libc.so.6 + 0x9439d)
                #6  0x000074422dc8c49c n/a (libc.so.6 + 0x11949c)

                Stack trace of thread 91070:
                #0  0x000074422dc03a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000074422dc06479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000074422aacecae n/a (libgallium-24.2.4-arch1.1.so + 0xcecae)
                #3  0x000074422aaab6bc n/a (libgallium-24.2.4-arch1.1.so + 0xab6bc)
                #4  0x000074422aacebdd n/a (libgallium-24.2.4-arch1.1.so + 0xcebdd)
                #5  0x000074422dc0739d n/a (libc.so.6 + 0x9439d)
                #6  0x000074422dc8c49c n/a (libc.so.6 + 0x11949c)

                Stack trace of thread 91076:
                #0  0x000074422dc03a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000074422dc06479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000074422aacecae n/a (libgallium-24.2.4-arch1.1.so + 0xcecae)
                #3  0x000074422aaab6bc n/a (libgallium-24.2.4-arch1.1.so + 0xab6bc)
                #4  0x000074422aacebdd n/a (libgallium-24.2.4-arch1.1.so + 0xcebdd)
                #5  0x000074422dc0739d n/a (libc.so.6 + 0x9439d)
                #6  0x000074422dc8c49c n/a (libc.so.6 + 0x11949c)

                Stack trace of thread 91071:
                #0  0x000074422dc03a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000074422dc06479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000074422aacecae n/a (libgallium-24.2.4-arch1.1.so + 0xcecae)
                #3  0x000074422aaab6bc n/a (libgallium-24.2.4-arch1.1.so + 0xab6bc)
                #4  0x000074422aacebdd n/a (libgallium-24.2.4-arch1.1.so + 0xcebdd)
                #5  0x000074422dc0739d n/a (libc.so.6 + 0x9439d)
                #6  0x000074422dc8c49c n/a (libc.so.6 + 0x11949c)

                Stack trace of thread 91072:
                #0  0x000074422dc03a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000074422dc06479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000074422aacecae n/a (libgallium-24.2.4-arch1.1.so + 0xcecae)
                #3  0x000074422aaab6bc n/a (libgallium-24.2.4-arch1.1.so + 0xab6bc)
                #4  0x000074422aacebdd n/a (libgallium-24.2.4-arch1.1.so + 0xcebdd)
                #5  0x000074422dc0739d n/a (libc.so.6 + 0x9439d)
                #6  0x000074422dc8c49c n/a (libc.so.6 + 0x11949c)

                Stack trace of thread 91078:
                #0  0x000074422dc03a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000074422dc06479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000074422aacecae n/a (libgallium-24.2.4-arch1.1.so + 0xcecae)
                #3  0x000074422aaab6bc n/a (libgallium-24.2.4-arch1.1.so + 0xab6bc)
                #4  0x000074422aacebdd n/a (libgallium-24.2.4-arch1.1.so + 0xcebdd)
                #5  0x000074422dc0739d n/a (libc.so.6 + 0x9439d)
                #6  0x000074422dc8c49c n/a (libc.so.6 + 0x11949c)

                Stack trace of thread 91077:
                #0  0x000074422dc03a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000074422dc06479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000074422aacecae n/a (libgallium-24.2.4-arch1.1.so + 0xcecae)
                #3  0x000074422aaab6bc n/a (libgallium-24.2.4-arch1.1.so + 0xab6bc)
                #4  0x000074422aacebdd n/a (libgallium-24.2.4-arch1.1.so + 0xcebdd)
                #5  0x000074422dc0739d n/a (libc.so.6 + 0x9439d)
                #6  0x000074422dc8c49c n/a (libc.so.6 + 0x11949c)

                Stack trace of thread 91073:
                #0  0x000074422dc03a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000074422dc06479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000074422aacecae n/a (libgallium-24.2.4-arch1.1.so + 0xcecae)
                #3  0x000074422aaab6bc n/a (libgallium-24.2.4-arch1.1.so + 0xab6bc)
                #4  0x000074422aacebdd n/a (libgallium-24.2.4-arch1.1.so + 0xcebdd)
                #5  0x000074422dc0739d n/a (libc.so.6 + 0x9439d)
                #6  0x000074422dc8c49c n/a (libc.so.6 + 0x11949c)

                Stack trace of thread 91075:
                #0  0x000074422dc03a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000074422dc06479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000074422aacecae n/a (libgallium-24.2.4-arch1.1.so + 0xcecae)
                #3  0x000074422aaab6bc n/a (libgallium-24.2.4-arch1.1.so + 0xab6bc)
                #4  0x000074422aacebdd n/a (libgallium-24.2.4-arch1.1.so + 0xcebdd)
                #5  0x000074422dc0739d n/a (libc.so.6 + 0x9439d)
                #6  0x000074422dc8c49c n/a (libc.so.6 + 0x11949c)

                Stack trace of thread 91079:
                #0  0x000074422dc03a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000074422dc06479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000074422aacecae n/a (libgallium-24.2.4-arch1.1.so + 0xcecae)
                #3  0x000074422aaab6bc n/a (libgallium-24.2.4-arch1.1.so + 0xab6bc)
                #4  0x000074422aacebdd n/a (libgallium-24.2.4-arch1.1.so + 0xcebdd)
                #5  0x000074422dc0739d n/a (libc.so.6 + 0x9439d)
                #6  0x000074422dc8c49c n/a (libc.so.6 + 0x11949c)

                Stack trace of thread 91074:
                #0  0x000074422dc03a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000074422dc06479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000074422aacecae n/a (libgallium-24.2.4-arch1.1.so + 0xcecae)
                #3  0x000074422aaab6bc n/a (libgallium-24.2.4-arch1.1.so + 0xab6bc)
                #4  0x000074422aacebdd n/a (libgallium-24.2.4-arch1.1.so + 0xcebdd)
                #5  0x000074422dc0739d n/a (libc.so.6 + 0x9439d)
                #6  0x000074422dc8c49c n/a (libc.so.6 + 0x11949c)
                ELF object binary architecture: AMD x86-64

GNU gdb (GDB) 15.2
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/picom...

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.archlinux.org>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
Reading symbols from /home/yusuf/.cache/debuginfod_client/0a7296e58ceec79553f61c544ac052a9a95a7f67/debuginfo...

warning: Can't open file /memfd:xshmfence (deleted) during file-backed mapping note processing
[New LWP 91067]
[New LWP 91068]
[New LWP 91069]
[New LWP 91070]
[New LWP 91076]
[New LWP 91071]
[New LWP 91072]
[New LWP 91078]
[New LWP 91077]
[New LWP 91073]
[New LWP 91075]
[New LWP 91079]
[New LWP 91074]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `picom -b'.
Program terminated with signal SIGSEGV, Segmentation fault.
--Type <RET> for more, q to quit, c to continue without paging--q
Quit
(gdb) bt
#0  0x00005f441cd773e4 in c2_window_state_update_one_from_reply (state=0x5f441fb2a5d0, value=0x5f44207a8e00, property=364, reply=<optimized out>, c=<optimized out>)
    at ../src/c2.c:2090
#1  c2_window_state_update_from_replies (state=0x5f441fb2a5d0, window_state=<optimized out>, c=0x5f441fb126d0, client_win=79691778, frame_win=12585452, refetch=false)
    at ../src/c2.c:2141
#2  0x00005f441cdb65b5 in c2_window_state_update (state=0x5f441fb2a5d0, window_state=0x5f442079ebf0, c=<optimized out>, client_win=<optimized out>, frame_win=12585452)
    at ../src/c2.c:2194
#3  win_on_factor_change (ps=<optimized out>, w=0x5f442079ea20) at ../src/wm/win.c:1048
#4  win_process_secondary_flags (ps=<optimized out>, w=0x5f442079ea20) at ../src/wm/win.c:495
#5  0x00005f441cd8afa5 in refresh_windows (ps=0x5f441fb21df0) at ../src/picom.c:1639
#6  handle_pending_updates (ps=0x5f441fb21df0, delta_t=0) at ../src/picom.c:1670
#7  0x00005f441cde0d03 in draw_callback_impl.isra.0 (ps=0x5f441fb21df0, revents=<optimized out>, loop=<optimized out>) at ../src/picom.c:1740
#8  0x00005f441cd89250 in draw_callback (loop=0x74422e247060 <default_loop_struct>, w=0x5f441fb21e50, revents=<optimized out>) at ../src/picom.c:1941
#9  0x000074422e23c13b in ev_invoke_pending (loop=0x74422e247060 <default_loop_struct>) at /usr/src/debug/libev/libev-4.33/ev.c:3770
#10 0x000074422e23fd22 in ev_run (loop=0x74422e247060 <default_loop_struct>, flags=0) at /usr/src/debug/libev/libev-4.33/ev.c:4190
#11 ev_run (loop=0x74422e247060 <default_loop_struct>, flags=flags@entry=0) at /usr/src/debug/libev/libev-4.33/ev.c:4021
#12 0x00005f441cd6ec07 in session_run (ps=<optimized out>) at ../src/picom.c:2742
#13 main (argc=<optimized out>, argv=<optimized out>) at ../src/picom.c:2857
@absolutelynothelix
Copy link
Collaborator

can't reproduce on xfce. wm-specific?

@yshui
Copy link
Owner

yshui commented Oct 10, 2024

odd, can't reproduce on i3 either. can you build picom with asan enabled? that might give us more info.

@yusufaktepe
Copy link
Author

odd, can't reproduce on i3 either. can you build picom with asan enabled? that might give us more info.

This is the output of picom when ASan is enabled:

../src/c2.c:2090:25: runtime error: store to misaligned address 0x000000000164 for type 'int64_t', which requires 8 byte alignment
0x000000000164: note: pointer points here
<memory cannot be printed>
AddressSanitizer:DEADLYSIGNAL
=================================================================
==11932==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000164 (pc 0x61f36485a98e bp 0x000000000164 sp 0x7ffe0d7895a0 T0)
==11932==The signal is caused by a WRITE memory access.
==11932==Hint: address points to the zero page.
    #0 0x61f36485a98e  (/usr/bin/picom+0x55698e) (BuildId: 5feb9fb366e9115f1b4b8b346a098662efaa6aa0)
    #1 0x61f3649b32f7  (/usr/bin/picom+0x6af2f7) (BuildId: 5feb9fb366e9115f1b4b8b346a098662efaa6aa0)
    #2 0x61f3649bf961  (/usr/bin/picom+0x6bb961) (BuildId: 5feb9fb366e9115f1b4b8b346a098662efaa6aa0)
    #3 0x61f3648cc979  (/usr/bin/picom+0x5c8979) (BuildId: 5feb9fb366e9115f1b4b8b346a098662efaa6aa0)
    #4 0x61f3648cf73f  (/usr/bin/picom+0x5cb73f) (BuildId: 5feb9fb366e9115f1b4b8b346a098662efaa6aa0)
    #5 0x771a03cf613a in ev_invoke_pending (/usr/lib/libev.so.4+0x513a) (BuildId: eab25fa323381b9ae83a414441759f583c6e9f1a)
    #6 0x771a03cf9d21 in ev_run (/usr/lib/libev.so.4+0x8d21) (BuildId: eab25fa323381b9ae83a414441759f583c6e9f1a)
    #7 0x61f364832863  (/usr/bin/picom+0x52e863) (BuildId: 5feb9fb366e9115f1b4b8b346a098662efaa6aa0)
    #8 0x771a02834e07  (/usr/lib/libc.so.6+0x25e07) (BuildId: 98b3d8e0b8c534c769cb871c438b4f8f3a8e4bf3)
    #9 0x771a02834ecb in __libc_start_main (/usr/lib/libc.so.6+0x25ecb) (BuildId: 98b3d8e0b8c534c769cb871c438b4f8f3a8e4bf3)
    #10 0x61f36483a744 in _start (/usr/bin/picom+0x536744) (BuildId: 5feb9fb366e9115f1b4b8b346a098662efaa6aa0)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/usr/bin/picom+0x55698e) (BuildId: 5feb9fb366e9115f1b4b8b346a098662efaa6aa0)
==11932==ABORTING

@yshui
Copy link
Owner

yshui commented Oct 10, 2024

hmm, looks like your picom is missing symbols. can you try again with the debug buildtype?

@yshui
Copy link
Owner

yshui commented Oct 10, 2024

oh, i have a hypothesis

@yshui
Copy link
Owner

yshui commented Oct 10, 2024

c2_window_state_update_one_from_reply couldn't handle window properties changing type... if that happens we could have memory leak, or segfaults like this one.

@yusufaktepe
Copy link
Author

This is the output with debug buildtype:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==22714==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000164 (pc 0x617554c9c121 bp 0x7fffcc56e970 sp 0x7fffcc56e8b0 T0)
==22714==The signal is caused by a WRITE memory access.
==22714==Hint: address points to the zero page.
    #0 0x617554c9c121 in c2_window_state_update_one_from_reply ../src/c2.c:2090
    #1 0x617554c9c121 in c2_window_state_update_from_replies ../src/c2.c:2141
    #2 0x617554d563d7 in win_on_factor_change ../src/wm/win.c:1048
    #3 0x617554d5ec46 in win_process_secondary_flags ../src/wm/win.c:495
    #4 0x617554cd3a99 in refresh_windows ../src/picom.c:1657
    #5 0x617554cd3a99 in handle_pending_updates ../src/picom.c:1688
    #6 0x617554cd3a99 in draw_callback_impl ../src/picom.c:1758
    #7 0x617554cd55df in draw_callback ../src/picom.c:1959
    #8 0x7938acf8713a in ev_invoke_pending (/usr/lib/libev.so.4+0x513a) (BuildId: eab25fa323381b9ae83a414441759f583c6e9f1a)
    #9 0x7938acf8ad21 in ev_run (/usr/lib/libev.so.4+0x8d21) (BuildId: eab25fa323381b9ae83a414441759f583c6e9f1a)
    #10 0x617554c8f932 in session_run ../src/picom.c:2775
    #11 0x617554c8f932 in main ../src/picom.c:2890
    #12 0x7938ac20be07  (/usr/lib/libc.so.6+0x25e07) (BuildId: 98b3d8e0b8c534c769cb871c438b4f8f3a8e4bf3)
    #13 0x7938ac20becb in __libc_start_main (/usr/lib/libc.so.6+0x25ecb) (BuildId: 98b3d8e0b8c534c769cb871c438b4f8f3a8e4bf3)
    #14 0x617554c93cf4 in _start (/usr/bin/picom+0x5bcf4) (BuildId: c11048d7553ce7f1ddba1934e3ff5afeccca8345)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ../src/c2.c:2090 in c2_window_state_update_one_from_reply
==22714==ABORTING

yshui added a commit that referenced this issue Oct 10, 2024
Previously, if the type of a property changes, or if a number property
went from inline (i.e. value->numbers) to external (i.e. value->array)
or vice versa, we could leak allocated memory, or accessing the wrong
member of a union (i.e. accessing value->array while value->numbers is
active, or vice versa).

Fixes #1350

Signed-off-by: Yuxuan Shui <[email protected]>
@yshui
Copy link
Owner

yshui commented Oct 10, 2024

thank you! can you try the fix-1350 branch?

@yusufaktepe
Copy link
Author

thank you! can you try the fix-1350 branch?

Issue is no longer present with the fix-1350 branch. Thanks.

yshui added a commit that referenced this issue Oct 10, 2024
Previously, if the type of a property changes, or if a number property
went from inline (i.e. value->numbers) to external (i.e. value->array)
or vice versa, we could leak allocated memory, or accessing the wrong
member of a union (i.e. accessing value->array while value->numbers is
active, or vice versa).

Fixes #1350

Signed-off-by: Yuxuan Shui <[email protected]>
yshui added a commit that referenced this issue Oct 10, 2024
Previously, if the type of a property changes, or if a number property
went from inline (i.e. value->numbers) to external (i.e. value->array)
or vice versa, we could leak allocated memory, or accessing the wrong
member of a union (i.e. accessing value->array while value->numbers is
active, or vice versa).

Fixes #1350

Signed-off-by: Yuxuan Shui <[email protected]>
yshui added a commit that referenced this issue Oct 10, 2024
Previously, if the type of a property changes, or if a number property
went from inline (i.e. value->numbers) to external (i.e. value->array)
or vice versa, we could leak allocated memory, or accessing the wrong
member of a union (i.e. accessing value->array while value->numbers is
active, or vice versa).

Fixes #1350

Signed-off-by: Yuxuan Shui <[email protected]>
yshui added a commit that referenced this issue Oct 10, 2024
Previously, if the type of a property changes, or if a number property
went from inline (i.e. value->numbers) to external (i.e. value->array)
or vice versa, we could leak allocated memory, or accessing the wrong
member of a union (i.e. accessing value->array while value->numbers is
active, or vice versa).

Fixes #1350

Signed-off-by: Yuxuan Shui <[email protected]>
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

3 participants