search for: cntxt

Displaying 20 results from an estimated 71 matches for "cntxt".

2024 Apr 25
1
Big speedup in install.packages() by re-using connections
...seObject((SEXP)sentinel); +} +static CURLM *get_mhnd(void) +{ + if (!mhnd_sentinel) { + SEXP sentinel = PROTECT(R_MakeExternalPtr(NULL, R_NilValue, R_NilValue)); + R_PreserveObject(sentinel); + UNPROTECT(1); + // Avoid leaking the sentinel before setting the finalizer + RCNTXT cntxt; + begincontext(&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 n...
2011 Jun 28
1
doMC - compiler - concatenate an expression vector into a single expression?
...expression instead of the original R expression: # from doMC:::doMC ... c.expr <- comp(expr, env = envir, options = list(suppressUndefined = TRUE)) and for R >= 2.13.0 comp is defined as compiler::compile: function (e, env = .GlobalEnv, options = NULL) { cenv <- makeCenv(env) cntxt <- make.toplevelContext(cenv, options) cntxt$env <- addCenvVars(cenv, findLocals(e, cntxt)) genCode(e, cntxt) } <environment: namespace:compiler> My guess is that the function findLocals or genCode can not handle a 2-length expression vector. Maybe somebody who knows the in...
2023 Feb 11
1
scan(..., skip=1e11): infinite loop; cannot interrupt
..., SEXP op, SEXP args, SEXP rho) { SEXP ans, file, sep, what, stripwhite, dec, quotes, comstr; - int c, flush, fill, blskip, multiline, escapes, skipNul; + int c = 0, flush, fill, blskip, multiline, escapes, skipNul; R_xlen_t nmax, nlines, nskip; const char *p, *encoding; RCNTXT cntxt; @@ -952,7 +952,7 @@ if(!data.con->canread) error(_("cannot read from this connection")); } - for (R_xlen_t i = 0; i < nskip; i++) /* MBCS-safe */ + for (R_xlen_t i = 0; i < nskip && c != R_EOF; i++) /* MBCS-safe */ while ((c = scanchar(FALSE, &...
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
...c CURLM *get_mhnd(void) > +{ > + if (!mhnd_sentinel) { > + SEXP sentinel = PROTECT(R_MakeExternalPtr(NULL, R_NilValue, R_NilValue)); > + R_PreserveObject(sentinel); > + UNPROTECT(1); > + // Avoid leaking the sentinel before setting the finalizer > + RCNTXT cntxt; > + begincontext(&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);...
2005 Jan 31
1
A neat "hot seating" mplementation
Has anyone implemented "hot seating" in any neat way? This where people can log in to any phone in the company and have their calls/voicemail come to that particular handset.....
2011 Jun 29
0
[R-sig-hpc] doMC - compiler - concatenate an expression vector into a single expression?
...m doMC:::doMC ... >> c.expr<- comp(expr, env = envir, options = list(suppressUndefined = TRUE)) >> >> and for R>= 2.13.0 comp is defined as compiler::compile: >> function (e, env = .GlobalEnv, options = NULL) >> { >> cenv<- makeCenv(env) >> cntxt<- make.toplevelContext(cenv, options) >> cntxt$env<- addCenvVars(cenv, findLocals(e, cntxt)) >> genCode(e, cntxt) >> } >> <environment: namespace:compiler> >> >> My guess is that the function findLocals or genCode can not handle a >> 2-l...
2023 Mar 13
0
scan(..., skip=1e11): infinite loop; cannot interrupt
...>???????SEXP?ans,?file,?sep,?what,?stripwhite,?dec,?quotes,?comstr; >?-????int?c,?flush,?fill,?blskip,?multiline,?escapes,?skipNul; >?+????int?c?=?0,?flush,?fill,?blskip,?multiline,?escapes,?skipNul; >???????R_xlen_t?nmax,?nlines,?nskip; >???????const?char?*p,?*encoding; >???????RCNTXT?cntxt; >?@@?-952,7?+952,7?@@ >????????if(!data.con->canread) >????error(_("cannot?read?from?this?connection")); >????} >?-?for?(R_xlen_t?i?=?0;?i?<?nskip;?i++)?/*?MBCS-safe?*/ >?+?for?(R_xlen_t?i?=?0;?i?<?nskip?&&?c?!=?R_EOF;?i++)?/*?MBCS-safe?*/ >???...
2023 Feb 11
1
scan(..., skip=1e11): infinite loop; cannot interrupt
Hello, All: I have a 4.54 GB file that I'm trying to read in chunks using "scan(..., skip=__)". It works as expected for small values of "skip" but goes into an infinite loop for "skip=1e11" and similar large values of skip: I cannot even interrupt it; I must kill R. Below please find sessionInfo() with a toy example. My real problem is a large
2004 Oct 02
1
RCC compatibility patch
Would you consider the following patch to eval.c to allow compatibility with RCC? (It's in the applyClosure function.) @@ -432,6 +432,14 @@ SEXP f, a, tmp; RCNTXT cntxt; +#ifdef RCC + SEXP comp; + PROTECT(comp = getAttrib(op, install("RCC_CompiledSymbol"))); + if (comp != R_NilValue) /* compiled version exists */ + op = comp; + UNPROTECT(1); +#endif /* RCC */ + /* formals = list of formal parameters */ /* actuals = va...
2011 Nov 11
1
When collected warnings exceeds 50
...========================================== --- src/main/errors.c (revision 57624) +++ src/main/errors.c (working copy) @@ -333,8 +333,11 @@ char *tr; int nc; if(!R_CollectWarnings) setupwarnings(); - if( R_CollectWarnings > 49 ) + if( R_CollectWarnings > 49 ) { + endcontext(&cntxt); + inWarning = 0; return; + } SET_VECTOR_ELT(R_Warnings, R_CollectWarnings, call); Rvsnprintf(buf, min(BUFSIZE, R_WarnLength+1), format, ap); if(R_WarnLength < BUFSIZE - 20 && strlen(buf) == R_WarnLength) This fix eliminates the "Invalid read" errors, but I...
2009 Mar 03
1
profiler and loops
...t;, TYPEOF(fun) == SYMSXP ? CHAR(PRINTNAME(fun)) : "<Anonymous>"); } } so we can see it only cares about context CTXT_FUNCTION and CTXT_BUILTIN, when for loops play with CTXT_LOOP (this is again in eval.c within the do_for function) begincontext(&cntxt, CTXT_LOOP, R_NilValue, rho, R_BaseEnv, R_NilValue, R_NilValue); which as the name implies, begins the context of the for loop. The begincontext function looks like this : void begincontext(RCNTXT * cptr, int flags, SEXP syscall, SEXP env, SEXP sysp, SEXP promargs, SEX...
2009 Apr 09
0
bug/suggestion: debugger should respect option "deparse.max.lines" when printing the call (PR#13647)
...src/main/eval.c R-2.8.1-patched/src/main/eval.c *** R-2.8.1/src/main/eval.c 2008-10-05 18:05:02.000000000 -0400 --- R-2.8.1-patched/src/main/eval.c 2009-04-09 09:45:03.000000000 -0400 *************** *** 526,531 **** --- 526,532 ---- volatile SEXP newrho; SEXP f, a, tmp; RCNTXT cntxt; + int itmp; /* formals = list of formal parameters */ /* actuals = values to be bound to formals */ *************** *** 609,615 **** --- 610,621 ---- SET_DEBUG(newrho, DEBUG(op)); if (DEBUG(op)) { Rprintf("debugging in: "); + + itmp = a...
2002 Apr 11
1
segmentation violation when closing the data entry window (PR#1453)
...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)
...ad.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:53:10.00000...
2017 Oct 24
0
Crash in CentOS 7 kernel-3.10.0-514.16.1.el7.x86_64 in Xen PV mode
...0.000000] Kernel command line: console=hvc0 xencons=tty0 root=/dev/xvda1 ro LANG=en_CA.UTF-8 elevator=noop nohz=off [ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes) [ 0.000000] x86/fpu: xstate_offset[2]: 0240, xstate_sizes[2]: 0100 [ 0.000000] xsave: enabled xstate_bv 0x7, cntxt size 0x340 using standard form [ 0.000000] Memory: 989236k/1048576k available (6954k kernel code, 388k absent, 58952k reserved, 4575k data, 1768k init) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 [ 0.000000] Hierarchical RCU implementation. [ 0.000000] RCU...
2015 May 09
4
Bug#784810: Xen domU try ton access to dom0 LVM Volume group
...0.000000] Built 1 zonelists in Node order, mobility grouping on. Total pages: 32202 [ 0.000000] Policy zone: DMA32 [ 0.000000] Kernel command line: root=/dev/xvda2 ro elevator=noop [ 0.000000] PID hash table entries: 512 (order: 0, 4096 bytes) [ 0.000000] xsave: enabled xstate_bv 0x7, cntxt size 0x340 [ 0.000000] AGP: Checking aperture... [ 0.000000] AGP: No AGP bridge found [ 0.000000] Memory: 64992K/130684K available (5207K kernel code, 946K rwdata, 1832K rodata, 1204K init, 840K bss, 65692K reserved) [ 0.000000] Hierarchical RCU implementation. [ 0.000000] RCU dy...
2018 Jan 09
0
Centos 7 Kernel 3.10.0-693.11.6.el7.x86_64 does not boot PV
...pages: 1032074 [ 0.000000] Policy zone: DMA32 [ 0.000000] Kernel command line: root=/dev/xvda1 root=/dev/xvda1 [ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes) [ 0.000000] x86/fpu: xstate_offset[2]: 0240, xstate_sizes[2]: 0100 [ 0.000000] xsave: enabled xstate_bv 0x7, cntxt size 0x340 using standard form [ 0.000000] Memory: 2194120k/4194304k available (6984k kernel code, 388k absent, 116588k reserved, 4581k data, 1800k init) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1 [ 0.000000] x86/pti: Xen PV detected, disabling PTI protection [...
2017 Oct 24
2
Crash in CentOS 7 kernel-3.10.0-514.16.1.el7.x86_64 in Xen PV mode
On Tue, Oct 24, 2017 at 3:36 AM, Akemi Yagi <amyagi at gmail.com> wrote: > On Mon, Oct 23, 2017 at 11:08 PM, Akemi Yagi <amyagi at gmail.com> wrote: > >> On Mon, Oct 23, 2017 at 12:57 PM, Karl Johnson <karljohnson.it at gmail.com> >> wrote: >> >>> On Sat, May 20, 2017 at 8:30 PM, Sarah Newman <srn at prgmr.com> wrote: >>>
2018 Oct 29
2
guestfs launch failed in CentOS 7.5
...uarts=1 root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=xterm [ 0.000000] Disabling memory control group subsystem [ 0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes) [ 0.000000] x86/fpu: xstate_offset[2]: 0240, xstate_sizes[2]: 0100 [ 0.000000] xsave: enabled xstate_bv 0x7, cntxt size 0x340 using standard form [ 0.000000] Memory: 480520k/511984k available (7348k kernel code, 392k absent, 31072k reserved, 6281k data, 1844k init) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] x86/pti: Unmapping kernel while in userspace [ 0.0000...