New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caught segfault trying write_xml #80

Closed
njahn82 opened this Issue Apr 11, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@njahn82

njahn82 commented Apr 11, 2016

Caught segfault while trying to download a file with xml2::write_xml.

Here's the log:

tt <- rcrossref::cr_cn("10.5194/nhess-13-1285-2013", "crossref-tdm")
xml2::write_xml(tt, file = "~/Downloads/")

 *** caught segfault ***
address (nil), cause 'memory not mapped'

Traceback:
 1: .Call("xml2_doc_write", PACKAGE = "xml2", x, path)
 2: doc_write(x$doc, file)
 3: write_xml.xml_document(tt, file = "~/Downloads/")
 4: xml2::write_xml(tt, file = "~/Downloads/")
@jimhester

This comment has been minimized.

Member

jimhester commented May 12, 2016

I cannot reproduce this, note the file= parameter should be the path to the the file to write to, not the directory like in your example, perhaps that is the cause of the issue.

@jimhester jimhester closed this May 12, 2016

@njahn82

This comment has been minimized.

njahn82 commented May 12, 2016

Sorry, but I tried it with the path to a file and still get the segfault

> tt <- rcrossref::cr_cn("10.5194/nhess-13-1285-2013", "crossref-tdm")
> 
> xml2::write_xml(tt, file = "~/Downloads/test.xml")

 *** caught segfault ***
address (nil), cause 'memory not mapped'

Here's my session info

R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux stretch/sid

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

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

This comment has been minimized.

njahn82 commented May 12, 2016

Alright, it does not crash when I save the file in the current working directory.

Thanks!

@jimhester jimhester reopened this May 12, 2016

@jimhester

This comment has been minimized.

Member

jimhester commented May 12, 2016

I think we should probably support writing to arbitrary paths as well as in the current directory. I will leave this open to remind me to fix this.

jimhester added a commit to jimhester/xml2 that referenced this issue May 12, 2016

@hadley hadley closed this in #86 May 13, 2016

hadley added a commit that referenced this issue May 13, 2016

Merge pull request #86 from jimhester/bugfix/expand.path
Expand paths before passing to libxml2

Fixes #80.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment