FA-27506 / HTTP ranges / Open access
A zero-copy range sender accounts for partial progress reported with syscall errors: successful byte progress survives an interrupted syscall status · case 01
A zero-copy range sender accounts for partial progress reported with syscall errors: successful byte progress survives an interrupted syscall status.
ROOT CAUSE
The sendfile-range-events-interrupt-progress decision uses offset=x['offset'] remaining=x['remaining'] state='running' opened=True out=[] for accepted,error in x['events']: if state in ('complete','aborted','truncated'): out.append([offset,remaining,state,opened]) continue if accepted<0 or accepted>remaining: state='aborted' opened=False out.append([offset,remaining,state,opened]) continue offset+=accepted if error!='interrupt' else 0 remaining-=accepted if error!='interrupt' else 0 if error=='fatal': state='aborted' elif remaining==0: state='complete' elif error=='again': state='blocked' elif error=='interrupt': state='running' elif accepted==0: state='truncated' else: state='running' opened=state not in ('complete','aborted','truncated') out.append([offset,remaining,state,opened]) return out.
VERIFIED REPAIR
Apply the bounded decision exactly: offset=x['offset'] remaining=x['remaining'] state='running' opened=True out=[] for accepted,error in x['events']: if state in ('complete','aborted','truncated'): out.append([offset,remaining,state,opened]) continue if accepted<0 or accepted>remaining: state='aborted' opened=False out.append([offset,remaining,state,opened]) continue offset+=accepted remaining-=accepted if error=='fatal': state='aborted' elif remaining==0: state='complete' elif error=='again': state='blocked' elif error=='interrupt': state='running' elif accepted==0: state='truncated' else: state='running' opened=state not in ('complete','aborted','truncated') out.append([offset,remaining,state,opened]) return out
Unsuccessful approach: The partial repair uses offset=x['offset'] remaining=x['remaining'] state='running' opened=True out=[] for accepted,error in x['events']: if state in ('complete','aborted','truncated'): out.append([offset,remaining,state,opened]) continue if accepted<0 or accepted>remaining: state='aborted' opened=False out.append([offset,remaining,state,opened]) continue offset+=accepted if error=='none' else 0 remaining-=accepted if error=='none' else 0 if error=='fatal': state='aborted' elif remaining==0: state='complete' elif error=='again': state='blocked' elif error=='interrupt': state='running' elif accepted==0: state='truncated' else: state='running' opened=state not in ('complete','aborted','truncated') out.append([offset,remaining,state,opened]) return out, which still violates the stated contract.
Case contract
x contains absolute offset, remaining promised bytes, and syscall events [accepted,error], where error is none,again,interrupt,fatal. Counts outside0..remaining abort without advancing. Valid accepted bytes advance even when again or interrupt accompanies them. Fatal errors abort; zero remaining completes; again blocks; interrupt reschedules; zero bytes with none truncates. Terminal states ignore later events. Return state snapshots [offset,remaining,state,handle-open] after each event.
Why this case matters
Range responses combine representation identity, conditional requests, framing, and partial-object state.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
offset=x['offset']
remaining=x['remaining']
state='running'
opened=True
out=[]
for accepted,error in x['events']:
if state in ('complete','aborted','truncated'):
out.append([offset,remaining,state,opened])
continue
if accepted<0 or accepted>remaining:
state='aborted'
opened=False
out.append([offset,remaining,state,opened])
continue
offset+=accepted if error!='interrupt' else 0
remaining-=accepted if error!='interrupt' else 0
if error=='fatal': state='aborted'
elif remaining==0: state='complete'
elif error=='again': state='blocked'
elif error=='interrupt': state='running'
elif accepted==0: state='truncated'
else: state='running'
opened=state not in ('complete','aborted','truncated')
out.append([offset,remaining,state,opened])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interrupt-progress fixture 0', json.loads(json.dumps(solve({'offset':10,'remaining':5,'events':[[2,'interrupt'],[1,'again'],[2,'none']]}))), json.loads(json.dumps([[12,3,'running',True],[13,2,'blocked',True],[15,0,'complete',False]])))
check('interrupt-progress fixture 1', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[0,'again'],[0,'interrupt'],[0,'none'],[1,'none']]}))), json.loads(json.dumps([[0,2,'blocked',True],[0,2,'running',True],[0,2,'truncated',False],[0,2,'truncated',False]])))
check('interrupt-progress fixture 2', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[1,'fatal'],[1,'none']]}))), json.loads(json.dumps([[1,1,'aborted',False],[1,1,'aborted',False]])))
check('interrupt-progress fixture 3', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[-1,'none']]}))), json.loads(json.dumps([[0,2,'aborted',False]])))
check('interrupt-progress fixture 4', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[3,'none']]}))), json.loads(json.dumps([[0,2,'aborted',False]])))
check('interrupt-progress fixture 5', json.loads(json.dumps(solve({'offset':N,'remaining':N,'events':[[N,'again'],[0,'fatal']]}))), json.loads(json.dumps([[2*N,0,'complete',False],[2*N,0,'complete',False]])))
check('interrupt-progress fixture 6', json.loads(json.dumps(solve({'offset':0,'remaining':0,'events':[[0,'none']]}))), json.loads(json.dumps([[0,0,'complete',False]])))
check('interrupt-progress fixture 7', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[2,'fatal']]}))), json.loads(json.dumps([[2,0,'aborted',False]])))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| interrupt-progress fixture 0 | [[10, 5, 'running', True], [11, 4, 'blocked', True], [13, 2, 'running', True]] | [[12, 3, 'running', True], [13, 2, 'blocked', True], [15, 0, 'complete', False]] | Failed |
| interrupt-progress fixture 1 | [[0, 2, 'blocked', True], [0, 2, 'running', True], [0, 2, 'truncated', False], [0, 2, 'truncated', False]] | [[0, 2, 'blocked', True], [0, 2, 'running', True], [0, 2, 'truncated', False], [0, 2, 'truncated', False]] | Passed |
| interrupt-progress fixture 2 | [[1, 1, 'aborted', False], [1, 1, 'aborted', False]] | [[1, 1, 'aborted', False], [1, 1, 'aborted', False]] | Passed |
| interrupt-progress fixture 3 | [[0, 2, 'aborted', False]] | [[0, 2, 'aborted', False]] | Passed |
| interrupt-progress fixture 4 | [[0, 2, 'aborted', False]] | [[0, 2, 'aborted', False]] | Passed |
| interrupt-progress fixture 5 | [[2, 0, 'complete', False], [2, 0, 'complete', False]] | [[2, 0, 'complete', False], [2, 0, 'complete', False]] | Passed |
| interrupt-progress fixture 6 | [[0, 0, 'complete', False]] | [[0, 0, 'complete', False]] | Passed |
| interrupt-progress fixture 7 | [[2, 0, 'aborted', False]] | [[2, 0, 'aborted', False]] | Passed |
SHA-256 / de1da802413c56f24b5d2dc8864562c6a8f1c48b12ff575d616b052c5e8ec358
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
offset=x['offset']
remaining=x['remaining']
state='running'
opened=True
out=[]
for accepted,error in x['events']:
if state in ('complete','aborted','truncated'):
out.append([offset,remaining,state,opened])
continue
if accepted<0 or accepted>remaining:
state='aborted'
opened=False
out.append([offset,remaining,state,opened])
continue
offset+=accepted if error=='none' else 0
remaining-=accepted if error=='none' else 0
if error=='fatal': state='aborted'
elif remaining==0: state='complete'
elif error=='again': state='blocked'
elif error=='interrupt': state='running'
elif accepted==0: state='truncated'
else: state='running'
opened=state not in ('complete','aborted','truncated')
out.append([offset,remaining,state,opened])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interrupt-progress fixture 0', json.loads(json.dumps(solve({'offset':10,'remaining':5,'events':[[2,'interrupt'],[1,'again'],[2,'none']]}))), json.loads(json.dumps([[12,3,'running',True],[13,2,'blocked',True],[15,0,'complete',False]])))
check('interrupt-progress fixture 1', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[0,'again'],[0,'interrupt'],[0,'none'],[1,'none']]}))), json.loads(json.dumps([[0,2,'blocked',True],[0,2,'running',True],[0,2,'truncated',False],[0,2,'truncated',False]])))
check('interrupt-progress fixture 2', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[1,'fatal'],[1,'none']]}))), json.loads(json.dumps([[1,1,'aborted',False],[1,1,'aborted',False]])))
check('interrupt-progress fixture 3', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[-1,'none']]}))), json.loads(json.dumps([[0,2,'aborted',False]])))
check('interrupt-progress fixture 4', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[3,'none']]}))), json.loads(json.dumps([[0,2,'aborted',False]])))
check('interrupt-progress fixture 5', json.loads(json.dumps(solve({'offset':N,'remaining':N,'events':[[N,'again'],[0,'fatal']]}))), json.loads(json.dumps([[2*N,0,'complete',False],[2*N,0,'complete',False]])))
check('interrupt-progress fixture 6', json.loads(json.dumps(solve({'offset':0,'remaining':0,'events':[[0,'none']]}))), json.loads(json.dumps([[0,0,'complete',False]])))
check('interrupt-progress fixture 7', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[2,'fatal']]}))), json.loads(json.dumps([[2,0,'aborted',False]])))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| interrupt-progress fixture 0 | [[10, 5, 'running', True], [10, 5, 'blocked', True], [12, 3, 'running', True]] | [[12, 3, 'running', True], [13, 2, 'blocked', True], [15, 0, 'complete', False]] | Failed |
| interrupt-progress fixture 1 | [[0, 2, 'blocked', True], [0, 2, 'running', True], [0, 2, 'truncated', False], [0, 2, 'truncated', False]] | [[0, 2, 'blocked', True], [0, 2, 'running', True], [0, 2, 'truncated', False], [0, 2, 'truncated', False]] | Passed |
| interrupt-progress fixture 2 | [[0, 2, 'aborted', False], [0, 2, 'aborted', False]] | [[1, 1, 'aborted', False], [1, 1, 'aborted', False]] | Failed |
| interrupt-progress fixture 3 | [[0, 2, 'aborted', False]] | [[0, 2, 'aborted', False]] | Passed |
| interrupt-progress fixture 4 | [[0, 2, 'aborted', False]] | [[0, 2, 'aborted', False]] | Passed |
| interrupt-progress fixture 5 | [[1, 1, 'blocked', True], [1, 1, 'aborted', False]] | [[2, 0, 'complete', False], [2, 0, 'complete', False]] | Failed |
| interrupt-progress fixture 6 | [[0, 0, 'complete', False]] | [[0, 0, 'complete', False]] | Passed |
| interrupt-progress fixture 7 | [[0, 2, 'aborted', False]] | [[2, 0, 'aborted', False]] | Failed |
SHA-256 / 7ef4c397ced8df4c5946697a36122158adc047e3d18671628108dbdfd0c916e0
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
offset=x['offset']
remaining=x['remaining']
state='running'
opened=True
out=[]
for accepted,error in x['events']:
if state in ('complete','aborted','truncated'):
out.append([offset,remaining,state,opened])
continue
if accepted<0 or accepted>remaining:
state='aborted'
opened=False
out.append([offset,remaining,state,opened])
continue
offset+=accepted
remaining-=accepted
if error=='fatal': state='aborted'
elif remaining==0: state='complete'
elif error=='again': state='blocked'
elif error=='interrupt': state='running'
elif accepted==0: state='truncated'
else: state='running'
opened=state not in ('complete','aborted','truncated')
out.append([offset,remaining,state,opened])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interrupt-progress fixture 0', json.loads(json.dumps(solve({'offset':10,'remaining':5,'events':[[2,'interrupt'],[1,'again'],[2,'none']]}))), json.loads(json.dumps([[12,3,'running',True],[13,2,'blocked',True],[15,0,'complete',False]])))
check('interrupt-progress fixture 1', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[0,'again'],[0,'interrupt'],[0,'none'],[1,'none']]}))), json.loads(json.dumps([[0,2,'blocked',True],[0,2,'running',True],[0,2,'truncated',False],[0,2,'truncated',False]])))
check('interrupt-progress fixture 2', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[1,'fatal'],[1,'none']]}))), json.loads(json.dumps([[1,1,'aborted',False],[1,1,'aborted',False]])))
check('interrupt-progress fixture 3', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[-1,'none']]}))), json.loads(json.dumps([[0,2,'aborted',False]])))
check('interrupt-progress fixture 4', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[3,'none']]}))), json.loads(json.dumps([[0,2,'aborted',False]])))
check('interrupt-progress fixture 5', json.loads(json.dumps(solve({'offset':N,'remaining':N,'events':[[N,'again'],[0,'fatal']]}))), json.loads(json.dumps([[2*N,0,'complete',False],[2*N,0,'complete',False]])))
check('interrupt-progress fixture 6', json.loads(json.dumps(solve({'offset':0,'remaining':0,'events':[[0,'none']]}))), json.loads(json.dumps([[0,0,'complete',False]])))
check('interrupt-progress fixture 7', json.loads(json.dumps(solve({'offset':0,'remaining':2,'events':[[2,'fatal']]}))), json.loads(json.dumps([[2,0,'aborted',False]])))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| interrupt-progress fixture 0 | [[12, 3, 'running', True], [13, 2, 'blocked', True], [15, 0, 'complete', False]] | [[12, 3, 'running', True], [13, 2, 'blocked', True], [15, 0, 'complete', False]] | Passed |
| interrupt-progress fixture 1 | [[0, 2, 'blocked', True], [0, 2, 'running', True], [0, 2, 'truncated', False], [0, 2, 'truncated', False]] | [[0, 2, 'blocked', True], [0, 2, 'running', True], [0, 2, 'truncated', False], [0, 2, 'truncated', False]] | Passed |
| interrupt-progress fixture 2 | [[1, 1, 'aborted', False], [1, 1, 'aborted', False]] | [[1, 1, 'aborted', False], [1, 1, 'aborted', False]] | Passed |
| interrupt-progress fixture 3 | [[0, 2, 'aborted', False]] | [[0, 2, 'aborted', False]] | Passed |
| interrupt-progress fixture 4 | [[0, 2, 'aborted', False]] | [[0, 2, 'aborted', False]] | Passed |
| interrupt-progress fixture 5 | [[2, 0, 'complete', False], [2, 0, 'complete', False]] | [[2, 0, 'complete', False], [2, 0, 'complete', False]] | Passed |
| interrupt-progress fixture 6 | [[0, 0, 'complete', False]] | [[0, 0, 'complete', False]] | Passed |
| interrupt-progress fixture 7 | [[2, 0, 'aborted', False]] | [[2, 0, 'aborted', False]] | Passed |
SHA-256 / 683af2ef9110b15b0071b543b5e13620d2ced1249e206a368f4d9a4cee764857
Verification & scope
Deterministic simplified range service, with stipulated local policies and already parsed trusted inputs; not a complete HTTP implementation. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:41:25.742952+00:00.
Case digest / 771cc319020e765b84eb004faef0ec2fc93aed3fb6b169585e018ce6e53de230