🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #5163

Bug#1154521: procps: pkill dies with SIGILL on hurd-i386 (raw syscall() with Linux pidfd_open number)

#5163
From: eirikr
Date: Thu, 19 Nov 2026 23:10
76 lines
5857 bytes
Package: procps
Version: 2:4.0.7-1.1
Severity: important
User: debian-hurd@lists.debian.org
Usertags: hurd

Dear Maintainer,

On hurd-i386, pkill from procps 2:4.0.7-1.1 terminates with SIGILL (exit
status 132) as soon as it matches a process, and the matched process
receives no signal. pgrep, and pkill with no match (exit status 1), work.

Reproduction (hurd-i386, GNU Mach 1.8+git20261028, hurd
1:0.9.git20261028-4, libc0.3 2.43-7~hurd.1):

  $ sleep 600 &
  $ pkill -x sleep; echo $?
  Illegal instruction (core dumped)
  132
  $ pkill -0 -x sleep; echo $?        # signal number does not matter
  Illegal instruction
  132

gdb stops in glibc's syscall() with the Linux pidfd_open number in eax:

  Thread 2 received signal SIGILL, Illegal instruction.
  syscall () at ../sysdeps/mach/i386/syscall.S:25
  eax  0x1b2  434
  => <syscall+10>: pop %ecx         (the instruction after lcall $7,$0)

Mechanism, from source:

1. Since upstream commit f8d36fd3 ("pgrep: use pidfd_send_signal",
   first released in 4.0.6), pkill calls pidfd_open() for every matched
   process (src/pgrep.c, 4.0.7 line 1422). In 4.0.4 and 4.0.5,
   pidfd_open() was used only by pidwait, which is not built here.
2. When HAVE_PIDFD_OPEN is undefined, as on the Hurd, src/pgrep.c
   defines SYS_pidfd_open as 434 (544 on alpha) and calls
   syscall(SYS_pidfd_open, ...). pidfd_send_signal() (424) and
   process_mrelease() (448) take the same route.
3. On i386, glibc's sysdeps/mach/i386/syscall.S makes the call a Mach
   trap: it loads the number into eax and executes lcall $7,$0.
4. GNU Mach's syscall_native (i386/i386/locore.S) negates eax; a
   positive number goes to mach_call_range, which raises
   T_INVALID_OPCODE. glibc's sysdeps/mach/hurd/x86/exc2signal.c maps
   EXC_BAD_INSTRUCTION to SIGILL.

execute_kill() in src/pgrep.c already falls back to kill() when
pidfd_send_signal() fails with ENOSYS. A local test build in which the
three helpers set errno to ENOSYS and return -1 when __linux__ is
undefined restores pkill (it exits 0 and the sleep is killed). I mention
this only as evidence of the mechanism; whether the guard belongs in
procps or in glibc's Hurd syscall() is for you and the porters to judge.

The crash is the same under KVM and under QEMU's TCG emulator, so it
does not depend on the virtual CPU.

hurd-amd64 (procps 2:4.0.7-1.1, libc0.3 2.43-7) does not crash. pkill
calls syscall() there with the same number 434, but glibc has no
sysdeps/mach/x86_64/syscall.S, so x86_64 Hurd uses the generic
misc/syscall.c stub: it sets errno to ENOSYS and returns -1, and pkill
falls back to kill().

The stock package was tested directly (procps_2:4.0.7-1.1_hurd-i386.deb,
sha256 9a91f2396a885d454f8b5ca981071b27295f2dc85d18c7c69fe31b89256e9b51),
extracted beside the installed system. Both it and the test build link
libproc2.so.1. I found no existing report in the BTS or upstream;
upstream #352 concerns the 4.0.4 build failure that introduced the
numeric fallback.


-- System Information:
Debian Release: forky/sid (debian-ports snapshot 20261114T183112Z)
Architecture: hurd-i386 (i686-AT386), QEMU guest (KVM and TCG)
Kernel: GNU 0.9 GNU-Mach 1.8+git20261028-up-486/Hurd-0.9
hurd 1:0.9.git20261028-4, libc0.3 2.43-7~hurd.1
Technical Details
Message-ID: <O1jqp-cYtq-3@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: eirikr <hilga007@gmail.com>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1154521: procps: pkill dies with SIGILL on hurd-i386 (raw syscall() with Linux pidfd_open number)
Date: Fri, 20 Nov 2026 00:10:01 +0100
Message-ID: <O1jqp-cYtq-3@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <submit@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Thu Nov 19 23:01:08 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -0.298
Reply-To: eirikr <hilga007@gmail.com>, 1154521@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: csmall@debian.org
X-Debian-Pr-Message: report 1154521
X-Debian-Pr-Package: procps
X-Debian-Pr-Source: procps
X-Gm-Message-State: APuU4Z/Z6JqJPSm4MPhTJhOG9ga+krBH30wbRFHuqqc2Y1i+oSBS//2i
	HyLly2obt2FBNq2dUzXMf63AyBw1jVr5OOIihYJnkE2ThEN6yWd/+Ko0ctYE5wH8
X-Gm-Gg: AYBFou0Oq1hWu36k846mokq9rtYn4JK46hcrsR6Pz/qT1QiJwtiON/Sr7fCFz7H9wmZ
	Ve7YF8es0Yfh2VcxKY0gieKstezfV5r2iXX9Alo6ohlawj4UMvyGLf5kYulqDIWdqgwn7epeNJQ
	mkRAsZl/Sr4+nufvIs2VbUbodq1raIRxQaxuK+JcMUIer1I3ffe6EbGx9hwRn/0lEjlX5xvA6JT
	eAGOKXPdX4Zps9S/gAiPNX7UteGeUGs2wpu2hKW9ZYMNhYGbeSrnq63UUg4p+o5hkWHv/+UDvZE
	AfPZ6puRcKcZcEbND5ifqbaL2oLeaUVIRS445UTsqYj0k6iuZj5nenlV1n3y/3BybsS5fngRQZK
	zdT0UMlPx2FulxBX+ZBSLkDWCJ2vjAgNoB/bHyGC/w1wsw/zoLckMJen5g18QlkJtq+/rptlFL/
	84hPLwXP1g9xL0Mi/M/W5nZdk5Ni+SG9NRRYiGAc6gO/DmnvcVHZRJ/I8Pp0KCdlIWfD3lxi7zz
	Fszck4fvaM4hbemi2ZnJ1qglObjFoV6vX2Vu4qmuCYn8C41A90yDoqTIZm+GjnVB46601eeZYKa
	UZTMgb6qeOTFc+M8W4h04Q==
X-Received: by 2002:a05:6820:a743:20b0:6df:d73a:1267 with SMTP id 006d021491bc7-71b394b3b07mr866835eaf.40.1795129173619;
        Thu, 19 Nov 2026 14:59:33 -0800 (PST)
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Mailer: reportbug 13.2.0+ubuntu1
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2003639
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 76
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Thu, 19 Nov 2026 14:48:06 -0800
X-Original-Message-ID: 
 <179512848629.1128510.10771581194882791141.reportbug@ALIENWARE.localdomain>