Skip to content

fix: lower MAX_DEPTH to 4000 to prevent SEGV on CPAN smokers (GH #77)#79

Merged
atoomic merged 1 commit intogaru:masterfrom
atoomic:koan.atoomic/fix-issue-77
Feb 24, 2026
Merged

fix: lower MAX_DEPTH to 4000 to prevent SEGV on CPAN smokers (GH #77)#79
atoomic merged 1 commit intogaru:masterfrom
atoomic:koan.atoomic/fix-issue-77

Conversation

@atoomic
Copy link
Collaborator

@atoomic atoomic commented Feb 24, 2026

MAX_DEPTH=32000 required ~7.2 MB of C stack before switching to iterative mode — too close to the 8 MB default on Linux and over the limit on some CPAN smoker and container environments. This caused SEGV in t/10-deep_recursion.t on multiple CPAN testers.

Lower MAX_DEPTH to 4000 (~900 KB stack), which is safe on any reasonable system. The iterative fallback handles deeper structures correctly.

Also lower the test's deep_target from 35000 to 5000: still exceeds MAX_DEPTH/2 (2000 nesting levels) to exercise both recursive and iterative paths, but avoids overflowing Perl's own recursive SvREFCNT_dec during structure cleanup.

Fix: #77

)

MAX_DEPTH=32000 required ~7.2 MB of C stack before switching to
iterative mode — too close to the 8 MB default on Linux and over
the limit on some CPAN smoker and container environments.  This
caused SEGV in t/10-deep_recursion.t on multiple CPAN testers.

Lower MAX_DEPTH to 4000 (~900 KB stack), which is safe on any
reasonable system.  The iterative fallback handles deeper structures
correctly.

Also lower the test's deep_target from 35000 to 5000: still exceeds
MAX_DEPTH/2 (2000 nesting levels) to exercise both recursive and
iterative paths, but avoids overflowing Perl's own recursive
SvREFCNT_dec during structure cleanup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@atoomic atoomic merged commit 7cd21d9 into garu:master Feb 24, 2026
27 checks passed
@atoomic atoomic deleted the koan.atoomic/fix-issue-77 branch February 24, 2026 00:27
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.

Failure from t/10-deep_recursion.t - TRIAL 0.48_06

2 participants