Skip to content

synserver accept assertion to log event details before aborting#12903

Merged
bryancall merged 3 commits intoapache:masterfrom
bryancall:fix-synserver-accept-assert
Feb 21, 2026
Merged

synserver accept assertion to log event details before aborting#12903
bryancall merged 3 commits intoapache:masterfrom
bryancall:fix-synserver-accept-assert

Conversation

@bryancall
Copy link
Copy Markdown
Contributor

@bryancall bryancall commented Feb 20, 2026

Problem

Rocky CI build #8376 crashed with a core dump in synserver_vc_accept after SDK_API_HttpParentProxySet_Success passed. The bare TSAssert logged no information about which event was actually received, making diagnosis impossible.

Changes

  • Replace bare TSAssert with diagnostic ink_abort -- logs the unexpected event number and, if the data looks like a negated errno, the strerror string in both synserver_vc_accept and synserver_vc_refuse
  • Validate data as intptr_t before narrowing to errno -- checks the range (-1 to -4095) in pointer-width space to avoid truncating a pointer that accidentally lands in the errno range

Testing

  • All 15 CI checks pass
  • Does not change behavior (still aborts on unexpected events) -- only adds diagnostics before the abort

Replace bare TSAssert in synserver_vc_accept and synserver_vc_refuse
with diagnostic ink_abort that logs the unexpected event number and,
if the data looks like a negated errno, the strerror string. This
gives CI output useful for debugging the accept() failure seen on
Rocky (build apache#8376) where the synserver received an unexpected event
after SDK_API_HttpParentProxySet_Success passed.
@bryancall bryancall added this to the 10.2.0 milestone Feb 20, 2026
@bryancall bryancall self-assigned this Feb 20, 2026
@bryancall bryancall requested a review from Copilot February 20, 2026 07:51
@bryancall bryancall changed the title Fix: synserver accept assertion to log event details before aborting synserver accept assertion to log event details before aborting Feb 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves diagnostics for unexpected events in the synserver_vc_accept / synserver_vc_refuse continuations inside InkAPITest, so future CI crashes provide actionable details (event id and possible errno) before aborting.

Changes:

  • Replaced a bare TSAssert with an ink_abort-based diagnostic path in synserver_vc_refuse.
  • Replaced a bare TSAssert with an ink_abort-based diagnostic path in synserver_vc_accept.
  • Added best-effort decoding of data as a negated errno for improved logging.

Comment thread src/api/InkAPITest.cc Outdated
Comment on lines +896 to +897
int err = -static_cast<int>(reinterpret_cast<intptr_t>(data));
if (err > 0 && err < 256) {
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data is treated as a negated errno via reinterpret_cast<intptr_t>(data) and then narrowed to int before negation. If data is actually a pointer (plausible for many events), the narrowing conversion can wrap/lose bits and accidentally produce a small positive value (e.g., <256), leading to a misleading strerror() message. Consider keeping the value as intptr_t, first checking it’s in a plausible negated-errno range (e.g., < 0 and >= -4095), and only then converting to an int errno; otherwise log the raw integer/pointer value.

Suggested change
int err = -static_cast<int>(reinterpret_cast<intptr_t>(data));
if (err > 0 && err < 256) {
intptr_t data_val = reinterpret_cast<intptr_t>(data);
if (data_val < 0 && data_val >= -4095) {
int err = static_cast<int>(-data_val);

Copilot uses AI. Check for mistakes.
Comment thread src/api/InkAPITest.cc
Check data in intptr_t space (negative and >= -4095) before treating
it as a negated errno. Avoids truncating a pointer to int which could
accidentally land in the errno range and print a misleading strerror.
@bryancall
Copy link
Copy Markdown
Contributor Author

[approve ci autest 1]

1 similar comment
@bryancall
Copy link
Copy Markdown
Contributor Author

[approve ci autest 1]

@bryancall bryancall requested a review from bneradt February 21, 2026 01:19
Copy link
Copy Markdown
Contributor

@bneradt bneradt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. hopefully this helps us make progress on this.

@bryancall bryancall merged commit 33dee5d into apache:master Feb 21, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this to For v10.2.0 in ATS v10.2.x Mar 23, 2026
@bryancall bryancall modified the milestones: 10.2.0, 11.0.0 Mar 23, 2026
@cmcfarlen cmcfarlen modified the milestones: 11.0.0, 10.2.0 Mar 24, 2026
@cmcfarlen
Copy link
Copy Markdown
Contributor

Cherry-picked to 10.2.x

cmcfarlen pushed a commit that referenced this pull request Mar 24, 2026
* Replace bare TSAssert in synserver_vc_accept and synserver_vc_refuse
  with ink_abort that logs the unexpected event number and, if the data
  looks like a negated errno, the strerror string. Gives CI output useful
  for debugging the accept() failure seen on Rocky build #8376.

* Validate data in intptr_t space (negative and >= -4095) before treating
  it as a negated errno to avoid truncating a pointer to int.

(cherry picked from commit 33dee5d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Picked v10.2.0

Development

Successfully merging this pull request may close these issues.

4 participants