-- Originally posted by (AT sourceforge.net): xavidp -- -- This ticket was imported from http://sourceforge.net/p/rkward/bugs/67 on 2017-05-30 15:26:48 +0100 -- Hi: I guess I have some problem with my own R script for processing xml files \(through the usage of R4X package\). But the fact is that RKward crashes every time I attempt to run this script \(reporter.00.5.r, attached\), due to this part: \"xmlTreeParse\(xml\_r\)\" I get a prop screen with this error: \----------------------- \*\*\* caught segfault \*\*\* address 0x3e, cause \'memory not mapped\' \----------------------- However, when I run the same script reporter.00.5.r from the command line, with: Rscript reporter\_00.5.r the script seems to read the line with the \"hello\" output in the console, at least. Oh well, in case this can help the authors of rkward to improve the error detection and warnings for the user, instead of crashing the program. More details: RKward: 0.5.2. KDE: 4.4.2, OS: GNU/Linux \(Ubuntu Lucid 10.04\), R: 2.10.1 Fir this script to run, some extra R packages need to be installed: XML, R4X and their dependencies. The commands to install them are included \(commented\) in the reporter.00.5.r script, as weel as the linux dependencies for the xml package to install. -- Labels: data handling --
-- Originally posted by (AT sourceforge.net): xavidp -- reporter.00.5.r - the script with tproduces that error. The data file (in xml) will come in another attachment after this one. -- Created an attachment --
-- Originally posted by (AT sourceforge.net): xavidp -- R_test.xml - test file with xml format to be stored under the logs_test subdirectory, for the reporter script to work. -- Created an attachment --
Thanks for reporting. I can confirm the issue. The crash happens when RKWard tries to fetch the structure of the object "xml\_parsed" \(the result of an invalid xmlParseTree\(\), the one without validate=TRUE\). Of course, RKWard should not crash on such an object, but in fact we are not the only ones to blame: The object xml\_parsed is simply a broken R object, as also evidenced by str\(xml\_parsed\) \(which throws an error: subscript out of bounds\). Practically it should be possible to avoid the issue by simply using validate=TRUE in all calls to xmlParseTree\(\), thus, hopefully avoiding that a broken object is created in the first place. \---- Internals: The crash is in RKStructureGetter::getStructureWorker\(\), more specifically while fetching children of a regular container \(do\_cont == TRUE\) around lines 418-443. Always using the last of the three variants of subscripting in this block \(SEXP child = callSimpleFun2 \(double\_brackets\_fun, value, index, R\_BaseEnv\);\) seems to avoid the problem. Before using this unconditionally, we should really time the overhead esp. in package:datasets.
Hi again, the problem should be fixed in SVN \(http://p.sf.net/svn\), now. It would be nice, if you could test this, too. An updated binary packages for ubuntu is available from this PPA: https://launchpad.net/~rkward-devel/+archive/rkward-devel . Thanks for reporting.
- **assigned_to**: nobody --> tfry - **summary**: rkward crashes when working with xml files (R4X) --> FIXED IN SVN: CRASH with some objects created by XML package - **status**: open --> open-fixed
-- Originally posted by (AT sourceforge.net): xavidp -- Thanks heaps\! and you compiled it in a dev, branch for testing at launchpad\! And fixing so quickly\! Gorgeous\! You \(and rkward\) Rock, Thomas\! :-\) Many thanks, indeed.
-- Originally posted by (AT sourceforge.net): xavidp -- - **status**: open-fixed --> closed-fixed