Skip to content

Fix SystemStackError caused by infinite recursion in _handle_result#13

Open
dblock wants to merge 1 commit intomainfrom
fix-stack-overflow-in-handle-result
Open

Fix SystemStackError caused by infinite recursion in _handle_result#13
dblock wants to merge 1 commit intomainfrom
fix-stack-overflow-in-handle-result

Conversation

@dblock
Copy link
Owner

@dblock dblock commented Jan 29, 2026

Summary

Fixes #12 - SystemStackError when using local theme

Problem

When an error occurred during result handling (e.g., a logging error in Jekyll's Stevenson logger), the rescue block in _handle_result would recursively call itself, leading to infinite recursion and SystemStackError.

Solution

This fix prevents recursion by directly invoking the error callbacks (result! and error!) instead of calling _handle_result again. The logger.error call is also wrapped with rescue nil to prevent logging errors from propagating.

Changes

  • Modified lib/ruby-link-checker/tasks.rb to handle errors without recursion
  • Added spec/ruby-link-checker/tasks_spec.rb with a test that verifies the fix

@dblock dblock force-pushed the fix-stack-overflow-in-handle-result branch 3 times, most recently from 1446870 to d781162 Compare January 29, 2026 18:46
@dblock dblock force-pushed the fix-stack-overflow-in-handle-result branch 2 times, most recently from a2f513c to c7c8129 Compare January 29, 2026 23:55
@github-actions
Copy link

github-actions bot commented Jan 29, 2026

Danger Report

No issues found.

View run

@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.47%. Comparing base (e665f74) to head (849be69).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
+ Coverage   97.41%   97.47%   +0.06%     
==========================================
  Files          29       30       +1     
  Lines         696      713      +17     
==========================================
+ Hits          678      695      +17     
  Misses         18       18              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dblock dblock force-pushed the fix-stack-overflow-in-handle-result branch from 87f5b1c to b5ba128 Compare January 29, 2026 23:59
When an error occurred during result handling (e.g., a logging error),
the rescue block in _handle_result would recursively call itself,
leading to infinite recursion and SystemStackError.

This fix prevents recursion by directly invoking the error callbacks
instead of calling _handle_result again. The logger.error call is also
wrapped with rescue nil to prevent logging errors from propagating.

Fixes #12

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@dblock dblock force-pushed the fix-stack-overflow-in-handle-result branch from b5ba128 to 849be69 Compare January 30, 2026 00:01
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.

SystemStackError when using local theme

2 participants

Comments