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

Segmentation fault at startup #18

Open
zjeffer opened this issue May 14, 2024 · 2 comments
Open

Segmentation fault at startup #18

zjeffer opened this issue May 14, 2024 · 2 comments

Comments

@zjeffer
Copy link

zjeffer commented May 14, 2024

I've been using wdisplays for a couple of weeks/months but today it crashed at startup:

Backtrace
(gdb) bt
#0  0x000055555556885c in resize (output=0x5555558ece00) at ../src/overlay.c:65
#1  0x0000555555568b73 in window_map (widget=0x5555558ed390 [GtkWindow], data=0x5555558ece00) at ../src/overlay.c:138
#2  0x00007ffff6cfe64a in g_closure_invoke (closure=0x5555558ee020, return_value=0x0, n_param_values=1, param_values=0x7fffffffc120, invocation_hint=0x7fffffffc070) at ../glib/gobject/gclosure.c:834
#3  0x00007ffff6d2ece5 in signal_emit_unlocked_R.isra.0 (node=node@entry=0x7fffffffc1f0, detail=detail@entry=0, instance=instance@entry=0x5555558ed390, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffc120)
    at ../glib/gobject/gsignal.c:3888
#4  0x00007ffff6d1f5dc in signal_emit_valist_unlocked (instance=instance@entry=0x5555558ed390, signal_id=signal_id@entry=71, detail=detail@entry=0, var_args=var_args@entry=0x7fffffffc360) at ../glib/gobject/gsignal.c:3520
#5  0x00007ffff6d1f842 in g_signal_emit_valist (instance=0x5555558ed390, signal_id=71, detail=0, var_args=var_args@entry=0x7fffffffc360) at ../glib/gobject/gsignal.c:3263
#6  0x00007ffff6d1f904 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../glib/gobject/gsignal.c:3583
#7  0x00007ffff76bdd1a in gtk_widget_map (widget=0x5555558ed390 [GtkWindow]) at ../gtk/gtkwidget.c:5051
#8  0x00007ffff76e9085 in gtk_window_show (widget=0x5555558ed390 [GtkWindow]) at ../gtk/gtkwindow.c:6210
#9  0x00007ffff6cfe64a in g_closure_invoke (closure=0x555555609ea0, return_value=0x0, n_param_values=1, param_values=0x7fffffffc6d0, invocation_hint=0x7fffffffc620) at ../glib/gobject/gclosure.c:834
#10 0x00007ffff6d2ee22 in signal_emit_unlocked_R.isra.0 (node=node@entry=0x7fffffffc7a0, detail=detail@entry=0, instance=instance@entry=0x5555558ed390, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffc6d0)
    at ../glib/gobject/gsignal.c:3721
#11 0x00007ffff6d1f5dc in signal_emit_valist_unlocked (instance=instance@entry=0x5555558ed390, signal_id=signal_id@entry=69, detail=detail@entry=0, var_args=var_args@entry=0x7fffffffc910) at ../glib/gobject/gsignal.c:3520
#12 0x00007ffff6d1f842 in g_signal_emit_valist (instance=0x5555558ed390, signal_id=69, detail=0, var_args=var_args@entry=0x7fffffffc910) at ../glib/gobject/gsignal.c:3263
#13 0x00007ffff6d1f904 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../glib/gobject/gsignal.c:3583
#14 0x00007ffff76bd583 in gtk_widget_show (widget=0x5555558ed390 [GtkWindow]) at ../gtk/gtkwidget.c:4852
#15 0x0000555555568eb1 in wd_create_overlay (output=0x5555558ece00) at ../src/overlay.c:188
#16 0x0000555555568053 in wd_add_output (state=0x5555556a65d0, wl_output=0x55555557db70, display=0x5555555a43e0) at ../src/outputs.c:624
#17 0x000055555556358f in activate (app=0x555555587560 [GtkApplication], user_data=0x0) at ../src/main.c:1071
#18 0x00007ffff6cfe64a in g_closure_invoke (closure=0x555555588d80, return_value=0x0, n_param_values=1, param_values=0x7fffffffcd80, invocation_hint=0x7fffffffccd0) at ../glib/gobject/gclosure.c:834
#19 0x00007ffff6d2ece5 in signal_emit_unlocked_R.isra.0 (node=node@entry=0x7fffffffce50, detail=detail@entry=0, instance=instance@entry=0x555555587560, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffcd80)
    at ../glib/gobject/gsignal.c:3888
