【问题标题】:htmlParse() segfault error in R XML package: 'memory not mapped'R XML 包中的 htmlParse() 段错误错误:“内存未映射”
【发布时间】:2011-03-23 19:05:56
【问题描述】:

我正在使用 R 2.11.1 和 XML 包 3.1-0,当我遇到段错误错误时,我正在查看来自 R2GoogleMaps 的示例。

#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")

下面是一个容易重现的代码,它得到了同样的错误:

> 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

问题似乎还在于对htmlParse() 文件执行saveXML()

当我编写另一个使用htmlParse() 的代码时,我不记得曾经遇到过这个问题(尽管我不记得我是否明确调用了htmlParse() 对象)。所以我不完全确定这是否是最近的问题。当时和现在的唯一区别(我记得)是我从源代码安装了许多OmegaHat packages

我很好奇是否有其他人收到此错误。为了探究原因是否与我的笔记本电脑有关,我已经重新启动并升级了我的操作系统作为基本步骤。可能是什么问题?谢谢。

编辑:仅供参考:

> 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

【问题讨论】:

    标签: memory r segmentation-fault html-parsing


    【解决方案1】:

    我认为几乎按照定义,分段错误构成了错误。 你的例子对我有用(见下文)。

    我会 (a) 确保您拥有最新版本的 XML 并且错误 仍然在那里发生; (b) 联系 XML 包的维护者(试试

    维护者(“XML”) ) 并提供您的示例和 sessionInfo() 的结果

    祝你好运。

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

    库(XML) 一个 http://bm2.genes.nig.ac.jp/RGM2/R_current/library/XML/man/xmlTreeParse.html")

    会话信息() 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=en_US.UTF-8
    [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8
    [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
    [9] LC_ADDRESS=C LC_TELEPHONE=C
    [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

    附加的基础包: [1] 统计图形 grDevices 实用程序数据集网格方法
    [8] 基地

    其他附加包: [1] XML_3.1-0 reshape_0.8.3 plyr_1.0.3 proto_0.3-8

    通过命名空间加载(未附加): [1] ggplot2_0.8.8

    【讨论】:

    • 糟糕,我看到您确实指定了您的 XML 版本(这似乎是最新的)
    • 谢谢本。联系包的创建者可能是最好的选择。
    猜你喜欢
    • 2018-08-17
    • 2022-01-22
    • 2013-07-29
    • 2015-11-04
    • 2015-08-11
    • 2014-12-30
    • 1970-01-01
    • 1970-01-01
    • 2016-09-13
    相关资源
    最近更新 更多