Skip to content

fix(drivers): a send to a closed loopback connection fails instead of raising SIGPIPE - #100

Merged
gabrielfrasantos merged 1 commit into
mainfrom
claude/compassionate-noether-b931rk
Nov 16, 2026
Merged

gabrielfrasantos merged 1 commit into
mainfrom
claude/compassionate-noether-b931rk

Conversation

@gabrielfrasantos

Copy link
Copy Markdown
Contributor

Problem

loopback::Send called ::send with no flags. On Linux, writing to a connection whose peer has closed raises SIGPIPE, and the default action ends the process.

A virtual CAN hub hosted inside a larger program is exposed to this. e-robot-arm's simulator now hosts the hub for its six e-foc virtual motors. When one motor's process was killed (a joint restart), the hub's next write to that connection ended the whole simulator with SIGPIPE: 2 of 6 local runs died this way.

Fix

  • Linux sends pass MSG_NOSIGNAL, so the write returns failure and the participant is dropped. Windows already behaves this way and keeps flags 0.
  • TestLoopbackSocket.sending_to_a_peer_that_closed_fails_without_ending_the_process: before the fix it killed the test binary; with the fix all 122 driver tests pass.
  • Booklet chapter 3 (virtual hub) records that a participant that ends abruptly is dropped without signalling the host program.

Generated by Claude Code

… raising SIGPIPE

A hub hosted inside a larger program (e-robot-arm's simulator hosts the
virtual hub for its virtual arm) ended that program with SIGPIPE when a
participant's process was killed and the hub wrote to its closed
connection. Linux sends now pass MSG_NOSIGNAL, so the write fails and the
participant is dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WUWh4ve7wn8JxNywWbX5h
Copilot AI balanced review requested due to automatic review settings November 16, 2026 08:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@github-actions

Copy link
Copy Markdown
Contributor

Integration Test Results

56 tests  ±0   56 ✅ ±0   0s ⏱️ ±0s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 8eac9fa. ± Comparison against base commit e7de96e.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

✅⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ ACTION actionlint 7 0 0 0.13s
✅ CPP clang-format 121 0 0 0 1.06s
✅ DOCKERFILE hadolint 1 0 0 0.06s
✅ JSON jsonlint 11 0 0 0.15s
✅ JSON prettier 11 5 0 0 0.62s
⚠️ MARKDOWN markdownlint 36 1 3 0 6.72s
✅ MARKDOWN markdown-table-formatter 36 1 0 0 0.37s
✅ REPOSITORY betterleaks yes no no 1.24s
✅ REPOSITORY checkov yes no no 23.37s
✅ REPOSITORY git_diff yes no no 0.04s
✅ REPOSITORY grype yes no no 91.54s
✅ REPOSITORY ls-lint yes no no 0.02s
✅ REPOSITORY secretlint yes no no 1.25s
✅ REPOSITORY syft yes no no 2.32s
✅ REPOSITORY trivy yes no no 12.91s
✅ REPOSITORY trivy-sbom yes no no 0.24s
✅ REPOSITORY trufflehog yes no no 4.14s
⚠️ SPELL lychee 87 2 0 6.7s
✅ YAML prettier 17 2 0 0 0.79s
✅ YAML v8r 17 0 0 8.75s
✅ YAML yamllint 17 0 0 3.52s

Detailed Issues

⚠️ SPELL / lychee - 2 errors
📝 Summary
---------------------
🔍 Total..........142
🔗 Unique..........79
✅ Successful.....136
⏳ Timeouts.........0
🔀 Redirected......20
👻 Excluded.........4
❓ Unknown..........0
🚫 Errors...........2
⛔ Unsupported......2

Errors in .github/workflows/static-analysis.yml
[403] https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$ (at 36:21) | Rejected status code: 403 Forbidden

Errors in CHANGELOG.md
[404] https://github.com/embedded-pro/can-lite/compare/v0.0.1...v1.0.0 (at 3:4) | Rejected status code: 404 Not Found

Hint: Followed 20 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.
Hint: You can configure accepted/rejected response codes with `-a` or `--accept`
⚠️ MARKDOWN / markdownlint - 3 errors
CHANGELOG.md:12:401 error MD013/line-length Line length [Expected: 400; Actual: 446]
documents/design/architecture.md:179:401 error MD013/line-length Line length [Expected: 400; Actual: 426]
documents/design/architecture.md:575:401 error MD013/line-length Line length [Expected: 400; Actual: 432]

Notices

⚠️ Your configuration references items that have been removed from MegaLinter and are ignored: REPOSITORY_GITLEAKS, REPOSITORY_KICS. See Removed linters to find their replacements.

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.2.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_GRYPE,REPOSITORY_LS_LINT,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@gabrielfrasantos
gabrielfrasantos merged commit cd2072e into main Nov 16, 2026
12 checks passed
@gabrielfrasantos
gabrielfrasantos deleted the claude/compassionate-noether-b931rk branch November 16, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants