[BUG] Native thread admission omits the initial lifetime charge #40
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/posixd#40
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Posixd does not count the initial thread against a client's native capacity.
With capacity 2 and one additional member, a second creation can reach Kernel
if the realm has spare rows. Kernel refuses it correctly; Posixd retains that
native error and stops ordinary service instead of returning EAGAIN.
Reproduction
Apply the new independent quota regression control to Posixd
b049eb0e6530dedec8dbd6eb5245d63dca2c1a5b, then run:The control supplies two clients with capacity 2 and spare realm storage.
Create one member, retire its creator call, then request a second member from
the same client. Its independent backend enforces Kernel's initial-inclusive
quota; the original implementation fails deterministically.
Expected and actual behavior
Return EAGAIN before any destination query, row reservation or native operation.
Preserve all generations, existing owners and the other client's capacity.
Instead, Prepare returns
NativeStatus(7)(RESOURCE_EXHAUSTED), and ordinaryservice freezes. The control exits 101 with
0 passed; 1 failed.Environment and identity
Rust 1.93.0 on x86_64 Linux; this is a host regression, with no guest execution.
Kernel
3f9ba9cd357bcd4474e24e1d9cc62e83891b9dabcharges the initial memberthrough its process lifetime. Original CLAIM/factory/member custody remains
explicit; requests carry no authority selectors. No earlier working revision
of ordinary native creation is known.
Evidence and prior checks
Kernel's actual-object preparation controls independently establish that capacity
1 allows no additional member. The new controls cover spare global rows,
capacity 1, an outstanding reservation and the peer's separate quota. They
compare native effects and counted generations before and after refusal.
Tracking
Correct Posixd admission while retaining Kernel's quota checks and the initial
lifetime charge through thread-only departure. Related: ordinary creation,
native lifetime and
Phase 6.
The fix counts the initial lifetime charge before any native effect. Spare realm rows, capacity 1, outstanding reservations and the peer quota are covered by the independent regression controls. The initial charge survives thread-only departure.