Ark: Coercion methods into `RObject` vectors should catch OOM errors
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 337
- Forks
- 32
- Avg merge
- 8d 17h
- Merged PRs (30d)
- 11
Description
The allocVector() calls in vector coercion methods (e.g. https://github.com/posit-dev/amalthea/blob/f16a0137ed416330658ffd242c2b8c7b5792f045/crates/harp/src/object.rs#L759) might throw an R error over our Rust stack. We should run these in a r_try_catch(), probably via a wrapper that returns a Result.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in crates/harp/src/object.rs around the allocVector call at line 759 and inspect the other vector coercion methods. Review how r_try_catch is used and how Rust errors are represented. Done means allocation errors, including OOM, are caught through r_try_catch rather than unwinding over the Rust stack, with the wrapper returning a Result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, rust
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100