#20 0x00007ffff6d1f5dc in signal_emit_valist_unlocked (instance=instance@entry=0x555555587560, signal_id=signal_id@entry=8, detail=detail@entry=0, var_args=var_args@entry=0x7fffffffcfc0) at ../glib/gobject/gsignal.c:3520
#21 0x00007ffff6d1f842 in g_signal_emit_valist (instance=0x555555587560, signal_id=8, detail=0, var_args=var_args@entry=0x7fffffffcfc0) at ../glib/gobject/gsignal.c:3263
#22 0x00007ffff6d1f904 in g_signal_emit (instance=instance@entry=0x555555587560, signal_id=<optimized out>, detail=detail@entry=0) at ../glib/gobject/gsignal.c:3583
#23 0x00007ffff6f74158 in g_application_activate (application=0x555555587560 [GtkApplication]) at ../glib/gio/gapplication.c:2451
#24 0x00007ffff6f778e1 in g_application_real_local_command_line (application=0x555555587560 [GtkApplication], arguments=0x7fffffffd158, exit_status=0x7fffffffd154) at ../glib/gio/gapplication.c:1188
#25 0x00007ffff72d4cf9 in gtk_application_local_command_line (application=0x555555587560 [GtkApplication], arguments=0x7fffffffd158, exit_status=0x7fffffffd154) at ../gtk/gtkapplication.c:343
#26 0x00007ffff6f77a87 in g_application_run (application=0x555555587560 [GtkApplication], argc=<optimized out>, argv=0x7fffffffd2f8) at ../glib/gio/gapplication.c:2681
#27 0x000055555556372b in main (argc=1, argv=0x7fffffffd2f8) at ../src/main.c:1088
(gdb) 

Using Hyprland on Arch:

output of `hyprctl systeminfo`
Hyprland, built from branch main at commit 337422911895bb55099e00208bff929651dcb5d2  (core: remove unused includes and fix warn).
Date: Fri May 10 04:20:26 2024
Tag: v0.40.0-50-g33742291, commits: 4656

flags: (if any)


System Information:
System name: Linux
Node name: zjeffer
Release: 6.8.9-arch1-2
Version: #1 SMP PREEMPT_DYNAMIC Tue, 07 May 2024 21:35:54 +0000


GPU information: 
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] [10de:24dd] (rev a1) (prog-if 00 [VGA controller])


os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo


plugins:
  split-monitor-workspaces by Duckonaut ver 1.1.0

Happens both on latest release (wdisplays arch package) and latest master (manual build)

@zjeffer
Copy link
Author

zjeffer commented May 14, 2024

Apparantly the return value of wd_find_head is NULL

wdisplays/src/overlay.c

Lines 62 to 66 in 6233901

