r-lib / xml2

Bindings to libxml2
https://xml2.r-lib.org/
Other
220 stars 81 forks source link

Pointer error #439

Closed femiguez closed 8 months ago

femiguez commented 9 months ago

I'm the developer of apsimx (https://cran.r-project.org/package=apsimx) package. I have a function which retrieves data from a service https://worldmodel.csiro.au/. I'm heavily using the xml2 package to read and parse the data. However, this results in a fatal pointer error. To reproduce the problem you can run the following code.

library(apsimx)
sp <- apsimx:::get_worldmodeler_soil_profile(c(-93, 42))

At first it seems to work fine, but then R crashes after a few seconds

femiguez commented 9 months ago

The error messages I see are:

free(): invalid pointer
[257905:257905:20240207, 133516.965314:ERROR process_memory_range.cc:86] read out of range
## similar errors regarding elf_image_reader.cc:558, elf_dynamic_array_reader.h:61] tag not found
## last error is found on directory_reader_posix.cc:42] opendir: No such file or directory (2)
femiguez commented 8 months ago

I'm closing this only because I was able to find a workaround by setting argument '.copy' to TRUE instead of FALSE.