Skip to content

fix: Keep the elements of sqliteHttpStats() protected while its list is built - #894

Merged
krlmlr merged 2 commits into
mainfrom
claude/fix-http-stats-protect
Nov 14, 2026
Merged

krlmlr merged 2 commits into
mainfrom
claude/fix-http-stats-protect

Conversation

@krlmlr

@krlmlr krlmlr commented Nov 14, 2026

Copy link
Copy Markdown
Member

rchk, in the R-hub run of the release PR #893, reported that sqlite_http_stats() (src/httpvfs_stats.cpp) passes freshly allocated scalars to cpp11::writable::list::push_back(), which allocates itself and could collect them. This builds the list from cpp11 named arguments instead, each of which holds its element in a protected cpp11::sexp. The result is unchanged: a list of bytes_fetched (integer), range_requests (integer) and full_download (logical).

Checked locally: the package builds, the result is identical with and without gctorture(), and test-httpvfs.R and test-httpvfs-helpers.R pass. The rchk job of R-hub runs on the release branch, which carries this fix.

Part of the release of 3.54.1 (#893): the release branch merges this branch, so that the reverse-dependency run checks the code that ships.

https://claude.ai/code/session_01Hr1rd6znpbaJUu6TJLjgQC


Generated by Claude Code

…t is built

rchk reported that `sqlite_http_stats()` passed freshly allocated scalars
to `push_back()`, which allocates and could collect them.
Build the list from named arguments instead,
which hold each element in a protected `cpp11::sexp`.
The result is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd6znpbaJUu6TJLjgQC
krlmlr pushed a commit that referenced this pull request Nov 14, 2026
Cite only the final SQLite upgrade,
and say that the UTF-8 check is opt-in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd6znpbaJUu6TJLjgQC

krlmlr commented Nov 14, 2026 •

Copy link
Copy Markdown
Member Author

Accepted limitations

The clean review found nothing above Low. It confirmed against cpp11's headers that every element is held in a protected sexp before the next allocation, that the result is unchanged, and that the construction compiles with the cpp11 (>= 0.4.0) this package requires.


Generated by Claude Code

@krlmlr krlmlr mentioned this pull request Nov 14, 2026
16 of 22 tasks
@krlmlr
krlmlr enabled auto-merge (squash) November 14, 2026 09:12
@krlmlr
krlmlr merged commit 40cdb22 into main Nov 14, 2026
4 of 5 checks passed
@krlmlr
krlmlr deleted the claude/fix-http-stats-protect branch November 14, 2026 09:23
@krlmlr krlmlr mentioned this pull request Nov 14, 2026
6 of 11 tasks
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.

2 participants