[GH-ISSUE #751] Panics when interacting with duplicate tray menus #1647

Closed
opened 2026-05-22 22:53:45 +01:00 by JakeStanger · 7 comments
Owner

Originally created by @ToxicMushroom on GitHub (Oct 20, 2024).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/751

Describe the bug
Sometimes I have duplicate tray elements, when closing 1 of them then that one dissapears. Interacting with the other one makes ironbar panic.

To Reproduce
Steps to reproduce the behavior:

  1. Get duplicate tray elements. Restart ironbar until you hit it via RNG :D
  2. Close the application via the tray item
  3. Try to close the application via the other tray icon
  4. See error

Expected behavior
Ideally no duplicate tray elements appear.
But ironbar should not crash out when it can't succeed at sending a tray item a message or something.

System information:

  • Distro: Arch
  • Compositor: Sway 1.10-rc3
  • Ironbar version: 0.16.1-pre

Configuration
Not applicable

Additional context

merlijn@arch ~ % ironbar
2024-10-20T21:55:54.942723Z  INFO ironbar: 134: Ironbar version 0.16.1-pre
2024-10-20T21:55:54.942739Z  INFO ironbar: 135: Starting application
2024-10-20T21:55:55.028687Z  WARN ironbar::ipc::server: 33: Socket already exists. Did Ironbar exit abruptly?
2024-10-20T21:55:55.028719Z  WARN ironbar::ipc::server: 34: Attempting IPC shutdown to allow binding to address
2024-10-20T21:55:55.028767Z  INFO ironbar::ipc::server: 39: Starting IPC on /run/user/1000/ironbar-ipc.sock
2024-10-20T21:55:55.029654Z  INFO ironbar::bar: 117: Initializing bar 'bar-3' on 'DP-2'
2024-10-20T21:55:55.031059Z  INFO ironbar::clients::sway: 36: Sway IPC subscription client connected
2024-10-20T21:55:55.032992Z  INFO connect: mpd_protocol::connection: 306: connected successfully version="0.23.5"
2024-10-20T21:55:55.033012Z  INFO mpd_utils::persistent_client: 66: Connected to 'localhost:6600'
2024-10-20T21:55:55.107934Z  INFO ironbar::clients::volume: 168: connected to server
2024-10-20T21:55:55.121901Z  INFO ironbar::bar: 117: Initializing bar 'bar-16' on 'DP-1'
2024-10-20T21:56:02.803486Z ERROR ironbar::logging: 48: The application panicked (crashed).
Message:  Failed to send message to channel: "Closed(..)"
Location: src/modules/tray/interface.rs:84

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
2024-10-20T21:56:03.820210Z ERROR ironbar::logging: 48: The application panicked (crashed).
Message:  Failed to send message to channel: "Closed(..)"
Location: src/modules/tray/interface.rs:280

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
2024-10-20T21:56:03.829083Z ERROR ironbar::logging: 48: The application panicked (crashed).
Message:  panic in a function that cannot unwind
Location: library/core/src/panicking.rs:221

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
thread caused non-unwinding panic. aborting.
[1]    89865 IOT instruction (core dumped)  ironbar

Screenshots
2 tray items
image
closed gajim via 1 of them
image
tried to remove the other by hitting exit in the other tray item menu but panic like above:
image

Originally created by @ToxicMushroom on GitHub (Oct 20, 2024). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/751 **Describe the bug** Sometimes I have duplicate tray elements, when closing 1 of them then that one dissapears. Interacting with the other one makes ironbar panic. **To Reproduce** Steps to reproduce the behavior: 1. Get duplicate tray elements. Restart ironbar until you hit it via RNG :D 2. Close the application via the tray item 3. Try to close the application via the other tray icon 4. See error **Expected behavior** Ideally no duplicate tray elements appear. But ironbar should not crash out when it can't succeed at sending a tray item a message or something. **System information:** - Distro: Arch - Compositor: Sway 1.10-rc3 - Ironbar version: 0.16.1-pre **Configuration** Not applicable **Additional context** ``` merlijn@arch ~ % ironbar 2024-10-20T21:55:54.942723Z INFO ironbar: 134: Ironbar version 0.16.1-pre 2024-10-20T21:55:54.942739Z INFO ironbar: 135: Starting application 2024-10-20T21:55:55.028687Z WARN ironbar::ipc::server: 33: Socket already exists. Did Ironbar exit abruptly? 2024-10-20T21:55:55.028719Z WARN ironbar::ipc::server: 34: Attempting IPC shutdown to allow binding to address 2024-10-20T21:55:55.028767Z INFO ironbar::ipc::server: 39: Starting IPC on /run/user/1000/ironbar-ipc.sock 2024-10-20T21:55:55.029654Z INFO ironbar::bar: 117: Initializing bar 'bar-3' on 'DP-2' 2024-10-20T21:55:55.031059Z INFO ironbar::clients::sway: 36: Sway IPC subscription client connected 2024-10-20T21:55:55.032992Z INFO connect: mpd_protocol::connection: 306: connected successfully version="0.23.5" 2024-10-20T21:55:55.033012Z INFO mpd_utils::persistent_client: 66: Connected to 'localhost:6600' 2024-10-20T21:55:55.107934Z INFO ironbar::clients::volume: 168: connected to server 2024-10-20T21:55:55.121901Z INFO ironbar::bar: 117: Initializing bar 'bar-16' on 'DP-1' 2024-10-20T21:56:02.803486Z ERROR ironbar::logging: 48: The application panicked (crashed). Message: Failed to send message to channel: "Closed(..)" Location: src/modules/tray/interface.rs:84 Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets. 2024-10-20T21:56:03.820210Z ERROR ironbar::logging: 48: The application panicked (crashed). Message: Failed to send message to channel: "Closed(..)" Location: src/modules/tray/interface.rs:280 Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets. 2024-10-20T21:56:03.829083Z ERROR ironbar::logging: 48: The application panicked (crashed). Message: panic in a function that cannot unwind Location: library/core/src/panicking.rs:221 Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets. thread caused non-unwinding panic. aborting. [1] 89865 IOT instruction (core dumped) ironbar ``` *Screenshots* 2 tray items ![image](https://github.com/user-attachments/assets/3ab2ccc1-f52a-49f7-b86e-b1d8bc64c5a1) closed gajim via 1 of them ![image](https://github.com/user-attachments/assets/2c7a0a0b-db48-4937-bdf7-d95c6d647145) tried to remove the other by hitting exit in the other tray item menu but panic like above: ![image](https://github.com/user-attachments/assets/840e772d-a1ed-42fc-9364-5718a24e1714)
Author
Owner

@JakeStanger commented on GitHub (Oct 20, 2024):

Related: #640

Cheers for reporting. I'll keep this open to prioritise a fix for the crash.

<!-- gh-comment-id:2425249373 --> @JakeStanger commented on GitHub (Oct 20, 2024): Related: #640 Cheers for reporting. I'll keep this open to prioritise a fix for the crash.
Author
Owner

@ToxicMushroom commented on GitHub (Oct 20, 2024):

Was just about to link it for you since I vaguely recalled there being one for duplicate icons :)

