[rkward-tracker] [ rkward-Bugs-3002439 ] rkward crashes when working with xml files (R4X)
SourceForge.net
noreply at sourceforge.net
Mon May 17 10:40:08 UTC 2010
Bugs item #3002439, was opened at 2010-05-16 18:40
Message generated for change (Comment added) made by tfry
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=459007&aid=3002439&group_id=50231
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: data handling
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Xavier de Pedro (xavidp)
Assigned to: Nobody/Anonymous (nobody)
Summary: rkward crashes when working with xml files (R4X)
Initial Comment:
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.
----------------------------------------------------------------------
>Comment By: Thomas Friedrichsmeier (tfry)
Date: 2010-05-17 12:40
Message:
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.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=459007&aid=3002439&group_id=50231
More information about the rkward-tracker
mailing list