static void resize(struct wd_output *output) {
struct wd_head *head = wd_find_head(output->state, output);
uint32_t screen_width = head->custom_mode.width;
uint32_t screen_height = head->custom_mode.height;

If I add this on line 64:

  if (head == NULL) {
    printf("No head found for output %s\n", output->name);
    return;
  }

then Hyprland completely crashes, here are the last lines in the logfile:

hyprland log
[LOG] Window 60882389a020 set title to overlay.c - wdisplays - Visual Studio Code
[LOG] cursorImage request: surface 6088238d5f30
[LOG] cursorImage request: surface 6088238d5f30
[LOG] LayerSurface 1 destroyed
[LOG] Removing LayerSurface that wasn't mapped.
[LOG] Callback 608823884010 -> 608823884008, CWLSurface removed.
[LOG] Callback 608823884078 -> 608823884070, CWLSurface removed.
[LOG] CWLSurface 608823883f68 called destroy()
[LOG] LayerSurface 0 destroyed
[LOG] Callback 60881186b758 -> 60881186b750, CLayerShellResource removed.
[LOG] Callback 60881186b6f0 -> 60881186b6e8, CLayerShellResource removed.
[LOG] Callback 608811931168 -> 608811931160, FractionalScale removed.
[LOG] Cleanup: destroyed a layersurface
[LOG] cursorImage request: surface 6088238d5f30
[LOG] cursorImage request: surface 6088238d5f30
[LOG] [OutputManagement] New OutputManager registered
[LOG] [OutputManagement]  | sending output head for DP-1
[LOG] [OutputManagement]   | sending mode 1920x1080@60000mHz, pref: true
[LOG] [OutputManagement]   | sending mode 1680x1050@59954mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x1024@75025mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x1024@60020mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1440x900@59887mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x960@60000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x800@59810mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1152x864@75000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x720@60000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1024x768@75029mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1024x768@70069mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1024x768@60004mHz, pref: false
[LOG] [OutputManagement]   | sending mode 800x600@75000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 800x600@72188mHz, pref: false
[LOG] [OutputManagement]   | sending mode 800x600@60317mHz, pref: false
[LOG] [OutputManagement]   | sending mode 800x600@56250mHz, pref: false
[LOG] [OutputManagement]   | sending mode 640x480@75000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 640x480@72809mHz, pref: false
[LOG] [OutputManagement]   | sending mode 640x480@59940mHz, pref: false
[LOG] [OutputManagement]   | sending current mode for DP-1: 1920x1080@60000
[LOG] [OutputManagement]  | sending output head for DP-2
[LOG] [OutputManagement]   | sending mode 1920x1080@60000mHz, pref: true
[LOG] [OutputManagement]   | sending mode 1920x1080@59939mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1920x1080@50000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1920x1080@25000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1920x1080@24000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1920x1080@23977mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x1024@60020mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x720@59943mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x720@50000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1024x768@60004mHz, pref: false
[LOG] [OutputManagement]   | sending mode 800x600@60317mHz, pref: false
[LOG] [OutputManagement]   | sending mode 720x576@50000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 720x480@59940mHz, pref: false
[LOG] [OutputManagement]   | sending mode 640x480@59940mHz, pref: false
[LOG] [OutputManagement]   | sending mode 640x480@59929mHz, pref: false
[LOG] [OutputManagement]   | sending current mode for DP-2: 1920x1080@60000
[LOG] [OutputManagement]  | sending output head for HDMI-A-1
[LOG] [OutputManagement]   | sending mode 1920x1080@60000mHz, pref: true
[LOG] [OutputManagement]   | sending mode 1920x1080@59939mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1920x1080@50000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1680x1050@59954mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x1024@75025mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x1024@60020mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1440x900@74984mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1440x900@59887mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x960@60000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x720@60000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x720@59943mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1280x720@50000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1024x768@75029mHz, pref: false
[LOG] [OutputManagement]   | sending mode 1024x768@60004mHz, pref: false
[LOG] [OutputManagement]   | sending mode 800x600@75000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 800x600@60317mHz, pref: false
[LOG] [OutputManagement]   | sending mode 720x576@50000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 720x480@59940mHz, pref: false
[LOG] [OutputManagement]   | sending mode 640x480@75000mHz, pref: false
[LOG] [OutputManagement]   | sending mode 640x480@72809mHz, pref: false
[LOG] [OutputManagement]   | sending mode 640x480@59940mHz, pref: false
[LOG] [OutputManagement]   | sending mode 640x480@59929mHz, pref: false
[LOG] [OutputManagement]   | sending current mode for HDMI-A-1: 1920x1080@60000
[LOG] [OutputManagement]  | sending output head for eDP-1
[LOG] [OutputManagement]   | sending mode 2560x1600@60008mHz, pref: true
[LOG] [OutputManagement]   | sending mode 2560x1600@165019mHz, pref: false
[LOG] [OutputManagement]   | sending current mode for eDP-1: 2560x1600@165019
[LOG] ScreencopyProtocolManager bound successfully!
[LOG] [TextInputV3] New tiv3 at 00006088121f7d70
[LOG] Registered signal for owner 60881186b4e0: 6088121cf088 -> 60881186b6c8 (owner: CLayerShellResource)
[LOG] Registered signal for owner 60881186b4e0: 6088121cf048 -> 60881186b730 (owner: CLayerShellResource)
[LOG] Registered signal for owner 608823883f68: 6088121cf088 -> 608823883fe8 (owner: CWLSurface)
[LOG] Registered signal for owner 608823883f68: 6088121cf048 -> 608823884050 (owner: CWLSurface)
[LOG] CWLSurface 608823883f68 called init()
[LOG] LayerSurface 60881186b4e0 (namespace output-overlay layer 2) created on monitor DP-1
[LOG] [LayerShell] New wlr_layer_surface 60881186b4e0
[LOG] Registered signal for owner 6088121ced70: 6088121cf088 -> 608811b00a30 (owner: FractionalScale)
[LOG] Registered signal for owner 60882386fff0: 6088238abee8 -> 6088238701d8 (owner: CLayerShellResource)
[LOG] Registered signal for owner 60882386fff0: 6088238abea8 -> 608823870240 (owner: CLayerShellResource)
[LOG] Registered signal for owner 6088121e2e88: 6088238abee8 -> 6088121e2f08 (owner: CWLSurface)
[LOG] Registered signal for owner 6088121e2e88: 6088238abea8 -> 6088121e2f70 (owner: CWLSurface)
[LOG] CWLSurface 6088121e2e88 called init()
[LOG] LayerSurface 60882386fff0 (namespace output-overlay layer 2) created on monitor HDMI-A-1
[LOG] [LayerShell] New wlr_layer_surface 60882386fff0
[LOG] Registered signal for owner 6088118983c0: 608823892018 -> 6088118985a8 (owner: CLayerShellResource)
[LOG] Registered signal for owner 6088118983c0: 608823891fd8 -> 608811898610 (owner: CLayerShellResource)
[LOG] Registered signal for owner 6088238ac8e8: 608823892018 -> 6088238ac968 (owner: CWLSurface)
[LOG] Registered signal for owner 6088238ac8e8: 608823891fd8 -> 6088238ac9d0 (owner: CWLSurface)
[LOG] CWLSurface 6088238ac8e8 called init()
[LOG] LayerSurface 6088118983c0 (namespace output-overlay layer 2) created on monitor HDMI-A-1
[LOG] [LayerShell] New wlr_layer_surface 6088118983c0
[LOG] Registered signal for owner 608823891d00: 608823892018 -> 6088238acc10 (owner: FractionalScale)
[LOG] Registered signal for owner 608811a3ff10: 6088121e29b8 -> 608811a400f8 (owner: CLayerShellResource)
[LOG] Registered signal for owner 608811a3ff10: 6088121e2978 -> 608811a40160 (owner: CLayerShellResource)
[LOG] Registered signal for owner 608823883848: 6088121e29b8 -> 6088238838c8 (owner: CWLSurface)
[LOG] Registered signal for owner 608823883848: 6088121e2978 -> 608823883930 (owner: CWLSurface)
[LOG] CWLSurface 608823883848 called init()
[LOG] LayerSurface 608811a3ff10 (namespace output-overlay layer 2) created on monitor eDP-1
[LOG] [LayerShell] New wlr_layer_surface 608811a3ff10
[LOG] Registered signal for owner 6088121e26a0: 6088121e29b8 -> 6088238b0d80 (owner: FractionalScale)
[LOG] New XDG Toplevel created. (class: null)
[LOG] Registered signal for owner 6088238f1730: 6088121f5898 -> 6088238f1798 (owner: XDG Window)
[LOG] Registered signal for owner 6088238f1730: 608813812358 -> 6088238f1868 (owner: XDG Window)
[LOG] Registered signal for owner 6088238f1730: 6088121f5888 -> 6088238f1730 (owner: XDG Window)
[LOG] Registered signal for owner 6088238f1f50: 6088121f58c8 -> 6088238f1fd0 (owner: CWLSurface)
[LOG] Registered signal for owner 6088238f1f50: 6088121f5888 -> 6088238f2038 (owner: CWLSurface)
[LOG] CWLSurface 6088238f1f50 called init()
[LOG] Searching for matching rules for wdisplays (title: wdisplays)
[LOG] Layout predicts size [Vector2D: x: 960, y: 1040] for [Window 6088238f1730: title: ""]
[ERR] client requested sharing of a monitor that doesnt exist

@zjeffer
Copy link
Author

zjeffer commented May 18, 2024

Figured it out: it only happens when one of my monitors is mirroring another one. If I disconnect my mirrored monitor, it doesn't segfault.

Does wdisplays not support mirroring?

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

1 participant