Error kinds and units
The error record of a call that failed holds a kind, a unit, and values. 40 kinds and 62 units.
Kinds
What is wrong. The meaning of value, limit and found for each kind:
A kind names the class of the mistake, and the unit names what the values count. The comment of each member gives what
value,limitandfoundhold, and which calls give it. A kind that is not in this list is "unknown" to a reader (kind_known). The page "Error kinds and units" of the site shows this table.
The comment above Kind in src/library/modus/contract/errors/errors.odin.
| Number | Kind | What value, limit and found hold |
|---|---|---|
| 0 | None | No error: the record of a call that did not fail is all zero. |
| 1 | Empty | A text argument has no byte. limit: the most that it can have. Given by the storage service and by the HTTP server (src/modules/demonstrations/server) for an empty name, and by QUIC. |
| 2 | Too_Long | value: the size of the argument; limit: the most that it can have. The unit names what the size counts: Words for a word wait, Bytes for a name of the storage service or a frame of the frame service. |
| 3 | Too_Small | value: the size of the argument; limit: the least that it must have. The kernel gives it for a report buffer below the size of its report (Inspect), and for a count of 0 where one is needed. The block, frame and network services give it for a buffer too small for one block or frame. |
| 4 | Bad_Value | value: a value that the call refuses; limit: the largest value that it takes, or 0 when the sentence gives no range; found: 0, or the part of the argument that the call refuses, as the call numbers its parts (Thread_Control: op.Thread_Write_Refusal). The general kind for a number out of its range or with no meaning: a level of the log, a weight of a thread, a setting that names no value, a command of the terminal ring. |
| 5 | Bad_Flags | value: the flags; limit: the flags that the call knows. The kernel gives it for Memory_Create, Memory_Map, Memory_Commit, Memory_Protect and Fault_Handler_Set with a flag or a kind that it does not know, or with two flags that do not go together. |
| 6 | Bad_Byte | value: the offset of the byte in the text; found: the byte. A name or a text holds a byte that the call refuses: the storage service for a byte 0 or / in a name, or a name . or .., the HTTP server for a byte that a name of a page cannot hold. |
| 7 | Bad_Address | value: the address; limit: the count of bytes; found: 1 when the call writes there. The kernel gives it with the status Bad_Address: the process cannot read, or write, the bytes that an argument names. |
| 8 | Handle_Absent | value: a number that names no handle of the caller. With the unit Lent_Handles: in an isolated call, the handle did not come through the call ring. |
| 9 | Handle_Ended | value: the handle; found: an End. The handle named an object once: it was closed or revoked. The kernel gives it with Bad_Handle. |
| 10 | Handle_Kind | value: the handle; limit: the kind of object that the call needs; found: the kind of its object (op.Object_Kind). The kernel gives it with Bad_Handle: for example a memory handle given to Process_Start. |
| 11 | Handle_Rights | value: the handle; limit: the rights that the call needs; found: the rights of the handle (op.Rights). The kernel gives it with No_Right. Both sets are op.Rights as integers. |
| 12 | Budget | value: the handle of the budget; limit: what the call asks; found: what the budget holds. The kernel gives it with No_Budget when the handle has Read. The unit names the amount: Pages, Processes, Threads, Processor or Log_Records. |
| 14 | Over_Limit | value: what the call makes; limit: the limit. Unit Blocks (the storage service): the blocks of the current objects with the change, with no earlier version kept. The kernel gives it for Log above the records of the second (Log_Records). The network service gives it with Bytes when a send passes the limit of the address check; the remote service with Milliseconds when a call passes its time limit. |
| 15 | Full | A table has no free place. limit: its capacity. The unit names the table: Handles, Mappings, Threads, Modules, Interrupts, Places, Connections, Principals, Commit_Blocks. Another try can pass after a place frees. |
| 16 | State | value: the handle; found: the op.Process_State of its object, or 0 when the handle has no right Read. The kernel gives it with Bad_State: the process is stopped, or not started yet. A service gives it for a connection or a stream that is not in the state of the command. |
| 17 | Absent | No object has the name or the number of the argument. found: 0, or the number from 1 of the row of a table argument that names it. The unit names what is absent: Objects or Trees (a name of the storage service), Places, Versions, Principals, Region, a setting, a host of the network. |
| 18 | Damaged | The object of the argument exists, and a block of it has a wrong check. The storage service gives it when a block of an object or of a tree does not match its hash. With the unit Counts: the counts of the blocks are not trusted after a fault of the service. |
| 19 | Device | A device reported an error. found: the status of the device. The storage service gives it when the block service failed a read or a write. With the unit Dropped_Writes, the device answered Ok and did not keep a write: the read back of the commit found it. |
| 20 | No_Grant | The caller has no grant for this call: the unit says which grant. Given by a service: the storage service (Store, Changes), the root service (Root_Commands, Acts_For_Principal), the compositor (Display), the terminal (Terminal), the network service (Endpoint, Connection). The fix is a grant from the starter of the process, not another call. |
| 21 | Malformed | The module of the argument breaks a rule of the module format. value: the kind of the problem; found: the byte of the file. Given by the loader of src/library/modus/system and by the process manual. Also by system.ring_open with argument 1: the header of a ring is not one that ring.open takes. |
| 22 | No_Target | value: the handle of a memory object that names no one other process to receive the handle. The kernel gives it for Handle_Give whose target is a memory object that no one other process maps or holds. |
| 23 | Overlap | value: an address, or with the unit Region an offset in the call region of an isolated call; limit: the count of bytes. They overlap something that the process has, or another argument of the call that is written. The kernel gives it for Memory_Map at an address that another mapping holds, for Process_Module over another module record, and for Memory_Commit with ranges that overlap. |
| 24 | Unknown_Operation | value: the number of the operation. The kernel gives it for a command record whose kind is 0 or above the last op.Operation; limit is the last operation. |
| 25 | Refused | The call refused, and gives no more detail. found: the status (op.Status for the kernel, and with the unit Kernel_Status). The last resort of a callee that has no better kind: a reader names the status in words with the unit Kernel_Status, and keeps any other status on the detail lines. src/library/modus/system gives it for a kernel call whose answer has another tag than its command, or is absent. |
| 26 | No_Answer | No answer before the time limit. value: the IPv4 address that did not answer, or 0; limit: the milliseconds waited; found: the word of an Unanswered, what did not answer. The network service gives it, with the unit Milliseconds. The block service gives it with Device for each request in flight when the device did not answer one by its deadline or needs a reset; the storage service then refuses each call that needs the disk with the kind Device. |
| 27 | Unsupported | The receiver does not do this command. value: the command, or the field that it does not do. Given by the block and frame services for a command that the device does not have, by the network service, the root service and QUIC. The kernel gives it with Bad_Operation for Guest_Run on a machine whose processors have no virtualization support that it uses: value is the operation. |
| 28 | Link_Down | The link of the network device is down. The network service gives it for a send while the device reports no link. |
| 29 | Busy | Too many requests are in flight. value: the requests in flight, or 0 when the receiver does not count them; limit: the most. The block, frame and network services give it, with the unit Requests. Another try can pass after a completion. src/library/modus/system gives it with Bad_Operation and limit 0 for a kernel call on a kernel ring that holds a command or a completion: its command does not run. |
| 30 | Out_Of_Range | The argument names units past the end. value: the end of what it names (its first unit and its count); limit: the units that exist; found: 0, or the number from 1 of the record of a table argument that names them (a record that names bytes of another argument by an offset). The services of rings give it for a place and a count past the end of their data region (the unit Bytes), and the storage service for a range past the end of an object. See: Module contract: Tables and bytes as parameters |
| 31 | Reserved | The argument names a process of the system that the call does not act on: it starts at boot, or it is a device service. The root service gives it for Start or Stop of such a process. |
| 32 | Not_Payer | value: the handle of a budget that does not pay for the memory object of the call. It says nothing of the budget. The kernel gives it for Memory_Commit with a budget that is not the budget of the object. |
| 33 | Object_Shared | value: the handle of a memory object, or 0; the call needs an object that only this process names, with one mapping at most. The kernel gives it for a decommit (Memory_Commit) and for Memory_Protect on an object that another handle or another mapping names. |
| 34 | Object_Marked | value: the handle of a memory object; found: its pages with a protection of their own. The object is not mapped again and not given. The kernel gives it for Memory_Map and Handle_Give of an object that Memory_Protect changed. |
| 35 | Whole_Only | value: an address; limit: the bytes of the range. The range is a part of a mapping whose protection changes only whole (device memory, large pages), or of an area that the system keeps (a thread area). The kernel gives it for Memory_Protect. |
| 36 | Not_Multiple | value: the argument; limit: the number that it must be a multiple of; found: the rest. The kernel gives it for Memory_Create with Large_Pages and a count that is not a multiple of 512. |
| 37 | Not_Authentic | The bytes of the argument do not prove what they must: the tag of a sealed text, or a signature, does not verify. No byte of the result is given. The cryptography module gives it for an open of a sealed text, and QUIC for a packet or a handshake that does not verify. See not authentic. |
| 38 | Seed_Too_Weak | The random seed of the process is weaker than the least strength that the caller accepts. value: the word of the op.Seed_Strength of the seed; limit: the word of the least strength asked. Nothing is made. random.fill_for_a_key gives it when the seed of the generator has a lower Seed_Strength than the call asks. A plain draw (random.fill) never gives it. |
| 39 | Exists | The name of the argument names something that exists already, and the call makes a new one. found: 0, or the number from 1 of the row of a table argument that names it. The storage service gives it for a new tree or object at a name in use. |
| 40 | Starter_Module | value: the address that the call names; limit: the base of a module record that the starter of the process wrote (op.Module_Writer.Starter); found: its size in bytes. The kernel gives it with No_Right for Process_Module, Memory_Map and Memory_Unmap of a process in itself over that record: only a holder of its process handle changes it. |
Read from src/library/modus/contract/errors/errors.odin.
Units
What value, limit and found count.
With the kinds
No_Grant,Absent,DamagedandHandle_Absentthe unit names instead the grant, the table or the thing that the kind is about: the comment of each member says so.UNIT_NAMESgives the words that a sentence uses for each unit.
The comment above Unit in src/library/modus/contract/errors/errors.odin.
| Number | Unit | In a sentence | What the contract says |
|---|---|---|---|
| 0 | None | The values are plain numbers, or the kind gives them their meaning. | |
| 1 | Bytes | bytes | Bytes of memory, of a file or of a text. |
| 2 | Pages | pages | Pages of 4096 bytes. |
| 3 | Blocks | blocks | Blocks of a disk or of a store. |
| 4 | Objects | objects | Objects of a store. |
| 5 | Stores | stores | Stores of the storage service. |
| 6 | Processes | processes | Process slots of a budget. |
| 7 | Threads | threads | Thread slots of a budget, or the threads of a process. |
| 8 | Handles | handles | The handle table of a process. |
| 9 | Mappings | mappings | The mappings of a process (op.MAPPING_REPORT_CAPACITY). |
| 10 | Modules | modules | Module records of a process. |
| 11 | Words | words | The words of one word wait. |
| 12 | Log_Records | log records in one second | Log records in one second. |
| 13 | Processor | microseconds of processor time in one second | Microseconds of processor time in one second. |
| 14 | Budgets | budgets | Budgets of the kernel. |
| 15 | Interrupts | interrupts | Message interrupts (op.MESSAGE_CAPACITY). |
| 16 | Memory | memory objects | Memory objects of the machine. |
| 17 | Store | a private store | No_Grant: a private store. |
| 18 | Acts_For_Principal | to act for the principal | No_Grant: to act for the principal whose session the caller belongs to. |
| 19 | Records | records | Records of a table argument: ranges, rules, rows. |
| 20 | Connection | a connection to this service | No_Grant: a connection to the service. |
| 21 | Milliseconds | milliseconds | A time: a time limit or a time waited. |
| 22 | Connections | connections | The records of a TCP connection table (src/library/modus/tcp). |
| 23 | Tcp_Ports | local TCP ports | The local TCP ports of a client grant. |
| 24 | Requests | requests in flight | Requests in flight. |
| 25 | Endpoint | a remote address and port | A remote of the network: an IPv4 address and a port, in one value (endpoint_pack). No_Grant: value the remote that the call names, limit the remote of the grant (0: none), found the local port when it is not a port of the endpoint. |
| 26 | Region | a data region | Absent: the data region of a ring. Overlap: bytes of the call region of an isolated call; value is their offset, limit their count. |
| 27 | Root_Commands | the commands of the root ring that change other processes | No_Grant: the commands of the root ring that change other processes. |
| 28 | Services | services that run | Services that run. |
| 29 | Grants | grants of the process | The grants of a process (system.Root_Grant). |
| 30 | Display | a surface on the screen | No_Grant: a surface on the screen (the ring to the compositor). |
| 31 | Terminal | a terminal | No_Grant: a terminal (the terminal ring and the text region). |
| 32 | Lent_Handles | handles lent for this call | Handle_Absent: the handle did not come through the call ring for this call (an isolated call). |
| 33 | Versions | versions of the object | Absent: the versions of an object (value: the generation that the argument named). |
| 34 | Counts | the counts of the blocks of the store | Damaged: the counts of the blocks of a store are not trusted after a fault of the service; it makes no change in the store. |
| 35 | References | names of one block | Over_Limit: the names of one block, which a count holds. |
| 36 | Commit_Blocks | blocks that one commit can change | Full: the blocks that one commit can change or write. |
| 37 | Principals | named principals | The named principals of the root service. Full: limit the named principals that it holds; Absent: no such principal, or no session runs. See: Principals |
| 38 | Places | places of the connection | The places of a connection to the storage service: Absent, the number names no place of the connection, or the tree of the place was removed or renamed; Full, the table of places. See: Storage |
| 39 | Trees | trees | Absent: the name names no tree. Bad_Value: a tree would move inside itself. |
| 40 | Changes | a change of the store (the connection reads only) | No_Grant: a change of a store; the connection reads only. |
| 41 | Pending | pending changes of the object | The pending changes of an object in the storage service. Full: limit the blocks that the service holds for them. Absent: the object has no pending change on this connection; found 1: another change of the object came first, and its pending changes are dropped. See: Storage: Ranges |
| 42 | Debug_Objects | debug objects of the modules of the process | Absent: the debug objects of the modules of a debugged process; no one describes the module of the address. See: Developer tools: The debugger |
| 43 | Breakpoints | breakpoints of a thread | The breakpoints of a thread. Full: limit the breakpoints that a thread has (op.THREAD_BREAKPOINT_CAPACITY). Absent: the number names no breakpoint of the debugger. |
| 44 | Held_Threads | threads that the debugger holds | Absent: the threads that the debugger holds; the thread of the argument runs, or the process has no thread with this number. |
| 45 | Debugged_Processes | processes that the debugger service debugs for this caller | The processes that the debugger service debugs. Absent: the caller attached to none. Full: the service debugs a process for another caller; limit the processes that it debugs at one time. |
| 46 | Readable_Variables | variables that are readable at this instruction | Absent: the variables that are visible and readable at the instruction of a frame; the name of the argument is none of them, or its location is not readable there. |
| 47 | Debug_Access | the debug access to this process | No_Grant: the debug access to a process. found: 0, or 1 + the number of the start grant of the process that refuses it (start_grant.Grant); a sentence writes the name of that grant. |
| 48 | Stack_Frames | frames of the stack of the thread | Absent: the frames of the stack of a held thread; the number of the argument is past the last frame. |
| 49 | Source_Places | procedures and source lines of the debug objects | Absent: the procedures and the source lines of the debug objects; the place of the argument names none. |
| 50 | Stop_Reports | stop reports of disk processes that the root service keeps | Absent: the stop reports of disk processes that the root service keeps; no disk process of the principal of the caller with this nickname stopped on a fault, or newer reports took its place. See: The debug object of a disk process in the repository |
| 51 | Versions_Erase | the erase of the versions of an object | No_Grant: the erase of the versions of an object (the start grant Versions_Erase). See: Storage: The erase of versions |
| 52 | Dropped_Writes | blocks that the disk did not keep | Device: the blocks of a commit that the disk answered with Ok and did not keep; found: their count. The storage service refused the commit. See: Storage: The commit and the open |
| 53 | Nanoseconds | nanoseconds | A time of the system clock, or a span of it, in nanoseconds: the time of a record of a timed stream (src/library/modus/contract/timed_stream). |
| 54 | Frames | frames | Frames of a timed stream: one sample of each channel (src/library/modus/contract/timed_stream). |
| 55 | Record_Types | record types of the two ends of a wiring | Bad_Value: the record descriptions of the two ends of a wiring differ (src/library/modus/contract/output, record_descriptions_compare). value: the Description_Difference; limit: the first field that differs, from 1, or 0 for the record; found: the row of the wiring list. |
| 56 | Wiring_Rows | rows of the wiring list | Bad_Value: a row of a wiring list. argument: the field, from 1 (output.Wiring_Field); value: the word; limit: the largest word there; found: the row from 1, or 0 for the list as a whole. |
| 57 | Wiring_Terms | bytes of the wiring terms | Bad_Value or Out_Of_Range: the wiring terms of a row. value: their count of bytes; limit: the size of their description, 0 for a record input that takes none; found: the row. |
| 58 | Wirings | wirings of the root service | The wirings of the root service. No_Grant: the asker did not start the process of the end, or does not act for the principal of the connection. Busy: the wiring ring of a process has no room, limit its capacity. Bad_Value: one process at both ends. found: the row. |
| 59 | Input_Histories | input history of the debugged process | The input history of the process that the debugger service debugs. Absent: the debugger started no record of it, or no record runs. Full: a record or a replay of it runs already. Out_Of_Range: value the input points of a step back, or the point before which a watch back looks, limit the input points of the history. Bad_Value: the module of the boot image is not the module of the history. Damaged: the header of the history is not a valid header. See: Record and replay of a process in the repository |
| 60 | Checkpoints | checkpoints of the recorded process | The checkpoints that the debugger service keeps of a recorded process. Absent: no checkpoint is at or before the input point that a step back names. Exists: a checkpoint is at this input point, or at a later one, already. See: Record and replay of a process in the repository |
| 61 | Recorded_Writes | writes of the input history | Absent: no input of the history before the point wrote a byte of the range of a watch back. value: the address; limit: the count of bytes; found: the point, 0 for the whole history. See: Record and replay of a process in the repository |
| 62 | Kernel_Status | status of the kernel | Refused: a kernel operation inside the call refused, and found is its op.Status, which a sentence names in words. |
Read from src/library/modus/contract/errors/errors.odin.
Error_Record struct
A struct of the package errors: 56 bytes, aligned on 8 bytes, 0 bytes of padding. The error record: what a call that failed says about why, as seven integers.
kindi6408 bytesuniti6488 bytesoperationi64168 bytesargumenti64248 bytesvaluei64328 byteslimiti64408 bytesfoundi64488 bytes
Pages type of the package manual_pages
Pages :: struct {...}
A valid file: the reads below take it.
src/library/modus/contract/manual_pages/manual_pages.odin:78
Terminal type of the package terminal_records
Terminal :: struct {...}
A terminal, as the process that writes sees it.
ring_open procedure of the package system
ring_open :: proc "contextless" (memory: Handle, error: ^errors. = nil, receive_handles := false) -> (mapped: ring.Ring, status: Status)
ring_open maps the memory of a ring in this process.
open procedure of the package ring
open :: proc "contextless" (memory: rawptr, page_count: u64) -> (ring: Ring, ok: bool)
open gives the ring in mapped memory of page_count pages.
fill_for_a_key procedure of the package random
fill_for_a_key :: proc "contextless" (generator: ^Generator, output: []u8, least_strength: Seed_Strength, error: ^errors.) -> bool
fill_for_a_key writes random bytes in output for a key, a nonce or.
fill procedure of the package random
fill :: proc "contextless" (generator: ^Generator, output: []u8)
fill writes random bytes in output.
UNIT_NAMES global variable of the package errors
UNIT_NAMES := [Unit]string {...}
The words of each unit in a sentence: "the budget holds 10 pages".
