[Bug 2165313] Re: bug in crash.c causes "Report problem..." button to fail

Launchpad Bug Tracker 2165313 at bugs.launchpad.net
Thu Aug 27 11:39:05 UTC 2026


** Merge proposal linked:
   https://code.launchpad.net/~knz/update-notifier/+git/update-notifier/+merge/510293

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-notifier in Ubuntu.
https://bugs.launchpad.net/bugs/2165313

Title:
  bug in crash.c causes "Report problem..." button to fail

Status in update-notifier package in Ubuntu:
  New

Bug description:
  Summary: crash.c calls the un-wrapped invoke_with_pkexec() in update-
  notifier.c, so "Report problem..." fails with "Refusing to render
  service to dead parents".

  Package: update-notifier 3.207.2
  Release: Ubuntu 26.04.1 LTS (resolute), amd64
  Session: XFCE / X11 (XDG_SESSION_TYPE=x11)

  What happens
  ------------

  On a desktop that runs the update-notifier daemon rather than the
  update-notifier-crash.service systemd user unit (XFCE/Xubuntu does this;
  update-notifier-crash.service never starts there), a system crash report in
  /var/crash produces the "System program problem detected" dialog. 

  Clicking "Report problem..." does nothing: no polkit prompt, no apport-gtk window, and
  no pkexec entry in the journal.

  With G_MESSAGES_DEBUG=all update-notifier --debug-misc:

    DEBUG: crashreport_check
    DEBUG: crashreport found running apport now
    DEBUG: fire up the crashreport tool
    DEBUG: invoke_with_pkexec ()
    Refusing to render service to dead parents.

  
  Cause
  -----
  There are two definitions of invoke_with_pkexec(). Only one carries the
  workaround added for LP #1821412.

  src/system-crash.c:40 -- built into /usr/lib/update-notifier/system-crash-notification,
  which is what update-notifier-crash.service runs:

      gchar *command_line = g_strdup_printf("/bin/sh -c '/usr/bin/pkexec %s'",
                                            CRASHREPORT_REPORT_APP);
      g_shell_parse_argv(command_line, NULL, &argv, NULL);
      g_spawn_async(NULL, argv, NULL, G_SPAWN_DEFAULT, NULL, NULL, NULL, NULL);

  src/update-notifier.c:154 -- used by the daemon, called from
  src/crash.c:75:

      argv[0] = "/usr/bin/pkexec";
      argv[1] = (gchar*)cmd;
      argv[2] = NULL;
      g_spawn_async(NULL, argv, NULL, G_SPAWN_DEFAULT, NULL, NULL, NULL, NULL);

  G_SPAWN_DEFAULT does not include G_SPAWN_DO_NOT_REAP_CHILD, so GLib forks an
  intermediate child which forks the real child and _exit()s. The real child is
  reparented to init, and pkexec refuses to run when getppid() == 1.

  
  The /bin/sh wrapper avoids this because dash forks rather than exec-optimising
  here, leaving a live parent for pkexec.

  Measured PPID of the spawned program, same GLib call, same flags:

      argv = {"/usr/bin/pkexec", ...}                    PPID = 1
      argv = {"/bin/sh", "-c", "/usr/bin/pkexec ..."}    PPID = <live dash>
      G_SPAWN_DO_NOT_REAP_CHILD                          PPID = <caller>

  And against pkexec directly, from a long-lived parent:

      g_spawn_async({"/usr/bin/pkexec", "/bin/true"}, G_SPAWN_DEFAULT)
        -> "Refusing to render service to dead parents."   5/5
      g_spawn_async({"/bin/sh","-c","/usr/bin/pkexec /bin/true"}, G_SPAWN_DEFAULT)
        -> reaches authentication                          3/3

  Note: probing with a non-existent target hides the bug. pkexec validates the
  program path before it checks the parent, so "pkexec /nonexistent" reports
  "Error accessing ..." and never reaches the getppid() test.

  
  Suggested fix
  -------------

  Apply the same treatment to src/update-notifier.c:154 as src/system-crash.c:40
  already has, or pass G_SPAWN_DO_NOT_REAP_CHILD (with a child watch to reap).
  src/crash.c:75 is the only caller of that copy across all of src/, so the
  change is contained. (The --force-use-pkexec option sets a static FORCE_PKEXEC
  in update-notifier.c that is never read anywhere -- it looks like dead code,
  unrelated to this.)

  Related
  -------

  LP #1821412 -- Fix Released; introduced the /bin/sh wrapper, but only in
                system-crash.c. The daemon path in crash.c was not covered.
  LP #1823496 -- Confirmed, XFCE 18.04, same "Refusing to render service to dead
                parents" output. Probably the same bug.
  LP #2048914 -- Xubuntu 24.04, same user-visible symptom, diagnosed down a
                different path.
  LP #1947929 -- separate, Wayland-only (crash.c:71 skips pkexec entirely there).

  ProblemType: Bug
  DistroRelease: Ubuntu 26.04
  Package: update-notifier 3.207.2
  ProcVersionSignature: Ubuntu 7.0.0-30.30-generic 7.0.12
  Uname: Linux 7.0.0-30-generic x86_64
  ApportVersion: 2.34.1-0ubuntu0.1
  Architecture: amd64
  CasperMD5CheckResult: pass
  CurrentDesktop: XFCE
  Date: Thu Aug 27 13:07:58 2026
  InstallationDate: Installed on 2026-08-01 (26 days ago)
  InstallationMedia: Xubuntu 26.04 "Resolute Raccoon" - Release amd64 (20260423.1)
  ProcEnviron:
   LANG=en_US.UTF-8
   PATH=(custom, no user)
   SHELL=/usr/bin/zsh
   TERM=tmux-256color
   XDG_RUNTIME_DIR=<set>
  SourcePackage: update-notifier
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/2165313/+subscriptions




More information about the foundations-bugs mailing list