Repository navigation
feat(libkernel): implement kill - #2543
Merged
adriadam10 merged 1 commit intoOct 10, 2026
Merged
Conversation
|
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes. |
ProsperoStore (PPSA99000) imports kill from libkernel and stops at it on current main. Its crash reporter resets a crash signal to SIG_DFL and sends it again with kill(getpid(), signal). kill follows FreeBSD's kern_kill and killpg1 for the only guest process: EINVAL for signals outside 0 to 128, signal 0 only checks the target, and the caller's own pid, 0 and minus its pid deliver through raise. Any other pid, and -1, which skips the caller, report ESRCH.
Collaborator
|
Rebased onto current |
adriadam10
force-pushed
the
feat/libkernel-kill
branch
from
October 10, 2026 09:09
68b7dfd to
9a70477
Compare
This was referenced Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
kill(W0xkN0+ZkCE, libkernel) is missing onmain. ProsperoStore (PPSA99000, the homebrew store) stops at it on currentmain.The call is in the store's crash reporter (crash_report.cpp). It puts the crash signal back to
SIG_DFLand sends it again withkill(getpid(), signal). The import has to resolve before the title can start. The call itself only runs from anSA_SIGINFOcrash handler, andmaindoes not deliver those yet.killfollows FreeBSD'skern_killandkillpg1(kern_sig.c). The guest is the only guest process:EINVAL. This is checked first, askern_killdoes.0(its process group) and minus its own pid go to the caller through the existingraise. So they runsignal/sigactionhandlers, honourSIG_IGNand thesigprocmaskmask, and have the same limits asraise.-1returnsESRCH, because FreeBSD's broadcast skips the caller and there is no other process. Any other pid also returnsESRCH.EPERMis never returned, since there is no other process that could refuse permission. The guest is also assumed to lead its own process group. Both points are in TechnicalDebt next tosigaction.Log
Linux rig (x86-64 Ubuntu, lavapipe, Release), homebrew catalog run of 2026-10-09: ProsperoStore PPSA99000 stops at the unresolved libkernel import
W0xkN0+ZkCE(kill).W0xkN0+ZkCEis the NID ofkill(SHA-1 NID computed withtools/nid_names.py, and it matches zecoxao'saerolib.csv). Nothing else onmainor in an open PR exports it. The closed #2383 only declared it asNotImplemented.With this PR applied, PPSA99000 moves past kill, next stop =
./app.elf: symbol lookup error: ./app.elf: undefined symbol: Mv1zUObHvXI.Tested
aarch64 Debian host. The full project can't be built here because it needs x86-64.
core/libs/tests/GuestKill.cpp(guest_kill, registered for Linux and Windows likeguest_signals):ESRCHfor signal 0 and forSIGTERM, and nothing is delivered;EINVAL, even for a pid that does not exist;SIGTERMreaches asignalhandler through each of the three self targets;SIG_IGNis honoured;raise'sEINVAL.Signals.cpp(Zig 0.17 clang) and it passes. The existingGuestSignals.cppstill passes against the changed file too. Four mutants each fail the test: wrong errno for a missing pid, signal 0 delivering, pid 0 not treated as self, and negative signals accepted.Signals.cppand the test compile for x86_64-linux-gnu and x86_64-windows-gnu with-Wall -Wextra. The only warning is the existing-Wreturn-type-c-linkagefromGeneral.hpp. Both also link into an x86_64 Linux executable and a MinGW.exe. Neither was run here.python3 tools/check_conventions.pypasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)