search for: unprotect

Displaying 20 results from an estimated 620 matches for "unprotect".

2003 Feb 12
1
`UNPROTECT' and `return'
Dear R experts, In all R functions written in C one must unprotect result before returning them: { ... UNPROTECT(1) /* unprotecting `ans' */ return ans; } Why does one shure that memory occupied by `ans' won't be used by R immediately after unprotecting? Ok, is the next construction also absolutely safe? { ... U...
2020 Jan 14
2
SRTP unprotect failed ...
Hi, I'm getting messages like res_srtp.c:395 ast_srtp_unprotect: SRTP unprotect failed with replay check failed (index too old), retrying == SRTP unprotect failed on SSRC 576693764 because of authentication failure 10 == SRTP unprotect failed on SSRC 576693764 because of authentication failure 160 [...] ... after a couple minutes during voice calls after...
1997 May 13
2
R-alpha: Patch2
There is a problem with the patch I sent out yesterday. The patches for the glm code are applied in the wrong place. I have removed the patch file and will have a real one available latter today. Ross =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help",
2006 Mar 27
1
Safe to UNPROTECT() when object is assigned to a list?
Hi, I'm troubleshooting some native code on Windows that very occationally (and semi-randomly) crashes R. Already looked at "everything", I just want to double check that it is safe to UNPROTECT() allocated variables as soon as they are assigned to, say, a PROTECTed list. >From (R v2.3.0) Section 5.7.1 "Handling the effects of garbage collection" in "Writing R Extensions": "In some cases it is necessary to keep better track of whether protection is really need...
2010 Apr 14
2
Why no race condition when returning UNPROTECT-ed memory from C?
Consider the C (or C++) code called from the .Call interface: SEXP foo() { SEXP *p = PROTECT(allocVector(REALSXP, 10)); ... UNPROTECT(1); return p; } Why is there no danger that the allocated memory will be garbage collected after the UNPROTECT, but before the return of p? I have used code like this for some time and have never had a problem, but I'm not sure if/why it is guaranteed to work. Thanks, Dominick [[alternat...
2006 May 17
1
protect/unprotect howto in C code
Hi, Im currently trying to debug a 'error in unprotect: stack imbalance' problem and I am curious about two basic questions on the use of PROTECT and UNPROTECT, which I could not figure out: - which objects have to be protected, namely, if the code is something like: SEXP fun, e; /* get the expression e ... */ fun = eval(e, R_GlobalEnv); /* or...
2010 Dec 24
5
SRTP unprotect: authentication failure
Hello! Ater several successful SRTP-enabled calls with SRTP set to Mandatory, asterisk starts to give the following warnings in Log: WARNING[13714] res_srtp.c: SRTP unprotect: authentication failure (continiously) and client hears no sound. After i restart the client program it works fine again for a while. Then the same warning again. Asterisk 1.8.1.1, RealTime engine, sip peer has encrytion->yes The client program is CSipSimple on Android Here are some log f...
2020 Jan 16
1
SRTP unprotect failed ...
On Thu, Jan 16, 2020 at 11:35 AM hw <hw at gc-24.de> wrote: > On Tuesday, January 14, 2020 5:29:04 PM CET hw wrote: > > Hi, > > > > I'm getting messages like > > > > > > res_srtp.c:395 ast_srtp_unprotect: SRTP unprotect failed with replay > check > > failed (index too old), retrying == SRTP unprotect failed on SSRC > 576693764 > > because of authentication failure 10 == SRTP unprotect failed on SSRC > > 576693764 because of authentication failure 160 [...] > > > &gt...
2020 Sep 11
4
Garbage collection of seemingly PROTECTed pairlist
...nt n) { SEXP out = PROTECT(Rf_allocVector(INTSXP, nc)); int *out_int = INTEGER(out); if (n <= 0 | n > nr) { for (int i = 0; i != nc; ++i) { out_int[i] = NA_INTEGER; } } else { for (int i = 0; i != nr; ++i) { out_int[i] = int_mat_int[n - 1 + i * nr]; } } UNPROTECT(1); return out;} SEXP C_make_len2_int_vec(int first, int second) { SEXP out = PROTECT(Rf_allocVector(INTSXP, 2)); int *out_int = INTEGER(out); out_int[0] = first; out_int[1] = second; UNPROTECT(1); return out;} SEXP C_fullocate(SEXP int_mat) { int nr = Rf_nrows(int_mat), *int_mat_...
2005 Mar 16
1
returning NULL from .Call call
...std::endl; return NULL; } // operation successful, but the size of data can be nil if(data == NULL) return NULL; SEXP result = allocVector(INTSXP, numOfDataPoints); PROTECT(result); // copy data from 'data' into 'result' delete[] data; UNPROTECT(1); return result; } This function will nicely return a data array if no load problems occur and data is more than nil. If it is not the case I would be happy to receive a NULL as indication that the function didn't succeed, which I can then check with is.nul(...). I would consider it l...
2004 Feb 11
1
.Call setAttrib(ans,R_DimSymbol,dim); Crashes.
...= NEW_NUMERIC(count*2)); memcpy(NUMERIC_POINTER(ans),result,count*sizeof(double)); memcpy(&(NUMERIC_POINTER(ans)[count]),occur,count*sizeof(double)); /** PROTECT(dim=NEW_INTEGER(2)); INTEGER_POINTER(dim)[0]=2; INTEGER_POINTER(dim)[1]=count; setAttrib(ans,R_DimSymbol,dim); */ UNPROTECT(7); If I uncomment the lines 5 to 8 than all is working fine four small count's (tested 10,20). But if the result is an array with about 2000 entries R crashes vicious and violently with the lax comment Process R trace trap at Wed Feb 11 13:55:45 2004 Anyone is seeiing something what I can n...
2020 Jan 16
0
SRTP unprotect failed ...
On Tuesday, January 14, 2020 5:29:04 PM CET hw wrote: > Hi, > > I'm getting messages like > > > res_srtp.c:395 ast_srtp_unprotect: SRTP unprotect failed with replay check > failed (index too old), retrying == SRTP unprotect failed on SSRC 576693764 > because of authentication failure 10 == SRTP unprotect failed on SSRC > 576693764 because of authentication failure 160 [...] > > > ... after a couple minutes...
2004 Dec 31
2
Am I opening myself to some security vulnerability if I unprotect the Controller classes'' redirect methods?
Am I opening myself to some security vulnerability if I unprotect the Controller classes'' redirect methods? I merrily wrote a (specific to my university) authentication filter as a separate class. As part of the authentication process it needs to re-direct the user to a university server to log in. This all works fine except that the redirect_to m...
2009 Nov 28
1
PROTECT and OCaml GC.
Hello. In the writing of my OCaml-R binding, I'm sort of confused when it comes to the use of the PROTECT and UNPROTECT macros. Basically, I have C stub functions that are in charge of calling R for everything. Here's a simple example: > CAMLprim value r_findvar (value symbol) { > /* The findVar function is defined in envir.c. It looks up a symbol > in an environment. */ > CAMLparam1(symb...
2014 Jun 24
2
using C code to create data frame but always return as list
...l_is_array(ret))  {   PROTECT(names=allocVector(STRSXP,collen));   for (i=0;i<jl_array_len(ret);i++)   {     onesymbol=jl_arrayref((jl_array_t*)ret,i);    if (jl_is_symbol(onesymbol))     SET_STRING_ELT(names,i,mkChar(((jl_sym_t*)onesymbol)->name));   }   setAttrib(ans,R_NamesSymbol,names);   UNPROTECT(1);  }   //set row names  sprintf(evalcmd,"size(%s,1)",dfname);  jl_value_t* rows=jl_eval_string(evalcmd);  int rowlen=jl_unbox_long(rows);  PROTECT(rownames=allocVector(INTSXP,rowlen));  for (i=0;i<rowlen;i++)   INTEGER(rownames)[i]=i+1;  setAttrib(ans,R_RowNamesSymbol,rownames);  UNP...
2005 Mar 17
1
unprotecting the first 64KB of memory to allow real-mode calls.
Hello, this is my first wine-time, and a lot of winprograms run "out of the box" Great! But there is a little DOS-program which does not run. Where can I look for the error? Thanks for any hint. geo@toso:~> wine "c:\Program Files\saft\saft.exe" Warning: unprotecting the first 64KB of memory to allow real-mode calls. NULL pointer accesses will no longer be caught. fixme:int:DOSVM_Int10Handler Get Font Information - Not Supported fixme:int:DOSVM_Int10Handler Select Active Display Page (0) - Not Supported Beste Gr??e Jochen ________________...
2011 May 26
1
[Bug 1909] New: "WARNING: UNPROTECTED PRIVATE KEY FILE!" warning needs an actionable step
https://bugzilla.mindrot.org/show_bug.cgi?id=1909 Summary: "WARNING: UNPROTECTED PRIVATE KEY FILE!" warning needs an actionable step Product: Portable OpenSSH Version: -current Platform: All OS/Version: All Status: NEW Severity: trivial Priority: P2 Component: ssh...
2009 Sep 20
1
Return a list from a .Call but segfaults
...TECT(KV = Rf_allocVector(VECSXP, 2)); r = reverseUInt(*((int*) rawdata)); //converts network order to host rawdata+=4; //yes, hard code size of int PROTECT(k= kk_(rawdata,r)); //deserializes data and returns a SEXP rawdata+= r; SET_VECTOR_ELT(KV,0, k); UNPROTECT(1); r = reverseUInt(*((int*) rawdata)); rawdata+=4; PROTECT(k= kk_(rawdata,r)); rawdata+=r; SET_VECTOR_ELT(KV,1, k); UNPROTECT(1); SET_VECTOR_ELT(rval,i,KV); UNPROTECT(1); } UNPROTECT(1); return(rval); } SEXP kk_(char...
2010 Aug 23
1
Speed improvement to PROTECT, UNPROTECT, etc.
As I mentioned in my previous message about speeding up evalList, I've been looking at ways to speed up the R interpreter. One sees in the code many, many calls of PROTECT, UNPROTECT, and related functions, so that seems like an obvious target for optimization. Indeed, I've found that one can speed up the interpreter by about 10% by just changing these. The functions are actually macros defined in Rinternals.h, but end up just calling functions defined in memory.c (appare...
2010 Jan 02
3
R-devel Digest, Vol 83, Issue 2
...est at r-project.org wrote: > > Hello, > > We are currently making lots of changes to Rcpp (see the open Rcpp > mailing list if interested [1] in the details). > > We are now using [2] R_PreserveObject and R_ReleaseObject to manage > garbage collection instead of the PROTECT/UNPROTECT dance. This seems to > work well, but I was wondering if there was documentation about it. The most precise technical documentation is in memory.c PROTECT is an alias for Rf_protect, itself an alias for SEXP protect(SEXP s); and uses a stack (R_PPStack) to store protected objects. > In part...