Skip to content

COACCT01: recursive PERFORM without end stops at the PERFORM stack check on both sides (Part of #6967) - #6997

Merged
squid-shepherd[bot] merged 2 commits into
mainfrom
churn/6967-20261029T0954Z
Oct 29, 2026
Merged

squid-shepherd[bot] merged 2 commits into
mainfrom
churn/6967-20261029T0954Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #6967 (and #6072). CardDemo's COACCT01 8000-TERMINATION never resets a queue's open flag, so a failed MQCLOSE of the reply or error queue re-closes the closed input queue, takes WHEN OTHER and PERFORMs 8000 again, without end. Plain cobc died on SIGSEGV and the port on StackOverflowError, so those arms were unstated (register C20).

What changed

  • Oracle: a case with "perform_stack_check": true compiles with -fstack-check; libcob then stops deterministically ("stack overflow, possible PERFORM depth exceeded", 255 PERFORM frames, rc 1) (equivalence_common.compile_options).
  • Port: det/program.py performs_cyclically (a PERFORM-graph cycle) makes the dispatcher throw PerformDepthExceeded at the same depth. Acyclic ports are byte-identical.
  • Judgment: the existing X6 prefix machinery gets a third kind, C20: the MQ events before the stop are compared on both sides, the end state is not (equivalence_cics.x6_judged).
  • Case: coacct01 close-reply-fails (MQCLOSE nth 2) and close-error-fails (nth 3), both reason 2009. Register C20 states the assumption: IBM leaves a recursive PERFORM unpredictable, and the stop and its depth are the oracle's, not z/OS's.

Evidence

  • det_port.py run carddemo-coacct01: PROVED, 18 scenarios, 136/136 and 138/138 events equal (java and java-facade). Threshold found by measurement: one frame earlier or later leaves one MQCLOSE of difference.
  • det_port.py check: 179/182 ports unchanged; the 3 listed (coacct01, codate01, copaua0c, the programs with a PERFORM cycle) re-proved: codate01 and copaua0c PROVED. No existing scenario reaches the guard.
  • test_det_recursive_perform.py (cycle detection, opt-in flag): 6 passed, plain pytest from /tmp too. audit_check.py all clear; pr_gates --fast 9/9, --ratchets 9/9. det_sweep_coverage ledger refreshed for coacct01.
  • No golden bless: no parsing change.

Cross-repo: none. Overlap: PR #6952 (det/program.py) and the equivalence_cics workers; origin/main merged before the push, change kept small there.

Class / Sibling gaps

Class: an unbounded recursive PERFORM, whose two sides die by different, depth-dependent means (SIGSEGV vs StackOverflowError), so the event streams differ in length. Handled: COACCT01 (both arms). Sibling gaps: CODATE01 has the same shape (its reply/error close arms); it needs perform_stack_check and two scenarios cloned from this case (the port guard already applies). The zos_probes.json probe c20-recursive-perform-returns still does not probe the endless case (z/OS only). No other burned program has a PERFORM cycle except COPAUA0C, whose scenarios do not reach the depth.

Checklist: partial [c:5981f543] -- CODATE01's two close arms (same flag and scenarios) and the ladder/ledger refresh after them.

Remaining slices

  • CODATE01 close-reply-fails / close-error-fails and ladder refresh.
  • z/OS probe of the endless recursion (needs z/OS).

Lessons for agents

  • -fstack-check makes libcob stop a runaway PERFORM at 255 frames with rc 1; the port's top-level perform(0, n-1) is a frame the oracle has no equivalent of, so the guard is performDepth >= 255. A cycle of two PERFORM frames hides a one-frame error: confirm the event count, not only "stops".
  • det_port.py check lists a port when the translator emits new text for it, not only when it behaves differently; re-prove just those.

🤖 Generated with Claude Code

squid-protocol and others added 2 commits October 29, 2026 06:22
…eck on both sides (Part of #6967)

A failed MQCLOSE of the reply or error queue re-closes the input queue and PERFORMs 8000-TERMINATION again, without end.
A case with perform_stack_check compiles the oracle with -fstack-check (libcob stops at 255 PERFORM frames); a det port
with a PERFORM cycle stops at the same depth (PerformDepthExceeded); the scenario is judged up to the stop (register C20).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 29, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review October 29, 2026 10:36
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant