Repository navigation
Conversation
Co-authored-by: dipterix <8163576+dipterix@users.noreply.github.com>
Co-authored-by: dipterix <8163576+dipterix@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job
Fix failing CI: exception propagation across toolchains and rchk PROTECT stack depth
Oct 11, 2026
- Note at each file's first `throw;` why `std::rethrow_exception` must not come back: a package built with libc++ can run in an R that loaded libstdc++ (via ICU), and exception_ptr would mix the two C++ runtimes - Add a regression test that errors (and custom conditions) raised in mapreduce's map and reduce functions reach the caller unchanged - NEWS entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
rchk,clang16,c23, andnoremapCI jobs were failing from two unrelated C++ issues: R errors lost during exception rethrow on certain toolchains, and an over-deep PROTECT stack flagged by rchk.Exception propagation (
clang16,c23,noremap)fmap/fmap2error tests failed withc++ exception (unknown reason). The code rethrew the in-flightRcpp::LongjumpExceptionviastd::rethrow_exception(std::current_exception()). Sincecurrent_exception()may return a copy andLongjumpExceptionis not derived fromstd::exception, the rethrown object stopped matching Rcpp'scatch(LongjumpException&)handler, fell through tocatch(...), and discarded the original R condition.throw;(preserves the exact in-flight object) insrc/map.cpp,src/mapreduce.cpp,src/load.cpp.rchk PROTECT stack depth
rchk reported "protect stack is too deep" in
FARR_buffer_map/FARR_buffer_map2(src/map.cpp) andlocationList/schedule(src/core.cpp), caused byPROTECTinside loops with non-constant iteration counts (ann_protectedcounter incremented per iteration).SET_VECTOR_ELTinstead of protecting each one.schedule, PROTECT per-partition temporaries locally andUNPROTECTthem each iteration once stored —tmpis held by the PROTECTedsliceIdx2,idx2tmpby the RcppList idx2s(R-preserved afterpush_back) — bounding stack depth.locationListevaluates a promise under a single scopedPROTECTreleased after the coerced result is stored.Notes for reviewers
UNPROTECTinschedule; this is a false positive —idx2sis an RcppList, not astd::vector<SEXP>, so it GC-protects its contents (verified undergctorture).