hyprwm / hypridle

Hyprland's idle daemon
BSD 3-Clause "New" or "Revised" License
404 stars 25 forks source link

Hypridle Core Dumped - Illegal Hardware Instruction #68

Open ksolowoniuk opened 5 months ago

ksolowoniuk commented 5 months ago

Hi there, I'm running Hyprland on Freebsd 14.1. Everything has been really good but I can't get Hypridle to work. exec-once = hypridle leaves a coredump in my home directory. The following is what I get trying to run hypridle from the terminal:

// hypridle [LOG] Registered timeout rule for 60s: on-timeout: hyprctl dispatch dpms off on-resume: hyprctl dispatch dpms on [LOG] Registered timeout rule for 120s: on-timeout: loginctl lock-session on-resume: [LOG] | got iface: wp_tearing_control_manager_v1 v1 [LOG] | got iface: wp_fractional_scale_manager_v1 v1 [LOG] | got iface: zxdg_output_manager_v1 v3 [LOG] | got iface: wp_cursor_shape_manager_v1 v1 [LOG] | got iface: zwp_idle_inhibit_manager_v1 v1 [LOG] | got iface: zwp_relative_pointer_manager_v1 v1 [LOG] | got iface: zxdg_decoration_manager_v1 v1 [LOG] | got iface: wp_alpha_modifier_v1 v1 [LOG] | got iface: zwlr_gamma_control_manager_v1 v1 [LOG] | got iface: ext_foreign_toplevel_list_v1 v1 [LOG] | got iface: zwp_pointer_gestures_v1 v3 [LOG] | got iface: zwlr_foreign_toplevel_manager_v1 v3 [LOG] | got iface: zwp_keyboard_shortcuts_inhibit_manager_v1 v1 [LOG] | got iface: zwp_text_input_manager_v3 v1 [LOG] | got iface: zwp_pointer_constraints_v1 v1 [LOG] | got iface: zwlr_output_power_manager_v1 v1 [LOG] | got iface: xdg_activation_v1 v1 [LOG] | got iface: ext_idle_notifier_v1 v1 [LOG] > Bound to ext_idle_notifier_v1 v1 [LOG] | got iface: ext_session_lock_manager_v1 v1 [LOG] | got iface: zwp_input_method_manager_v2 v1 [LOG] | got iface: zwp_virtual_keyboard_manager_v1 v1 [LOG] | got iface: zwlr_virtual_pointer_manager_v1 v2 [LOG] | got iface: zwlr_output_manager_v1 v4 [LOG] | got iface: hyprland_toplevel_export_manager_v1 v2 [LOG] | got iface: zwp_text_input_manager_v1 v1 [LOG] | got iface: hyprland_global_shortcuts_manager_v1 v1 [LOG] | got iface: zwlr_screencopy_manager_v1 v3 [LOG] | got iface: wl_shm v1 [LOG] | got iface: wl_drm v2 [LOG] | got iface: zwp_linux_dmabuf_v1 v4 [LOG] | got iface: wl_compositor v6 [LOG] | got iface: wl_subcompositor v1 [LOG] | got iface: wl_data_device_manager v3 [LOG] | got iface: zwlr_export_dmabuf_manager_v1 v1 [LOG] | got iface: zwlr_data_control_manager_v1 v2 [LOG] | got iface: zwp_primary_selection_device_manager_v1 v1 [LOG] | got iface: wp_viewporter v1 [LOG] | got iface: xdg_wm_base v6 [LOG] | got iface: wl_seat v9 [LOG] > Bound to wl_seat v9 [LOG] | got iface: wp_presentation v1 [LOG] | got iface: zwlr_layer_shell_v1 v4 [LOG] | got iface: org_kde_kwin_server_decoration_manager v1 [LOG] | got iface: wp_drm_lease_device_v1 v1 [LOG] | got iface: zwp_tablet_manager_v2 v1 [LOG] | got iface: zxdg_exporter_v1 v1 [LOG] | got iface: zxdg_importer_v1 v1 [LOG] | got iface: zxdg_exporter_v2 v1 [LOG] | got iface: zxdg_importer_v2 v1 [LOG] | got iface: wp_single_pixel_buffer_manager_v1 v1 [LOG] | got iface: xwayland_shell_v1 v1 [LOG] | got iface: wl_output v4 [LOG] found 2 rules [LOG] wayland done, registering dbus [LOG] Using dbus path /org/freedesktop/ConsoleKit/Session2 zsh: illegal hardware instruction (core dumped) hypridle

hypridle.core

vaxerski commented 5 months ago

please don't post core files, they are useless.

Anyways, illegal hardware instruction errors are impossible to be produced by C++ code, which likely means your hyprlock is compiled wrong. Please pull git and compile manually.

xorander00 commented 1 month ago

LLDB'ed a debug build and figured out it's the same issue as https://github.com/hyprwm/xdg-desktop-portal-hyprland/issues/207

FreeBSD's libc is catching a call to mutex::unlock() on a mutex that's not locked. Apparently it's UDB when trying to do that. I can confirm that calling mutex::try_lock() before the while loop at src/core/Hypridle.cpp:134 solves the issue. I hate how hacky it is, but it works for now.

EDIT: Should have probably added the line...

// src/core/Hypridle.cpp:134
m_sEventLoopInternals.loopRequestMutex.try_lock();
while (1) {
  // ...
}
vaxerski commented 1 month ago

ok that is stupid, it should abort...