How to investigate gnome crashing?

Gnome started crashing on me periodically (about once a day) after some update. I found the following in journalctl, but am not at all sure how to proceed to investigate the cause of the issue. Is this something I can report on Nixpkg? What would be my steps to reproduce (Step 1: *be me)?

Jun 13 18:45:24 nixtop systemd-coredump[218866]: [🡕] Process 2072 (.gnome-shell-wr) of user 1000 dumped core.
                                                 
                                                 Module linux-vdso.so.1 with build-id a1a4de36c310ad78490f69e2270b39e6b57b1b21
                                                 Module ISO8859-1.so with build-id ad934bbbd21abdd9c4ca2208a25affd4ced36552
                                                 Module libcanberra-pulse.so without build-id.
                                                 Module p11-kit-trust.so without build-id.
                                                 Module libgiognutls.so without build-id.
                                                 Module libgiognomeproxy.so without build-id.
                                                 Module libgioenvironmentproxy.so without build-id.
                                                 Module libgioremote-volume-monitor.so without build-id.
                                                 Module libcrypt.so.1 with build-id 3b72beba686501bae820e34d22b886cf2146979f
                                                 Module libaccountsservice.so.0 without build-id.
                                                 Module libopus.so.0 without build-id.
                                                 Module libvorbisenc.so.2 without build-id.
                                                 Module libFLAC.so.8 without build-id.
                                                 Module libsndfile.so.1 without build-id.
                                                 Module libpulsecommon-15.0.so without build-id.
                                                 Module libpulse-mainloop-glib.so.0 without build-id.
                                                 Module libpulse.so.0 without build-id.
                                                 Module libgvc.so without build-id.
                                                 Module libupower-glib.so.3 without build-id.
                                                 Module libgnome-bluetooth-3.0.so.13 without build-id.
                                                 Module libgeocode-glib.so.0 without build-id.
                                                 Module libgweather-4.so.0 without build-id.
                                                 Module librsvg-2.so.2 without build-id.
                                                 Module libpixbufloader-svg.so without build-id.
                                                 Module libgdm.so.1 without build-id.
                                                 Module libgeoclue-2.so.0 without build-id.
                                                 Module libibus-1.0.so.5 without build-id.
                                                 Module libbrotlicommon.so.1 without build-id.
                                                 Module libbrotlidec.so.1 without build-id.
                                                 Module libpsl.so.5 without build-id.
                                                 Module libsoup-2.4.so.1 without build-id.
                                                 Module libspa-journal.so without build-id.
                                                 Module libspa-support.so without build-id.
                                                 Module libgvfscommon.so without build-id.
                                                 Module libgvfsdbus.so without build-id.
                                                 Module libpciaccess.so.0 without build-id.
                                                 Module libdrm_intel.so.1 without build-id.
                                                 Module libdrm_nouveau.so.2 without build-id.
                                                 Module libdrm_amdgpu.so.1 without build-id.
                                                 Module libelf.so.0 without build-id.
                                                 Module libdrm_radeon.so.1 without build-id.
                                                 Module libLLVM-13.so with build-id babf69c5c407fce96c5d7cc9c389d58d78ebae99
                                                 Module iris_dri.so with build-id d1b49f2b18ebe6b45fdafd9f98723513edc84e2a
                                                 Module libxshmfence.so.1 without build-id.
                                                 Module libxcb-sync.so.1 without build-id.
                                                 Module libxcb-present.so.0 without build-id.
                                                 Module libxcb-dri3.so.0 without build-id.
                                                 Module libxcb-xfixes.so.0 without build-id.
                                                 Module libxcb-dri2.so.0 without build-id.
                                                 Module libglapi.so.0 without build-id.
                                                 Module libEGL_mesa.so.0 without build-id.
                                                 Module libdconfsettings.so without build-id.
                                                 Module libmvec.so.1 with build-id 0c89cc5021a68a47e272055695b87870b5bb96f3
                                                 Module libogg.so.0 without build-id.
                                                 Module libvorbis.so.0 without build-id.
                                                 Module libdatrie.so.1 without build-id.
                                                 Module libgmp.so.10 without build-id.
                                                 Module libhogweed.so.6 without build-id.
                                                 Module libnettle.so.8 without build-id.
                                                 Module libtasn1.so.6 without build-id.
                                                 Module libunistring.so.2 without build-id.
                                                 Module libidn2.so.0 without build-id.
                                                 Module libgpg-error.so.0 without build-id.
                                                 Module libevdev.so.2 without build-id.
                                                 Module libmtdev.so.1 without build-id.
                                                 Module libuuid.so.1 with build-id b1140eb026c31a128382d3650d6d709779cf4999
                                                 Module libXdmcp.so.6 without build-id.
                                                 Module libxcb-xkb.so.1 without build-id.
                                                 Module libxcb-util.so.1 without build-id.
                                                 Module libltdl.so.7 without build-id.
                                                 Module libvorbisfile.so.3 without build-id.
                                                 Module libGLX.so.0 without build-id.
                                                 Module libGLdispatch.so.0 without build-id.
                                                 Module libncursesw.so.6 without build-id.
                                                 Module libnspr4.so without build-id.
                                                 Module libplc4.so without build-id.
                                                 Module libplds4.so without build-id.
                                                 Module libicudata.so.71 without build-id.
                                                 Module libxml2.so.2 without build-id.
                                                 Module libsqlite3.so.0 with build-id 99dd2c97de5fe26b
... There is much more

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

I just experienced what appears to be the exact same crash :confused: Based on the logs it seems to be a segfault in firefox that crashed the whole system somehow?

Thank you! I will follow your advice and update you if I discover more.

Is there a performance drawback to having the gnome debugging enabled? Do I need to turn it off as soon as I get the stack trace and open the issue?

1 Like

The only downside is that you will need to rebuild gnome-shell and anything depending on it every time you update your system to a revision with different build of gnome-shell, since gnome-shell with debug symbols is not part of binary cache.

Well, there is also the extra space required for the debug symbols for all the packages that have them and are listed in environment.systemPackages but that should not be that bad these days (unless you add something like webkitgtk, whose are 1470.09 MiB unpacked).

1 Like