How to investigate gnome crashing?

First you need to install the debug symbols, you will need to rebuild your system with the following added to your configuration:

{ pkgs }:
{
  environment.systemPackages = with pkgs; [
    gdb
    # To link debug symbols to path where gdb can see them.
    glib
    gnome.gnome-session
    gnome.mutter
    gnome.gnome-shell
  ];

  environment.enableDebugInfo = true;

  nixpkgs.overlays = [
    (final: prev: {
      # These three packages contain debug symbols since NixOS 22.11.
      # You do not need this overlay on that or later versions.
      gnome = prev.gnome.overrideScope' (gfinal: gprev: {
        gnome-session = gprev.gnome-session.overrideAttrs (attrs: {
          separateDebugInfo = true;
        });
        gnome-shell = gprev.gnome-shell.overrideAttrs (attrs: {
          separateDebugInfo = true;
        });
        mutter = gprev.mutter.overrideAttrs (attrs: {
          separateDebugInfo = true;
        });
      });
    })
  ];
}

After switching to the new generation, re-log in.

Then, when the crash occurs, you can run coredumpctl to see the list of crashes and run coredumpctl gdb <pid> (or just coredumpctl gdb for the last one). In there you can enter bt full the get the backtrace with symbols resolved.

With this output, please open an issue on Nixpkgs issue tracker and mention @NixOS/gnome. Do not forget to mention the NixOS commit you use (check the output of nixos-version command).

1 Like