52North / sos4R

R client for the OGC Sensor Observation Service
https://52north.github.io/sos4R/
13 stars 13 forks source link

SOS function fails when pkgdown is loaded #76

Closed nuest closed 5 years ago

nuest commented 5 years ago

I wanted to re-build the pkgdown site and run into the following problem:

daniel@gin-nuest:~/git/sos4R$ R

R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library("sos4R")
Loading required package: XML
Loading required package: RCurl
Loading required package: bitops
Loading required package: sp
Loading required package: httr
Loading required package: stringr
> mySOS <- SOS(url = "http://sensorweb.demo.52north.org/sensorwebtestbed/service/kvp", binding = "KVP")
[sos4R] Created SOS for URL http://sensorweb.demo.52north.org/sensorwebtestbed/service/kvp 
> mySOS
Object of class SOS_1.0.0 [KVP, http://sensorweb.demo.52north.org/sensorwebtestbed/service/kvp, 52N SOS] 
> library("pkgdown")
> mySOS <- SOS(url = "http://sensorweb.demo.52north.org/sensorwebtestbed/service/kvp", binding = "KVP")
terminate called after throwing an instance of 'Rcpp::exception'
  what():  expected '>' [73]
Aborted (core dumped)

No idea what is going on here!

> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.1 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

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

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

other attached packages:
[1] pkgdown_1.3.0.9000 sos4R_0.3.0.9002   stringr_1.3.1      httr_1.4.0        
[5] sp_1.3-1           RCurl_1.95-4.11    bitops_1.0-6       XML_3.98-1.16     

loaded via a namespace (and not attached):
 [1] roxygen2_6.1.1  Rcpp_1.0.0      lattice_0.20-38 digest_0.6.18  
 [5] commonmark_1.7  MASS_7.3-51.1   grid_3.5.2      R6_2.3.0       
 [9] magrittr_1.5    rlang_0.3.1     stringi_1.2.4   fs_1.2.6       
[13] xml2_1.2.0      tools_3.5.2     compiler_3.5.2  memoise_1.1.0

Error also exists when trying out in container, and the Traceback is more helpful:

docker run --rm -it rocker/geospatial R

> devtools::install_github("nuest/sos4R", ref = "dev")
> install.packages("pkgdown")

[...]

> library("sos4R")
Loading required package: XML
Loading required package: RCurl
Loading required package: bitops
Loading required package: sp
Loading required package: httr
Loading required package: stringr
> mySOS <- SOS(url = "http://sensorweb.demo.52north.org/sensorwebtestbed/service/kvp", binding = "KVP")
[sos4R] Created SOS for URL http://sensorweb.demo.52north.org/sensorwebtestbed/service/kvp 
> mySOS
Object of class SOS_1.0.0 [KVP, http://sensorweb.demo.52north.org/sensorwebtestbed/service/kvp, 52N SOS] 
> library("pkgdown")
> mySOS <- SOS(url = "http://sensorweb.demo.52north.org/sensorwebtestbed/service/kvp", binding = "KVP")
terminate called after throwing an instance of 'Rcpp::exception'
  what():  expected '>' [73]

 *** caught segfault ***
address (nil), cause 'unknown'

Traceback:
 1: xmlParseDoc(file = .responseString, options = xmlParseOptions,     asText = TRUE)
 2: .getCapabilities_1.0.0(sos = sos, verbose = verbose, inspect = inspect,     sections = sections, acceptFormats = acceptFormats, updateSequence = updateSequence,     owsVersion = owsVersion, acceptLanguages = acceptLanguages)
 3: getCapabilities(sos = .sos, verbose = verboseOutput, ...)
 4: getCapabilities(sos = .sos, verbose = verboseOutput, ...)
 5: SOS(url = "http://sensorweb.demo.52north.org/sensorwebtestbed/service/kvp",     binding = "KVP")

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace

Problem seems to be with the XML package in combination with Rcpp attached... installing Rcpp_1.0.0.1 from GitHub does not solve the problem.


@EHJ-52n Can you please try to replicate?

EHJ-52n commented 5 years ago

I could replicate this on my system.

nuest commented 5 years ago

Wil be closed by #42