[Rd] Lack of protection bug in current R release candidate
maechler at stat.math.ethz.ch
Mon Jun 15 14:38:56 CEST 2015
>>>>> Radford Neal <radford at cs.toronto.edu>
>>>>> on Sat, 13 Jun 2015 17:24:04 -0400 writes:
> The current R release candidate has a lack of protect bug
> (of very long standing)
[ but not really reported, right ? ]
> with respect to the
> R_print.na_string and R_print.na_string_noquote fields of
> the static R_print structure declared in Print.h. This
> shows up very occassionally as incorrect output from the
> following lines in reg-tests-2.R:
> x <- c("a", NA, "b")
> factor(x, exclude="")
> The solution (kludgy, but the whole concept is kludgy) is
> to forward R_print.na_string and R_print.na_string_noquote
> with the other "roots" in RunGenCollect (after the comment
> /* forward all roots */).
> Radford Neal
"Interesting" ... .. more serioulsy: Thank you, Radford!
As this about garbage collection, I found
I can pretty well reproduce the problem via
x <- c("a", NA, "b")
fx <- factor(x, exclude="")
r <- replicate(30, capture.output(print(fx)))
stopifnot(r[,1] == r)
# ^^^ fails because of bug
but the R 3.2.1 release candidate probably really cannot be
touched now, with something non-trivial like this.
We'd be *very* happy to get such problems during alpha or beta
testing phase (or even before).
More information about the R-devel