[rkward-cvs] rkward/rkward/rbackend rembedinternal.cpp,1.37,1.38

Thomas Friedrichsmeier tfry at users.sourceforge.net
Mon Apr 17 12:10:37 UTC 2006


Update of /cvsroot/rkward/rkward/rkward/rbackend
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16198

Modified Files:
	rembedinternal.cpp 
Log Message:
Adding HACK and testcode for stack-checking problem with R 2.3.0. Hopefully, we can remove it again very soon

Index: rembedinternal.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rbackend/rembedinternal.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** rembedinternal.cpp	11 Apr 2006 16:48:14 -0000	1.37
--- rembedinternal.cpp	17 Apr 2006 12:10:35 -0000	1.38
***************
*** 36,40 ****
  #include <stdlib.h>
  #include <string.h>
! //#include <sys/types.h>
  //#include <signal.h>
  //#include <unistd.h>
--- 36,41 ----
  #include <stdlib.h>
  #include <string.h>
! #include <sys/resource.h>
! #include <sys/types.h>
  //#include <signal.h>
  //#include <unistd.h>
***************
*** 340,348 ****
  
  bool REmbedInternal::startR (int argc, char** argv) {
! 	if (Rf_initEmbeddedR(argc, argv) < 0) {
! 		return false;
! 	}
  
! 	return true;
  }
  
--- 341,361 ----
  
  bool REmbedInternal::startR (int argc, char** argv) {
! 	// TODO: hopefully we don't need the HACK portions below. If R 2.3.0 goes unfixed, however, this should at least work in most cases (if no hard ulimit -s is set)
  
! 	int teststack;
! 	printf ("startR %lx\n", &teststack);
! 	// HACK to disable Rs method of stack checking
! 	struct rlimit rlimhack;
! 	rlimhack.rlim_cur = rlimhack.rlim_max = (unsigned long)-1;
! 	struct rlimit rlimsave;
! 	getrlimit (RLIMIT_STACK, &rlimsave);
! 	setrlimit (RLIMIT_STACK, &rlimhack);
! 
! 	bool ok = (Rf_initEmbeddedR (argc, argv) >= 0);
! 
! 	// HACK part 2: now reinstantiate standard stack checking
! 	setrlimit (RLIMIT_STACK, &rlimsave);
! 
! 	return ok;
  }
  





More information about the rkward-tracker mailing list