<!-- gh-comment-id:2425249771 --> @ToxicMushroom commented on GitHub (Oct 20, 2024): Was just about to link it for you since I vaguely recalled there being one for duplicate icons :)
Author
Owner

@ToxicMushroom commented on GitHub (Nov 3, 2024):

@JakeStanger Hi I just wanted to let you know that em https://github.com/elkowar/eww/tree/master/crates/notifier_host exists and yoinking some of their MIT code locally produced a working bar for me :3

<!-- gh-comment-id:2453265553 --> @ToxicMushroom commented on GitHub (Nov 3, 2024): @JakeStanger Hi I just wanted to let you know that em https://github.com/elkowar/eww/tree/master/crates/notifier_host exists and yoinking some of their MIT code locally produced a working bar for me :3
Author
Owner

@ToxicMushroom commented on GitHub (Nov 3, 2024):

the_tray.patch.githubdoesntaccept.patch.txt

Here's my patch that I was playing around with if you're curious, it's by no means well tested nor thought through but it might serve as a good starting point :)

<!-- gh-comment-id:2453266128 --> @ToxicMushroom commented on GitHub (Nov 3, 2024): [the_tray.patch.githubdoesntaccept.patch.txt](https://github.com/user-attachments/files/17608985/the_tray.patch.githubdoesntaccept.patch.txt) Here's my patch that I was playing around with if you're curious, it's by no means well tested nor thought through but it might serve as a good starting point :)
Author
Owner

@JakeStanger commented on GitHub (Nov 4, 2024):

Thanks for this. I'm going to try and tackle the tray issues this week if I can face it, so this is really useful.

I've seen you've forked both this & the tray repo in the last few days - is there anything you're picking up yourself? No worries if not, no expectation, just don't want to step on your toes :)

<!-- gh-comment-id:2454695526 --> @JakeStanger commented on GitHub (Nov 4, 2024): Thanks for this. I'm going to try and tackle the tray issues this week if I can face it, so this is really useful. I've seen you've forked both this & the tray repo in the last few days - is there anything you're picking up yourself? No worries if not, no expectation, just don't want to step on your toes :)
Author
Owner

@JakeStanger commented on GitHub (Nov 4, 2024):

Tracking over here: https://github.com/JakeStanger/system-tray/pull/2

<!-- gh-comment-id:2454741420 --> @JakeStanger commented on GitHub (Nov 4, 2024): Tracking over here: https://github.com/JakeStanger/system-tray/pull/2
Author
Owner

@ToxicMushroom commented on GitHub (Nov 4, 2024):

Thanks for this. I'm going to try and tackle the tray issues this week if I can face it, so this is really useful.

I've seen you've forked both this & the tray repo in the last few days - is there anything you're picking up yourself? No worries if not, no expectation, just don't want to step on your toes :)

Happy to hear :)

I wasn't planning to pick anything up yet, I just wanted to sync my testing stuff between devices.

<!-- gh-comment-id:2454801681 --> @ToxicMushroom commented on GitHub (Nov 4, 2024): > Thanks for this. I'm going to try and tackle the tray issues this week if I can face it, so this is really useful. > > I've seen you've forked both this & the tray repo in the last few days - is there anything you're picking up yourself? No worries if not, no expectation, just don't want to step on your toes :) Happy to hear :) I wasn't planning to pick anything up yet, I just wanted to sync my testing stuff between devices.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#1647
No description provided.