Subject: Re: bug#49441: xfce4-power-manager segfaults randomly

From: Michael Rohleder <[email-masked]>
Date: Wed, 07 Jul 2021 07:46:41 +0200

Hello Nathan!

Thank you for the report and the backtrace!

Nathan Dehnel <[email-masked]> writes:
> Using v4.16.0. Attached is a backtrace. I have a coredump, but it's
> too large to attach to an email.
>
> #0  0x00007f995c4c75bc in gtk_widget_dispose ()
>    from /gnu/store/nd2i0wfhx2wsdn3di573wl7kagg6pm9s-gtk+-3.24.24/lib/libgtk-3.so.0
> #1  0x00007f995baee8a3 in g_object_unref ()
>    from /gnu/store/jsqxxnaj5p8a22mrsvl679gi7jl26z4j-glib-2.62.6/lib/libgobject-2.0.so.0
> #2  0x000000000041ea61 in battery_device_remove_pix ()
> #3  0x000000000041f37d in power_manager_button_update_device_icon_and_details ()

looks like it is crashing here:
(`guix build -S xfce4-power-manager`/panel-plugins/power-manager-plugin/power-manager-button.c:607)

/* This function unrefs the pix and img from the battery device and
 * disconnects the expose-event callback on the img.
 */
static void
battery_device_remove_pix (BatteryDevice *battery_device)
{
  TRACE("entering");

  if (battery_device == NULL)
    return;

  if (G_IS_OBJECT (battery_device->pix))
  {
    if (GTK_IS_WIDGET (battery_device->img))
    {
      if (battery_device->expose_signal_id != 0)
      {
          g_signal_handler_disconnect (battery_device->img, battery_device->expose_signal_id);
          battery_device->expose_signal_id = 0;
      }
      g_object_unref (battery_device->img);
      battery_device->img = NULL;
    }
    g_object_unref (battery_device->pix);
    battery_device->pix = NULL;
  }
}

I wonder how that can happen and so far I was not able to reproduce
this.

Do you get something on the console/stdout if you start
xfce4-power-manager on the console?

If that happens only sometimes: Maybe is it after you change something
at runtime, maybe changeing a battery or so?

-- 
You are not supposed to start Emacs more than once in a lifetime, so
the startup time shouldn't matter at all.
      Eli Zaretskii in help-gnu-emacs