Displaying 7 results from an estimated 7 matches for "endcontext".
2011 Nov 11
1
When collected warnings exceeds 50
...grind:
R -d valgrind
> options(warn=0)
> for (i in 1:51) factor(1,levels=c(1,1) # duplicate level warningcall
and you should see "Invalid read" messages. I've narrowed it down to
vwarningcall_dflt starting a new R context via begincontext() but
returning early without calling endcontext() in errors.c:
svn diff src/main/errors.c
Index: src/main/errors.c
===================================================================
--- src/main/errors.c (revision 57624)
+++ src/main/errors.c (working copy)
@@ -333,8 +333,11 @@
char *tr; int nc;
if(!R_CollectWarnings)
setupwarnings(...
2024 Apr 25
1
Big speedup in install.packages() by re-using connections
...ncontext(&cntxt, CTXT_CCODE, R_NilValue, R_BaseEnv, R_BaseEnv,
+ R_NilValue, R_NilValue);
+ cntxt.cend = &rollback_mhnd_sentinel;
+ cntxt.cenddata = sentinel;
+ R_RegisterCFinalizerEx(sentinel, cleanup_mhnd, TRUE);
+ // Succeeded, no need to clean up if endcontext() fails allocation
+ mhnd_sentinel = sentinel;
+ cntxt.cend = NULL;
+ endcontext(&cntxt);
+ }
+ if(!shared_mhnd) {
+ shared_mhnd = curl_multi_init();
+ }
+ return shared_mhnd;
+}
+
# if LIBCURL_VERSION_MAJOR < 7 || (LIBCURL_VERSION_MAJOR == 7 && LIBCU...
2024 Apr 25
1
Big speedup in install.packages() by re-using connections
I'd like to raise this again now that 4.4 is out.
Below is a more complete patch which includes a function to properly
cleanup libcurl when R quits. Implementing this is a little tricky
because libcurl is a separate "module" in R, perhaps there is a better
way, but this works:
view: https://github.com/r-devel/r-svn/pull/166/files
patch:
2024 Sep 02
1
Big speedup in install.packages() by re-using connections
..._CCODE, R_NilValue, R_BaseEnv, R_BaseEnv,
> + R_NilValue, R_NilValue);
> + cntxt.cend = &rollback_mhnd_sentinel;
> + cntxt.cenddata = sentinel;
> + R_RegisterCFinalizerEx(sentinel, cleanup_mhnd, TRUE);
> + // Succeeded, no need to clean up if endcontext() fails allocation
> + mhnd_sentinel = sentinel;
> + cntxt.cend = NULL;
> + endcontext(&cntxt);
> + }
> + if(!shared_mhnd) {
> + shared_mhnd = curl_multi_init();
> + }
> + return shared_mhnd;
> +}
> +
> # if LIBCURL_VERSION_MAJO...
2000 Nov 07
0
error handling
...e way, this same approach doesn't work in the example above, which is
why I set up a context):
begincontext(&thiscontext, 0, CTXT_GENERIC, R_NilValue, R_NilValue,
R_NilValue);
R_GlobalContext->nextcontext = 0;
if (!SETJMP(thiscontext.cjmpbuf))
R_CurrentExpr = eval(R_CurrentExpr , rho);
endcontext(&thiscontext);
This code solves my problem, however, in certain cases my calling C++ client
application cannot catch the error (exception?) that is generated, and my
program hard crashes. (A bug in Visual Studio, I think.) For this reason,
using SETJMP(R_ToplevelContext->cjmpbuf) as in the...
2002 Apr 11
1
segmentation violation when closing the data entry window (PR#1453)
...XCloseDisplay(iodisplay);
(gdb)
1319 }
(gdb)
eventloop () at dataentry.c:1155
1155 done = 1;
(gdb)
1157 break;
(gdb)
1161 }
(gdb)
RX11_dataentry (call=0x850b7c0, op=0x8270afc, args=0x8bd4e84, rho=0x8bcd998)
at dataentry.c:312
312 endcontext(&cntxt);
(gdb)
313 closewin();
(gdb)
Breakpoint 1, closewin () at dataentry.c:1315
1315 printf("In routine closewin\n");
(gdb)
In routine closewin
1316 XFreeGC(iodisplay, iogc);
(gdb)
Program received signal SIGSEGV, Segmentation fault.
0x08bd750a in ?? ()...
2006 Oct 02
0
2.3.1: interacting bugs in load() and gzfile() (PR#9271)
.../src/main/saveload.c R-2.3.1/src/main/saveload.c
--- R-2.3.1.original/src/main/saveload.c 2006-04-09 18:19:51.000000000 -0400
+++ R-2.3.1/src/main/saveload.c 2006-10-02 13:10:21.000000000 -0400
@@ -2301,6 +2301,7 @@
PROTECT(res = RestoreToEnv(R_Unserialize(&in), aenv));
if (wasopen) {
endcontext(&cntxt);
+ } else {
con->close(con);
}
UNPROTECT(1);
for bug 2:
diff -u R-2.3.1.original/src/main/connections.c R-2.3.1/src/main/connections.c
--- R-2.3.1.original/src/main/connections.c 2006-05-18 05:13:54.000000000 -0400
+++ R-2.3.1/src/main/connections.c 2006-10-02 11:...