Skip to content

SIGSEGV when monitor is powered off #606

Closed

Description

@wojnilowicz

Describe the bug
Frequent "systemd-coredump[188657]: [🡕] Process 188425 (workrave) of user 1000 dumped core." when analyzing journalctl.

To Reproduce
Steps to reproduce the behavior:

  1. Start workrave
  2. Call swaymsg "output * power off" from the terminal. In my case it's called automatically after some idle period.
  3. A coredump can be observed either immediately, after 5 minutes or even after 15 minutes

Expected behavior
No coredump.

Screenshots
Not applicable.

** Linux (please complete the following information in case you encountered the bug on Linux):**

  • Distribution: Fedora
  • Distribution Version: 41
  • Desktop Environment: Sway 1.10
  • Workrave Version 1.11.0~beta.13
  • Nouveau

Additional context

  1. "Force the use of X11 on Wayland" unchecked.
  2. Running in quiet mode, no screen blocking or reminders.
  3. It's a laptop with external monitor connected through HDMI. The laptop monitor is always disabled.
#0  0x00007f4397746355 in Gdk::Monitor::is_primary() const () at /lib64/libgdkmm-3.0.so.1
#1  0x00005626bd131fca in Toolkit::get_head_info (this=0x5626ed280b00, screen_index=<optimized out>) at /usr/include/glibmm-2.4/glibmm/refptr.h:259
#2  0x00005626bd11e202 in MainWindow::convert_monitor_to_display
    (this=0x5626ed5fba00, x=<synthetic pointer>: <optimized out>, y=<synthetic pointer>: <optimized out>, head=0)
    at /usr/src/debug/workrave-1.11.0~beta.13-2.fc41.x86_64/ui/app/toolkits/gtkmm/MainWindow.cc:383

Activity

  1. wojnilowicz commented on Mar 9, 2025

    @wojnilowicz
    ContributorAuthor

    It seems to crash at the 155 line

    HeadInfo
    Toolkit::get_head_info(int screen_index) const
    {
    Glib::RefPtr<Gdk::Display> display = Gdk::Display::get_default();
    Glib::RefPtr<Gdk::Monitor> monitor = display->get_monitor(screen_index);
    HeadInfo head;
    head.primary = monitor->is_primary();
    head.monitor = monitor;

    Both get_default and get_monitor from the 151 and 152 line could return nullptr as seen here and here. Current code is not prepared to handle that, and we seem to have such case with the "monitor" pointer.

    Could you fix that?

  2. wojnilowicz commented on Apr 1, 2025

    @wojnilowicz
    ContributorAuthor

    No more crash with your latest patch. Thanks for the fix. This issue can be closed.

  3. rcaelers commented on Apr 5, 2025

    @rcaelers
    Owner

    Thanks for checking! I haven't been able to fully reproduce the crash. Good to know that the problem is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions