[rkward-cvs] SF.net SVN: rkward:[3880] trunk/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Oct 4 14:54:14 UTC 2011


Revision: 3880
          http://rkward.svn.sourceforge.net/rkward/?rev=3880&view=rev
Author:   tfry
Date:     2011-10-04 14:54:13 +0000 (Tue, 04 Oct 2011)
Log Message:
-----------
Place an arbitrary cap on the number of named child objects to analyze

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/rbackend/rkstructuregetter.cpp

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2011-10-04 14:34:22 UTC (rev 3879)
+++ trunk/rkward/ChangeLog	2011-10-04 14:54:13 UTC (rev 3880)
@@ -1,4 +1,5 @@
 --- Version 0.5.7 - Oct-XX-2011
+- Do not analyse more than 100000 name child-objects per object (avoids hangs on such extreme data)
 - Fix problems with using mclapply() inside RKWard
 - Offer to add a new library location, automatically, if location selected for installation is not writable
 - Reworked package installation / update dialog

Modified: trunk/rkward/rkward/rbackend/rkstructuregetter.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rkstructuregetter.cpp	2011-10-04 14:34:22 UTC (rev 3879)
+++ trunk/rkward/rkward/rbackend/rkstructuregetter.cpp	2011-10-04 14:54:13 UTC (rev 3880)
@@ -24,6 +24,8 @@
 
 #include "../debug.h"
 
+#define NAMED_CHILDREN_LIMIT 100000
+
 RKStructureGetter::RKStructureGetter (bool keep_evalled_promises) {
 	RK_TRACE (RBACKEND);
 
@@ -336,6 +338,10 @@
 		PROTECT (childnames_s);
 		QStringList childnames = RKRSupport::SEXPToStringList (childnames_s);
 		int childcount = childnames.size ();
+		if (childcount > NAMED_CHILDREN_LIMIT) {
+			RK_DO (qDebug ("object %s has %d named children. Will only retrieve the first %d", name.toLatin1().data (), childcount, NAMED_CHILDREN_LIMIT), RBACKEND, DL_WARNING);
+			childcount = NAMED_CHILDREN_LIMIT;
+		}
 
 		RData::RDataStorage children (childcount, 0);
 		for (int i = 0; i < childcount; ++i) {

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rkward-tracker mailing list