Radford Neal
2015-Jun-13 21:24 UTC
[Rd] Lack of protection bug in current R release candidate
The current R release candidate has a lack of protect bug (of very long standing) 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) 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
Martin Maechler
2015-Jun-15 12:38 UTC
[Rd] Lack of protection bug in current R release candidate
>>>>> 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) > 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 something like x <- c("a", NA, "b") fx <- factor(x, exclude="") gctorture2(2, 5) 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). Martin Maechler
Radford Neal
2015-Jun-15 14:11 UTC
[Rd] Lack of protection bug in current R release candidate
> > The current R release candidate has a lack of protect bug > > (of very long standing) > > [ but not really reported, right ? ]It's "long standing" because it exists in versions of R going back many years.> 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).I'm not sure what you mean to imply here, but for your information, I reported the bug to r-devel within about an hour of finding what caused it. (I'd noticed the symptoms a few days before, but hadn't isolated the cause.) Radford Neal