SysvMessageExceedsReceiveCapacity
warning native on by defaultGroup: Probable bugs
Identify msg_receive whose positive maxsize is smaller than byte length of proven same-queue same-type successfully sent nonserialized constant string, without MSG_NOERROR. Serialized or competing messages exclude.
Detection
- Report msg_receive whose positive maxsize is smaller than byte length of proven same-queue same-type successfully sent nonserialized constant string, without MSG_NOERROR. Serialized or competing messages exclude.
- Resolve builtin functions, classes, constants and methods, including imports and supported named arguments. Follow only bounded local facts within one lexical scope. Receiver and argument provenance must establish the specific API contract; variable names and comments never prove intent.
- Report one finding per violating operation. A reachable path, unchanged value identity and applicable API behavior are required. Intervening mutation, unknown calls involving tracked values, escaped aliases or exhausted analysis budgets invalidate proof.
- D4. A variable read for the capacity, the receive flags, either message type, the sent payload or the serialize flag is proven only while its assigned literal still holds. An increment or decrement of that variable, or a closure capturing it by reference, placed before the read or anywhere in a loop that repeats the read, makes the value unknown:
$size = 9; $size++;gives a capacity of 10, not 9.
Exceptions (no report)
- Exclude unresolved required symbols, user-defined lookalikes, incomplete syntax, unknown required values and unsupported versions.
- No report when D4 makes any required value unknown. A step placed after the receive and outside every loop around it, a by-value closure capture and plain reads leave the value proven.
- Both
@custos-ignore SysvMessageExceedsReceiveCapacityand@noinspection SysvMessageExceedsReceiveCapacitysuppress this native rule.
Fix
None. A repair requires a semantic decision or application error-handling policy.
PHP versions
Available in PHP 5.3–8.5 where the referenced API exists. Do not apply extension contracts when the resolved API is unavailable. Gate syntax and version-specific behavior to the configured target.
Configure
In custos.json:
json
{
"rules": {
"SysvMessageExceedsReceiveCapacity": {
"enabled": false
}
}
}Suppress
Before the statement or declaration (or the first statement of the file):
php
// @custos-ignore SysvMessageExceedsReceiveCapacity