Public bug reported:

libpulp 0.3.16-1 fails to build from source on amd64 and amd64v3 in 
stonking-proposed (and previously resolute):
https://launchpad.net/ubuntu/+source/libpulp/0.3.16-1
Build log (amd64): 
https://launchpad.net/ubuntu/+source/libpulp/0.3.16-1/+build/32793489/+files/buildlog_ubuntu-stonking-amd64.libpulp_0.3.16-1_BUILDING.txt.gz

libpulp has never built in Ubuntu: every upload since 0.2.2 (plucky) has
stayed in -proposed.

The test suite fails: 34 FAIL + 1 ERROR out of 59 (17 PASS, 5 SKIP, 2
XFAIL). Every failing/erroring test hits the same refusal from the ulp
tool:

  ulp: System has 'ptrace_scope' enabled. Please become root or disable it by 
setting:
  $ echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

Cause: this is a build environment difference, not a code bug. libpulp
live-patches running processes via ptrace; the tests start a target and
run 'ulp trigger -p <pid>' against it as a sibling process. Launchpad
builders run Ubuntu kernels with kernel.yama.ptrace_scope=1 (only
descendants may be traced), and ulp additionally checks this up front
(check_ptrace_scope() in tools/ptrace.c, called from tools/ulp.c) and
exits with EPERM unless ptrace_scope is 0 or it runs as root. Debian
builders have ptrace_scope 0 / no Yama, so the package builds there. The
17 passing tests are those that do not need ptrace.

Proposed fix: in debian/rules, only skip the test suite where it cannot
work (ptrace_scope > 0 and not root); it still runs on Debian buildds,
on ptrace_scope=0 systems and when building as root:

--- rules.orig  2026-09-30 09:17:43.387802799 +0200
+++ libpulp-0.3.16/debian/rules 2026-09-30 09:17:43.398803154 +0200
@@ -3,6 +3,19 @@
 %:
        dh $@ --with autoreconf
 
+# The test suite live-patches sibling processes with ptrace, which ulp
+# refuses to do (and the kernel would deny) when Yama ptrace_scope is > 0
+# and we are not root, e.g. on Launchpad builders. Skip it there.
+PTRACE_SCOPE := $(shell cat /proc/sys/kernel/yama/ptrace_scope 2>/dev/null || 
echo 0)
+
 # Use of -fcf-protection with to-be-patched libraries breaks live-patching.
 override_dh_auto_test:
+ifeq ($(PTRACE_SCOPE),0)
        dh_auto_test -- CFLAGS=-fcf-protection=none
+else
+       @if [ "$$(id -u)" = 0 ]; then \
+               dh_auto_test -- CFLAGS=-fcf-protection=none; \
+       else \
+               echo "W: kernel.yama.ptrace_scope=$(PTRACE_SCOPE) and not root; 
skipping tests"; \
+       fi
+endif

Checked: with ptrace_scope=1 and a non-root user the target prints the
skip warning; with PTRACE_SCOPE=0 it still runs dh_auto_test. A full
package build has not been done.

This drops live-patching test coverage from Ubuntu builds. To keep it,
add an autopkgtest (debian/tests/control with Restrictions: needs-root,
isolation-machine) that runs the test suite as root in a VM; the package
currently has no debian/tests.

Alternatives: upstream (SUSE/libpulp) could make the test target call
prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY) and make ulp try to attach and
report the real EPERM instead of refusing in advance. The debian/rules
change could also be offered to Debian, where it is harmless, so Ubuntu
can go back to syncing.

** Affects: libpulp (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: stonking update-excuse

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

Title:
  libpulp FTBFS on Launchpad: test suite needs ptrace of sibling
  processes, denied by Yama ptrace_scope=1

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libpulp/+bug/2168960/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to