posit-dev / posit-dev/ark

Ark: Coercion methods into `RObject` vectors should catch OOM errors

Open
#693 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.