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 on start - 'std::runtime_error' - Wrong size of RFKILL event #994

Closed
rxguy opened this issue Jan 23, 2021 · 2 comments · Fixed by #1015
Closed

Crash on start - 'std::runtime_error' - Wrong size of RFKILL event #994

rxguy opened this issue Jan 23, 2021 · 2 comments · Fixed by #1015

Comments

@rxguy
Copy link

rxguy commented Jan 23, 2021

I run Fedora Rawhide, with wlroots and sway from git master.
Building and running git master results in the following:

waybar -l debug
[2021-01-23 15:04:20.085] [info] Resources files: /home/dturner/.config/waybar/config, /home/dturner/.config/waybar/style.css
[2021-01-23 15:04:45.167] [debug] Output detection done: DVI-D-1 (Ancor Communications Inc ASUS VW224 A4LMTF074092)
[2021-01-23 15:04:45.250] [debug] Cmd exited with code 127
[2021-01-23 15:04:45.250] [error] media stopped unexpectedly, is it endless?
[2021-01-23 15:04:45.250] [debug] Received SIGCHLD in signalThread
[2021-01-23 15:04:45.274] [warning] For a functional tray you must have libappindicator-* installed and export XDG_CURRENT_DESKTOP=Unity
terminate called after throwing an instance of 'std::runtime_error'
what(): Wrong size of RFKILL event
Aborted (core dumped)

Any thoughts?

@pvalena
Copy link

pvalena commented Jan 28, 2021

Same here, also Fedora Rawhide:

waybar -l debug
[2021-01-28 14:29:16.900] [info] Resources files: /home/lpcs/.config/waybar/config, /etc/xdg/waybar/style.css
[2021-01-28 14:29:16.904] [debug] Output detected: eDP-1 (Chimei Innolux Corporation 0x14C9)
[2021-01-28 14:29:16.904] [debug] Output detected: HDMI-A-2 (Philips Consumer Electronics Company PHL 325E1)
[2021-01-28 14:29:16.906] [debug] mpd: Disconnected: enabled interval timer.
terminate called after throwing an instance of 'std::runtime_error'
  what():  Wrong size of RFKILL event
[1]    3635320 IOT instruction (core dumped)  waybar -l debug

@alebastr
Copy link
Contributor

The rfkill code in waybar is written with assumption that RFKILL_EVENT_SIZE_V1 is the expected size of a rfkill event. The comment in /usr/include/linux/rfkill.h suggests that anything >= RFKILL_EVENT_SIZE_V1 is an acceptable value though.

Kernel 5.11 available in rawhide extends struct rfkill_event with an additional field and the assumption is no longer true.

rfkill.h changes in 5.11
--- /usr/include/linux/rfkill.h 2021-01-27 08:03:41.000000000 -0800
+++ /var/lib/mock/fedora-rawhide-x86_64/root/usr/include/linux/rfkill.h 2021-01-25 06:52:07.000000000 -0800
@@ -70,12 +70,24 @@
 };

 /**
+ * enum rfkill_hard_block_reasons - hard block reasons
+ * @RFKILL_HARD_BLOCK_SIGNAL: the hardware rfkill signal is active
+ * @RFKILL_HARD_BLOCK_NOT_OWNER: the NIC is not owned by the host
+ */
+enum rfkill_hard_block_reasons {
+       RFKILL_HARD_BLOCK_SIGNAL        = 1 << 0,
+       RFKILL_HARD_BLOCK_NOT_OWNER     = 1 << 1,
+};
+
+/**
  * struct rfkill_event - events for userspace on /dev/rfkill
  * @idx: index of dev rfkill
  * @type: type of the rfkill struct
  * @op: operation code
  * @hard: hard state (0/1)
  * @soft: soft state (0/1)
+ * @hard_block_reasons: valid if hard is set. One or several reasons from
+ *     &enum rfkill_hard_block_reasons.
  *
  * Structure used for userspace communication on /dev/rfkill,
  * used for events from the kernel and control to the kernel.
@@ -84,7 +96,9 @@
        __u32 idx;
        __u8  type;
        __u8  op;
-       __u8  soft, hard;
+       __u8  soft;
+       __u8  hard;
+       __u8  hard_block_reasons;
 } __attribute__((packed));

 /*

The only solution for now is to disable network and bluetooth modules in the waybar configuration file. I'll look into fixing the code.

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

Successfully merging a pull request may close this issue.

3 participants