HtmlParse () segfault error in XML R-package: "memory not mapped"

I am using R 2.11.1 and the XML package 3.1-0, and I was looking at an example from R2GoogleMaps when I encountered a segfault error.

#library(RJSONIO)
library(R2GoogleMaps)
library(XML)
#library(RCurl)

load("b.rda") # find in the sampleDocs folder in source file of R2GoogleMaps

center = c(mean(range(b$lat)), mean(range(b$long)))
code = addOverlay(gpolyline(b))

d = googleMapsDoc(code, center, zoom = 11, dim = c(750, 700), file = "simplePolyline.html")

Below is an easily reproducible code that gets the same error:

> library(XML)
> a <- htmlParse("http://bm2.genes.nig.ac.jp/RGM2/R_current/library/XML/man/xmlTreeParse.html")
> a

 *** caught segfault ***
address 0x55aa44, cause 'memory not mapped'

Traceback:
 1: .Call("RS_XML_dumpHTMLDoc", doc, as.integer(indent), as.character(encoding),     as.logical(indent), PACKAGE = "XML")
 2: saveXML(from)
 3: saveXML(from)
 4: asMethod(object)
 5: as(x, "character")
 6: cat(as(x, "character"), "\n")
 7: print.XMLInternalDocument(<pointer: 0x1016363f0>)
 8: print(<pointer: 0x1016363f0>)

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: 1
aborting ...

Process R segmentation fault at Sat Jul 31 22:07:02 2010

The problem also seems to be doing saveXML()in the file htmlParse().

When I wrote another code that I used htmlParse(), I don’t remember ever encountering this problem (although I don’t remember, I would name the object htmlParse()explicitly). So I’m not quite sure if this is a recent problem or not. The only difference between now and now (what I remember) is that I installed many of the OmegaHat packages from the source.

, - . , , . ? .

edit: :

> sessionInfo()
R version 2.11.1 (2010-05-31) 
x86_64-apple-darwin9.8.0 

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  grid      methods  
[8] base     

other attached packages:
[1] XML_3.1-0     digest_0.4.2  reshape_0.8.3 plyr_0.1.9    proto_0.3-8  

loaded via a namespace (and not attached):
[1] ggplot2_0.8.7
+3
1

, . (. ).

() , ​​ XML ; (b) XML (

( "XML" ) ) sessionInfo()

.

=============

(XML) a < - htmlParse ( " http://bm2.genes.nig.ac.jp/RGM2/R_current/library/XML/man/xmlTreeParse.html" )

sessionInfo() R 2.11.1 (2010-05-31) i486-pc-linux-gnu

:  [1] LC_CTYPE = en_US.UTF-8 LC_NUMERIC = C
 [3] LC_TIME = en_US.UTF-8 LC_COLLATE = ru_US.UTF-8
 [5] LC_MONETARY = C LC_MESSAGES = ru_US.UTF-8
 [7] LC_PAPER = ru_US.UTF-8 LC_NAME = C
 [9] LC_ADDRESS = C LC_TELEPHONE = C
[11] LC_MEASUREMENT = ru_US.UTF-8 LC_IDENTIFICATION = C

: [1] grDevices utils
[8]

: [1] XML_3.1-0 reshape_0.8.3 plyr_1.0.3 proto_0.3-8

( ): [1] ggplot2_0.8.8

+1

Source: https://habr.com/ru/post/1757523/


All Articles