Repository navigation
0.7.2: a copy of the program ends as the copy ends itself - #45
Merged
Merged
Conversation
A library composes fork by starting a context in a copy of the address space (openkal.space); the copy holds the runner's memory, its task that waits for the requests to end recorded there, and not the task. Under 0.7.1 the copy's kal_exit asked that task to return and waited for it, which in the copy never happens: a program an image started by fork and exec never ended (Sunrisepeak/cmd#5, runs 44656971316 and 44657977619). The runner records the program its task belongs to, as the implementation identifies it (kal_process_self, kal_process_info), and compares the program it runs in when it would stop watching and when the image takes the requests over: in a copy nothing is joined, and the image's requests to end are its own. An identity either side cannot read keeps 0.7.1's answer. examples/forks starts a context in a copy whose kal_exit(7) ends it; CI expects `forks: 7' on Linux within 60 s. Measured locally (Linux x86_64): the 0.7.1 runner printed nothing until the limit ended it, this one prints `forks: 7' at once. Every member is 0.7.2; a release's programs are built over openkal-platform 0.31.2.
Sunrisepeak
added a commit
to mcpplibs/mcpp-index
that referenced
this pull request
Nov 20, 2026
…lf (#852) openkal-ld, openkal-run, openkal-tools and openkal-bind 0.7.2: one tag and one archive (mcpplibs/openkal-image#45). A library composes fork by starting a context in a copy of the address space; under 0.7.1 the copy's kal_exit waited for the runner's task, which the copy does not hold, and a program an image started by fork and exec never ended (mcpplibs/openkal-image#44).
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.
Fixes #44.
A library composes
forkby starting a context in a copy of the address space (openkal.space). The copy holds the runner's memory, including its record of the task that waits for the requests to end, and not the task, which belongs to the program that was copied. Under 0.7.1 the copy'skal_exit(own_kal_exit→stop_watching) asked that task to return and waited for it, which in the copy never happens: a program an image started by fork and exec never ended (Sunrisepeak/cmd#5, runs 44656971316 and 44657977619).The change
run/src/waits.cpp: the runner records the program its task belongs to, as the implementation identifies it (kal_process_self,kal_process_infowithKAL_PINFO_ID), and compares the program it runs in where it would stop watching and where the image takes the requests over. In a copy nothing is joined, and the image's requests to end are its own (since 0.7.0 a copy that took them over was given the runner's word, which no task of the copy counts). An identity either side cannot read keeps 0.7.1's answer.examples/forks: an image that starts a context in a copy of itself whosekal_exit(7)ends the copy. CI builds it with the other examples and expectsforks: 7on Linux within 60 s, so a copy that does not end fails the check rather than hanging it.release-binaries.yml).Measured
Locally, Linux x86_64, the tools built by mcpp 2026.11.18.1 from this tree with and without the change:
okrun forks.okewaits.cpptimeout 20ended it (124)forks: 7, status 0, at oncexim's okrun
latestis held at 0.6.4 meanwhile (openxlings/xim-pkgindex#1205).