xml_add_parent produces a segfault in for loop
Chưa có ai nhận issue này.
- #396 của @alexverse — đã đóng, không merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Start by running the supplied minimal R loop with xml2 1.3.2 and inspect the xml_add_parent entry point and its interaction with repeated calls. Done means the stress loop completes without a segfault while preserving the shown parent-child XML structure, with a regression test covering the reproduction.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
By developing a plumber API with xml2 I fall into the following error under a small stress test. I reproduce a minimal example in my local machine.
The following code chunk produces an error,
library(xml2)
xx <- function() {
x <- read_xml("<fruits><apple color='red'></apple></fruits>")
xml_add_parent(x, read_xml("<food></food>"))
print(as.character(x))
}
for(i in 1:1000)xx()
[1] "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<food>\n <fruits>\n <apple color=\"red\"/>\n </fruits>\n</food>\n"
[1] "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<food>\n <fruits>\n <apple color=\"red\"/>\n </fruits>\n</food>\n"
[1] "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<food>\n <fruits>\n <apple color=\"red\"/>\n </fruits>\n</food>\n"
*** caught segfault ***
address 0x55ff44000000, cause 'memory not mapped'
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:
R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=el_GR.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=el_GR.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=el_GR.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=el_GR.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] xml2_1.3.2 plumber_1.1.0.9000
loaded via a namespace (and not attached):
[1] compiler_4.0.4 magrittr_2.0.1 R6_2.5.0 later_1.2.0
[5] promises_1.2.0.1 tools_4.0.4 swagger_3.33.1 Rcpp_1.0.6
[9] stringi_1.6.1 jsonlite_1.7.2 webutils_1.1 lifecycle_1.0.0
[13] rlang_0.4.11
you can bypass it for example by using xml_add_child and xml_replace instead.
- Ngôn ngữ chính
- R
- Star
- 227
- Fork
- 86
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của r-lib/xml2
-
Export libxml2_version()Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 67/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Optimize xml_path() and xml_find_all() for large node setsCó thể đã có người làm @astruebi đã nhận 182 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Issue tương tự
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Bioconductor/BiocParallel#289 ·
-
automation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
waldronlab/BugSigDBcuration#2224 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
merliseclyde/BAS#118 ·