at lines 651 & 653 (integer_binary function): if (code == DIVOP || code == POWOP) ans = allocVector(REALSXP, n); else ans = allocVector(INTSXP, n); There are calls to warningcall() later in the function, which can trigger garbbage collection. Looks like the typical scenario where it seemed pretty safe to not PROTECT in the original version of the function but became very unsafe 3 years later when the calls to warningcall() were added to the function. Cheers, H. -- Herv? Pag?s Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpages at fhcrc.org Phone: (206) 667-5791 Fax: (206) 667-1319
> From: Herv? Pag?s <hpages at fhcrc.org>> at lines 651 & 653 (integer_binary function): > > if (code == DIVOP || code == POWOP) > ans = allocVector(REALSXP, n); > else > ans = allocVector(INTSXP, n); > > There are calls to warningcall() later in the function, which can > trigger garbbage collection. > > Looks like the typical scenario where it seemed pretty safe to not > PROTECT in the original version of the function but became very > unsafe 3 years later when the calls to warningcall() were added to > the function.Note that there is also a problem with a possible warning from myfmod, which in turn is called from R_pow. The call of myfmod from R_pow should probably be replaced by something else, since as it is, the following undesirable behaviour occurs: > (-Inf)^(1e16) [1] Inf Warning message: probable complete loss of accuracy in modulus I think issuing a warning for this is probably not a good idea, but if a warning is issued, it certainly shouldn't be this one. Radford Neal
luke-tierney at uiowa.edu
2013-Jul-13 15:08 UTC
[Rd] missing PROTECT() in src/main/arithmetic.c
Thanks -- fixed in 63290 (trunk) and 63291 (patched). luke On Fri, 12 Jul 2013, Herv? Pag?s wrote:> at lines 651 & 653 (integer_binary function): > > if (code == DIVOP || code == POWOP) > ans = allocVector(REALSXP, n); > else > ans = allocVector(INTSXP, n); > > There are calls to warningcall() later in the function, which can > trigger garbbage collection. > > Looks like the typical scenario where it seemed pretty safe to not > PROTECT in the original version of the function but became very > unsafe 3 years later when the calls to warningcall() were added to > the function. > > Cheers, > H. > >-- Luke Tierney Chair, Statistics and Actuarial Science Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone: 319-335-3386 Department of Statistics and Fax: 319-335-3017 Actuarial Science 241 Schaeffer Hall email: luke-tierney at uiowa.edu Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu
Seemingly Similar Threads
- Control statements with condition with greater than one should give error (not just warning) [PATCH]
- When collected warnings exceeds 50
- 0 ^ NaN == Inf, why?
- Control statements with condition with greater than one should give error (not just warning) [PATCH]
- Control statements with condition with greater than one should give error (not just warning) [PATCH]