Cheers,
Konrad
On Mon, 15 Dec 2025 at 04:26, <luke-tierney at uiowa.edu> wrote:
On Sun, 14 Dec 2025, Simon Urbanek wrote:
> Konrad,
>
> I can reproduce this is current R-devel on any platform, so
this should be very easy to reproduce, it is not OS-specific at
all - all R-devel checks will flag it eventually. I would guess
this is from:
>
> r89121 | luke | 2025-12-09 04:28:24 +1300 (Tue, 09 Dec 2025) |
>
> Mark values returned by active binding functions as not
> prevent unintended mutation in complex assignments.
>
> So it looks like it is intentional. May need some discussion
on whether this requires some re-design of your package to make
it safer or if it is a valid use-cases that may need further
consideration.
Looks like it is a side effect of that bug fix that it is waking
up a
misfeature of the interpreted complex assignment code. The
compiled
version of the complex assignment code is cleaner and does not
have
this issue, so you could use
f <- function (value) {
? ? ?if (missing(value)) {
? ? ? ? ?evalq(x[1L, ], .GlobalEnv)
? ? ?} else {
? ? ? ? ?assign_expr <- substitute(x[1L, ] <- value, list(value
= value))
? ? ? ? ?cmp_assign_expr <- compiler::compile(assign_expr)
? ? ? ? ?eval(cmp_assign_expr, .GlobalEnv)
? ? ?}
}
Depending on how close this is to what you are really doing
Konrad,
you can also use .GlobalEnv$x and avoid eval():
f <- function (value) {
? ? ?if (missing(value))
? ? ? ? ?.GlobalEnv$x[1L, ]
? ? ?else
? ? ? ? ?.GlobalEnv$x[1L, ] <- value
}
I'll see if I can figure out what is going on in the interpreted
assignment code.
Best,
luke
>> On 15 Dec 2025, at 10:50, Konrad Rudolph
<konrad.rudolph at gmail.com> wrote:
>>
>> Hi all,
>>
>> One of my packages is failing on CRAN in R-devel [1], and I
>> to fix it. However, it is *only* failing on one specific
>> 'r-devel-linux-x86_64-debian-gcc'. All other combinations ?
>> Debian, both clang and GCC on Fedora, and Windows ? keep
>> As my package is not using compiled code or anything
>> loss to explain this highly specific failure. Before
>> container image with this specific configuration locally (?
>> configurations available as ready-made images?), I wanted to
>> was an obvious change in R-devel which might explain the
>>
>> There are two failures, both with the same error message:
>> value of locked binding for '*tmp*'?. My package?s code isn?t
>> directly change `*tmp*`, but it is using eval() to perform
>> assignment to a complex expression inside an active binding.
>> minimal code snippet that *should* be equivalent to one of
>> failures, and which should therefore also fail (in the last
>>
>>? ?x = data.frame(a = 1 : 2, b = c('a', 'b'))
>>
>>? ?f = function (value) {
>>? ? ?if (missing(value)) {
>>? ? ? ?evalq(x[1L, ], .GlobalEnv)
>>? ? ?} else {
>>? ? ? ?assign_expr = substitute(x[1L, ] <- value, list(value =
>>? ? ? ?eval(assign_expr, .GlobalEnv)
>>? ? ?}
>>? ?}
>>
>>? ?makeActiveBinding('ax', f, .GlobalEnv)
>>
>>? ?ax[1L] = 3L
>>
>> I had a look at the changes in in R-devel, but I couldn?t
>> obviously relevant. In particular, the code of
R_MakeActiveBinding() hasn?t
>> been touched in literally decades, and similar for the code
>> I understand) performs subset assignment, applydefine().
>>
>> Does anybody have an idea what might be going on here, or how
>> issue?
>>
>> Cheers,
>> Konrad
>>
>> [1]
--
Luke Tierney
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/
--
Konrad Rudolph