Displaying 8 results from an estimated 8 matches for "subassigntypefix".
2024 Apr 05
1
Bug in out-of-bounds assignment of list object to expression() vector
...disappears if a prior attempt is made at
> assigning to the same index, using a different incompatible object
> that does not share this bug (like a function)
Here's how the problem happens:
1. The call lands in src/main/subassign.c, do_subassign2_dflt().
2. do_subassign2_dflt() calls SubassignTypeFix() to prepare the operand
for the assignment.
3. Since the assignment is "stretching", SubassignTypeFix() calls
EnlargeVector() to provide the space for the assignment.
The bug relies on `x` not being IS_GROWABLE(), which may explain
why a plain x[[4]] <- list() sometimes doesn't...
2024 Apr 05
1
[External] Re: Bug in out-of-bounds assignment of list object to expression() vector
...ade at
>> assigning to the same index, using a different incompatible object
>> that does not share this bug (like a function)
>
> Here's how the problem happens:
>
> 1. The call lands in src/main/subassign.c, do_subassign2_dflt().
>
> 2. do_subassign2_dflt() calls SubassignTypeFix() to prepare the operand
> for the assignment.
>
> 3. Since the assignment is "stretching", SubassignTypeFix() calls
> EnlargeVector() to provide the space for the assignment.
>
> The bug relies on `x` not being IS_GROWABLE(), which may explain
> why a plain x[[4]] &l...
2024 Apr 05
3
Bug in out-of-bounds assignment of list object to expression() vector
There seems to be a bug in out-of-bounds assignment of list objects to an
expression() vector. Tested on release and devel. (Many thanks to folks
over at Mastodon for the help narrowing down this bug)
When assigning a list into an existing index, it correctly errors on
incompatible type, and the expression vector is unchanged:
```
x <- expression(a,b,c)
x[[3]] <- list() # Error
x
#>
2012 Feb 21
0
Help with debugging message
...n't large at all. That return process never completes ---
infinite wait.
Kill it with cntrl\, claims to have died in Rf_alloc :
==5420==
==5420== Process terminating with default action of signal 3 (SIGQUIT)
==5420== at 0x4D14695: Rf_allocVector (memory.c:2445)
==5420== by 0x4D8FCAC: SubassignTypeFix (subassign.c:113)
==5420== by 0x4D91146: do_subassign2_dflt (subassign.c:1568)
==5420== by 0x4D92012: do_subassign2 (subassign.c:1451)
==5420== by 0x4CD940D: Rf_eval (eval.c:469)
==5420== by 0x4CDBEB6: do_set (eval.c:1724)
==5420== by 0x4CD940D: Rf_eval (eval.c:469)
==5420== by 0x...
2004 Nov 01
0
(PR#7326)(inappropriate) manipulation of expression objects
...or names or constants). To wit:
>
> > x <- list(1,2,3)
> > x[2] <- 1
> > x
> [[1]]
> [1] 1
>
> [[2]]
> [1] 1
>
> [[3]]
> [1] 3
That's not the issue: VectorAssign has identical code for the vector list
and expression cases. The issue is in SubassignTypeFix which says
case 2010: /* expression <- logical */
/* Note : No coercion is needed here. */
/* We just insert the RHS into the LHS. */
/* FIXME: is this true or should it be just like the "vector" case? */
and at level=1 the FIXME is correct.
Brian
--
Brian D. Ripley,...
2019 Feb 27
2
Intermittent crashes with inset `[<-` command
...741C: Rf_eval (eval.c:691)
==4711== by 0x4FA7181: Rf_ReplIteration (main.c:258)
==4711== by 0x4FA7570: R_ReplConsole (main.c:308)
==4711== by 0x4FA760E: run_Rmainloop (main.c:1082)
==4711== by 0x40075A: main (Rmain.c:29)
==4711==
==4711== Invalid read of size 1
==4711== at 0x501997E: SubassignTypeFix (subassign.c:318)
==4711== by 0x501A4A2: VectorAssign (subassign.c:666)
==4711== by 0x501CDFE: do_subassign_dflt (subassign.c:1641)
==4711== by 0x5020100: do_subassign (subassign.c:1571)
==4711== by 0x4F66398: bcEval (eval.c:6795)
==4711== by 0x4F7D86D: R_compileAndExecute (eval.c:14...
2019 Feb 27
0
Intermittent crashes with inset `[<-` command
...711== by 0x4FA7181: Rf_ReplIteration (main.c:258)
> ==4711== by 0x4FA7570: R_ReplConsole (main.c:308)
> ==4711== by 0x4FA760E: run_Rmainloop (main.c:1082)
> ==4711== by 0x40075A: main (Rmain.c:29)
> ==4711==
> ==4711== Invalid read of size 1
> ==4711== at 0x501997E: SubassignTypeFix (subassign.c:318)
> ==4711== by 0x501A4A2: VectorAssign (subassign.c:666)
> ==4711== by 0x501CDFE: do_subassign_dflt (subassign.c:1641)
> ==4711== by 0x5020100: do_subassign (subassign.c:1571)
> ==4711== by 0x4F66398: bcEval (eval.c:6795)
> ==4711== by 0x4F7D86D: R_com...
2019 Feb 26
8
Intermittent crashes with inset `[<-` command
The following code crashes after about 300 iterations on my?x86_64-w64-mingw32?machine on R 3.5.2 --vanilla.??
Others have duplicated this (see?https://github.com/tidyverse/magrittr/issues/190?if necessary), but I don't know how machine/OS-dependent it may be.??
If it doesn't crash for you, please try increasing the length of the x vector.
Substituting the commented-out line for the one