0.12 — the unit a caller cannot name, and where a permission would have gone - #27
Merged
Conversation
…ve gone Two things a reader had to discover by writing code, and one module that was generated for two versions without ever being imported. **Clause 11 entry 9 now names what it costs.** It already said handles do not cross an address space; it did not say what follows for units. A unit is established by whoever starts a program, at the moment of starting it, so a program cannot name a unit a COPY of itself went on to form — the copy's handle is built from an index into the copy's own table (clause 6.7) and nothing conveys it back.⚠️ The failure this produces is not a refusal: an implementation that meets the dead end is invited to reach for the nearest unit it can name, which is its own. openkal-musl 0.12.0 did exactly that, and every negative identifier that matched no child named the caller's own unit — an enquiry about a unit that did not exist was answered yes, and a signal aimed at one ended the caller together with everything it led. The entry records it so the next implementation meets it here instead. **`kal_fs_open` and `kal_fs_mkdir` now point at entry 6.** The cross-reference existed at `KAL_INFO_IDENTITY` and `kal_fs_lock` — not at the two operations that CREATE, which is where somebody wanting a private file looks. It is a position and not a gap, and the position is WASI's: `fs_rights_base` attaches to a handle and not to a file, and the analogue here is the flag word `open` already takes. **⭐ `openkal.macros` had the defect it was added to prevent.** It exists because a macro does not cross a module boundary, and CI regenerates it and diffs it — which asserts the file is up to date and never asserted that anybody can use it. Nothing in this ecosystem had ever imported it. `macros_reach.cpp` is the first consumer; it runs nothing and fails the build both when a name does not resolve and when a value is wrong.
⚠️ ⚠️ A FALSE RED, AND THE WORST SHAPE A CHECK CAN HAVE: it fired once and passed on a re-run with nothing changed between them. openkal-macos was told `exported name is not in the specification: kal_stdin` --- the twenty-seventh line of SURFACE.txt. `grep -q` exits at the FIRST match, closing the pipe under a `printf` that is still writing. The printf dies of SIGPIPE, and `pipefail` at the top of the file turns that into a failed pipeline, which the `!` inverts into a report that the name is absent. Whether it fires depends on whether the list drains into the pipe buffer before grep exits, so an EARLY match --- the case with the most left to write --- is the likely one. Reproduced deterministically by lengthening the list. Both occurrences become here-strings. The second is in the --complete path, where the same SIGPIPE would UNDER-COUNT what is exported and report a whole interface as half of one --- which is the check that exists to catch exactly that, reporting it about a conforming implementation.
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.
Two things a reader had to discover by writing code, and one module that was
generated for two versions without ever being imported.
Clause 11 entry 9 now names what it costs. It already said handles do not⚠️ The failure this produces is not a refusal: an
cross an address space; it did not say what follows for units. A unit is
established by whoever starts a program, at the moment of starting it, so a
program cannot name a unit a COPY of itself went on to form — the copy's handle
is built from an index into the copy's own table (clause 6.7) and nothing
conveys it back.
implementation that meets the dead end is invited to reach for the nearest unit
it can name, which is its own. openkal-musl 0.12.0 did exactly that, and every
negative identifier that matched no child named the caller's own unit — an
enquiry about a unit that did not exist was answered yes, and a signal aimed at
one ended the caller together with everything it led. The entry records it so
the next implementation meets it here instead.
kal_fs_openandkal_fs_mkdirnow point at entry 6. The cross-referenceexisted at
KAL_INFO_IDENTITYandkal_fs_lock— not at the two operationsthat CREATE, which is where somebody wanting a private file looks. It is a
position and not a gap, and the position is WASI's:
fs_rights_baseattachesto a handle and not to a file, and the analogue here is the flag word
openalready takes.
⭐
openkal.macroshad the defect it was added to prevent. It existsbecause a macro does not cross a module boundary, and CI regenerates it and
diffs it — which asserts the file is up to date and never asserted that anybody
can use it. Nothing in this ecosystem had ever imported it.
macros_reach.cppis the first consumer; it runs nothing and fails the build both when a name
does not resolve and when a value is wrong.