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(R2GoogleMaps)
library(XML)
load("b.rda")
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