`read_xml` crashes R when trying to read from an `archive::archive_read` connection if the connection is closed beforehand
まだ誰も着手していません。
評価
調査の方向性
Run the supplied R reproducer using rawConnection, archive::archive_read, close(), and xml2::read_xml(). Trace whether the failure belongs to xml2::read_xml or archive::archive_read when the underlying connection is closed, and define behavior that avoids an R crash for this case.
索引モデルが issue の本文から書いたものです。
説明
I've been handed a database in which one of the fields contains XML documents as compressed blobs (ZIP/PK archives). Rather than writing the file out to disk every time and reading it in using read_xml I tried using the archive package's bindings to libarchive to read it directly. It works great except that I'm trying to close the connections properly afterward and learned that R crashes if I incorrectly close the rawConnection object before calling read_xml.
xml_text <- '<text>Hi</text>'
blob <- charToRaw(xml_text)
blob_con <- rawConnection(blob)
spec_con <- archive::archive_read(blob_con)
close(blob_con)
xml2::read_xml(spec_con)
The error I get when R crashes is:
Error in (function (con, rw = "") : invalid connection
terminate called after throwing an instance of 'cpp11::unwind_exception'
what(): std::exception
I honestly don't know whether this is an archive problem or an xml2 problem so happy to repost there, I just don't know enough about the internals to learn where the problem itself is and read_xml is what's currently causing the crash when called.
I'm on R 4.5.1 with xml2 1.3.8 and archive version 1.1.12.
- 主要言語
- R
- スター
- 227
- フォーク
- 86
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
r-lib/xml2 のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 67/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
Optimize xml_path() and xml_find_all() for large node sets対応中かも @astruebi が 182 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
Bioconductor/BiocParallel#289 ·
-
automation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
waldronlab/BugSigDBcuration#2224 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
merliseclyde/BAS#118 ·