[Rd] Intermittent crashes with inset `[<-` command
Travers Ching
tr@ver@c @end|ng |rom gm@||@com
Wed Feb 27 20:48:12 CET 2019
On an azure centos VM, I can reproduce this bug which reports either:
*** caught segfault ***
address 0x70000006a, cause 'memory not mapped' (crash)
Or
incompatible types (from builtin to integer) in subassignment type fix
(no crash)
Like Gabriel, I could not reproduce the bug on a mac laptop. Both R
versions 3.5.1.
Travers
On Wed, Feb 27, 2019 at 9:08 AM William Dunlap via R-devel
<r-devel using r-project.org> wrote:
>
> Valgrind (without gctorture) reports memory misuse:
>
> % R --debugger=valgrind --debugger-args="--leak-check=full --num-callers=18"
> ...
> > x <- 1:200000
> > y <- rep(letters[1:5], length(x) / 5L)
> > for (i in 1:1000) {
> + # x[y == 'a'] <- x[y == 'b']
> + x <- `[<-`(x, y == 'a', x[y == 'b'])
> + cat(i, '')
> + }
> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
> 29 30 31 32 33 34 35 36 37 ==4711== Invalid read of size 1
> ==4711== at 0x501A40F: Rf_xlength (Rinlinedfuns.h:542)
> ==4711== by 0x501A40F: VectorAssign (subassign.c:658)
> ==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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Address 0x19b3ab90 is 0 bytes inside a block of size 160,048
> free'd
> ==4711== at 0x4C2ACBD: free (vg_replace_malloc.c:530)
> ==4711== by 0x4FAFCB2: ReleaseLargeFreeVectors (memory.c:1055)
> ==4711== by 0x4FAFCB2: RunGenCollect (memory.c:1825)
> ==4711== by 0x4FAFCB2: R_gc_internal (memory.c:2998)
> ==4711== by 0x4FB166F: Rf_allocVector3 (memory.c:2682)
> ==4711== by 0x4FB2310: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x4FB2310: R_alloc (memory.c:2197)
> ==4711== by 0x5023F7A: logicalSubscript (subscript.c:575)
> ==4711== by 0x5026DA3: Rf_makeSubscript (subscript.c:994)
> ==4711== by 0x501A2F3: VectorAssign (subassign.c:656)
> ==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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Block was alloc'd at
> ==4711== at 0x4C29BC3: malloc (vg_replace_malloc.c:299)
> ==4711== by 0x4FB1B04: Rf_allocVector3 (memory.c:2712)
> ==4711== by 0x5027574: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x5027574: Rf_ExtractSubset (subset.c:115)
> ==4711== by 0x502ADCD: VectorSubset (subset.c:198)
> ==4711== by 0x502ADCD: do_subset_dflt (subset.c:823)
> ==4711== by 0x502BE90: do_subset (subset.c:661)
> ==4711== by 0x4F7741C: Rf_eval (eval.c:691)
> ==4711== by 0x4F7BAC3: Rf_evalListKeepMissing (eval.c:2955)
> ==4711== by 0x50200CB: R_DispatchOrEvalSP (subassign.c:1535)
> ==4711== by 0x50200CB: do_subassign (subassign.c:1567)
> ==4711== by 0x4F66398: bcEval (eval.c:6795)
> ==4711== by 0x4F7D86D: R_compileAndExecute (eval.c:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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 8
> ==4711== at 0x501A856: XLENGTH_EX (Rinlinedfuns.h:189)
> ==4711== by 0x501A856: Rf_xlength (Rinlinedfuns.h:554)
> ==4711== by 0x501A856: VectorAssign (subassign.c:658)
> ==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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Address 0x19b3abb0 is 32 bytes inside a block of size 160,048
> free'd
> ==4711== at 0x4C2ACBD: free (vg_replace_malloc.c:530)
> ==4711== by 0x4FAFCB2: ReleaseLargeFreeVectors (memory.c:1055)
> ==4711== by 0x4FAFCB2: RunGenCollect (memory.c:1825)
> ==4711== by 0x4FAFCB2: R_gc_internal (memory.c:2998)
> ==4711== by 0x4FB166F: Rf_allocVector3 (memory.c:2682)
> ==4711== by 0x4FB2310: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x4FB2310: R_alloc (memory.c:2197)
> ==4711== by 0x5023F7A: logicalSubscript (subscript.c:575)
> ==4711== by 0x5026DA3: Rf_makeSubscript (subscript.c:994)
> ==4711== by 0x501A2F3: VectorAssign (subassign.c:656)
> ==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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Block was alloc'd at
> ==4711== at 0x4C29BC3: malloc (vg_replace_malloc.c:299)
> ==4711== by 0x4FB1B04: Rf_allocVector3 (memory.c:2712)
> ==4711== by 0x5027574: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x5027574: Rf_ExtractSubset (subset.c:115)
> ==4711== by 0x502ADCD: VectorSubset (subset.c:198)
> ==4711== by 0x502ADCD: do_subset_dflt (subset.c:823)
> ==4711== by 0x502BE90: do_subset (subset.c:661)
> ==4711== by 0x4F7741C: Rf_eval (eval.c:691)
> ==4711== by 0x4F7BAC3: Rf_evalListKeepMissing (eval.c:2955)
> ==4711== by 0x50200CB: R_DispatchOrEvalSP (subassign.c:1535)
> ==4711== by 0x50200CB: do_subassign (subassign.c:1567)
> ==4711== by 0x4F66398: bcEval (eval.c:6795)
> ==4711== by 0x4F7D86D: R_compileAndExecute (eval.c:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Address 0x19b3ab90 is 0 bytes inside a block of size 160,048
> free'd
> ==4711== at 0x4C2ACBD: free (vg_replace_malloc.c:530)
> ==4711== by 0x4FAFCB2: ReleaseLargeFreeVectors (memory.c:1055)
> ==4711== by 0x4FAFCB2: RunGenCollect (memory.c:1825)
> ==4711== by 0x4FAFCB2: R_gc_internal (memory.c:2998)
> ==4711== by 0x4FB166F: Rf_allocVector3 (memory.c:2682)
> ==4711== by 0x4FB2310: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x4FB2310: R_alloc (memory.c:2197)
> ==4711== by 0x5023F7A: logicalSubscript (subscript.c:575)
> ==4711== by 0x5026DA3: Rf_makeSubscript (subscript.c:994)
> ==4711== by 0x501A2F3: VectorAssign (subassign.c:656)
> ==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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Block was alloc'd at
> ==4711== at 0x4C29BC3: malloc (vg_replace_malloc.c:299)
> ==4711== by 0x4FB1B04: Rf_allocVector3 (memory.c:2712)
> ==4711== by 0x5027574: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x5027574: Rf_ExtractSubset (subset.c:115)
> ==4711== by 0x502ADCD: VectorSubset (subset.c:198)
> ==4711== by 0x502ADCD: do_subset_dflt (subset.c:823)
> ==4711== by 0x502BE90: do_subset (subset.c:661)
> ==4711== by 0x4F7741C: Rf_eval (eval.c:691)
> ==4711== by 0x4F7BAC3: Rf_evalListKeepMissing (eval.c:2955)
> ==4711== by 0x50200CB: R_DispatchOrEvalSP (subassign.c:1535)
> ==4711== by 0x50200CB: do_subassign (subassign.c:1567)
> ==4711== by 0x4F66398: bcEval (eval.c:6795)
> ==4711== by 0x4F7D86D: R_compileAndExecute (eval.c:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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 0x501A4B4: Rf_xlength (Rinlinedfuns.h:542)
> ==4711== by 0x501A4B4: VectorAssign (subassign.c:672)
> ==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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Address 0x19b3ab90 is 0 bytes inside a block of size 160,048
> free'd
> ==4711== at 0x4C2ACBD: free (vg_replace_malloc.c:530)
> ==4711== by 0x4FAFCB2: ReleaseLargeFreeVectors (memory.c:1055)
> ==4711== by 0x4FAFCB2: RunGenCollect (memory.c:1825)
> ==4711== by 0x4FAFCB2: R_gc_internal (memory.c:2998)
> ==4711== by 0x4FB166F: Rf_allocVector3 (memory.c:2682)
> ==4711== by 0x4FB2310: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x4FB2310: R_alloc (memory.c:2197)
> ==4711== by 0x5023F7A: logicalSubscript (subscript.c:575)
> ==4711== by 0x5026DA3: Rf_makeSubscript (subscript.c:994)
> ==4711== by 0x501A2F3: VectorAssign (subassign.c:656)
> ==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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Block was alloc'd at
> ==4711== at 0x4C29BC3: malloc (vg_replace_malloc.c:299)
> ==4711== by 0x4FB1B04: Rf_allocVector3 (memory.c:2712)
> ==4711== by 0x5027574: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x5027574: Rf_ExtractSubset (subset.c:115)
> ==4711== by 0x502ADCD: VectorSubset (subset.c:198)
> ==4711== by 0x502ADCD: do_subset_dflt (subset.c:823)
> ==4711== by 0x502BE90: do_subset (subset.c:661)
> ==4711== by 0x4F7741C: Rf_eval (eval.c:691)
> ==4711== by 0x4F7BAC3: Rf_evalListKeepMissing (eval.c:2955)
> ==4711== by 0x50200CB: R_DispatchOrEvalSP (subassign.c:1535)
> ==4711== by 0x50200CB: do_subassign (subassign.c:1567)
> ==4711== by 0x4F66398: bcEval (eval.c:6795)
> ==4711== by 0x4F7D86D: R_compileAndExecute (eval.c:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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 8
> ==4711== at 0x501A573: XLENGTH_EX (Rinlinedfuns.h:189)
> ==4711== by 0x501A573: Rf_xlength (Rinlinedfuns.h:554)
> ==4711== by 0x501A573: VectorAssign (subassign.c:672)
> ==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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Address 0x19b3abb0 is 32 bytes inside a block of size 160,048
> free'd
> ==4711== at 0x4C2ACBD: free (vg_replace_malloc.c:530)
> ==4711== by 0x4FAFCB2: ReleaseLargeFreeVectors (memory.c:1055)
> ==4711== by 0x4FAFCB2: RunGenCollect (memory.c:1825)
> ==4711== by 0x4FAFCB2: R_gc_internal (memory.c:2998)
> ==4711== by 0x4FB166F: Rf_allocVector3 (memory.c:2682)
> ==4711== by 0x4FB2310: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x4FB2310: R_alloc (memory.c:2197)
> ==4711== by 0x5023F7A: logicalSubscript (subscript.c:575)
> ==4711== by 0x5026DA3: Rf_makeSubscript (subscript.c:994)
> ==4711== by 0x501A2F3: VectorAssign (subassign.c:656)
> ==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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Block was alloc'd at
> ==4711== at 0x4C29BC3: malloc (vg_replace_malloc.c:299)
> ==4711== by 0x4FB1B04: Rf_allocVector3 (memory.c:2712)
> ==4711== by 0x5027574: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x5027574: Rf_ExtractSubset (subset.c:115)
> ==4711== by 0x502ADCD: VectorSubset (subset.c:198)
> ==4711== by 0x502ADCD: do_subset_dflt (subset.c:823)
> ==4711== by 0x502BE90: do_subset (subset.c:661)
> ==4711== by 0x4F7741C: Rf_eval (eval.c:691)
> ==4711== by 0x4F7BAC3: Rf_evalListKeepMissing (eval.c:2955)
> ==4711== by 0x50200CB: R_DispatchOrEvalSP (subassign.c:1535)
> ==4711== by 0x50200CB: do_subassign (subassign.c:1567)
> ==4711== by 0x4F66398: bcEval (eval.c:6795)
> ==4711== by 0x4F7D86D: R_compileAndExecute (eval.c:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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 0x501C582: INTEGER_ELT (Rinlinedfuns.h:381)
> ==4711== by 0x501C582: VectorAssign (subassign.c:710)
> ==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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Address 0x19b3ab90 is 0 bytes inside a block of size 160,048
> free'd
> ==4711== at 0x4C2ACBD: free (vg_replace_malloc.c:530)
> ==4711== by 0x4FAFCB2: ReleaseLargeFreeVectors (memory.c:1055)
> ==4711== by 0x4FAFCB2: RunGenCollect (memory.c:1825)
> ==4711== by 0x4FAFCB2: R_gc_internal (memory.c:2998)
> ==4711== by 0x4FB166F: Rf_allocVector3 (memory.c:2682)
> ==4711== by 0x4FB2310: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x4FB2310: R_alloc (memory.c:2197)
> ==4711== by 0x5023F7A: logicalSubscript (subscript.c:575)
> ==4711== by 0x5026DA3: Rf_makeSubscript (subscript.c:994)
> ==4711== by 0x501A2F3: VectorAssign (subassign.c:656)
> ==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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Block was alloc'd at
> ==4711== at 0x4C29BC3: malloc (vg_replace_malloc.c:299)
> ==4711== by 0x4FB1B04: Rf_allocVector3 (memory.c:2712)
> ==4711== by 0x5027574: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x5027574: Rf_ExtractSubset (subset.c:115)
> ==4711== by 0x502ADCD: VectorSubset (subset.c:198)
> ==4711== by 0x502ADCD: do_subset_dflt (subset.c:823)
> ==4711== by 0x502BE90: do_subset (subset.c:661)
> ==4711== by 0x4F7741C: Rf_eval (eval.c:691)
> ==4711== by 0x4F7BAC3: Rf_evalListKeepMissing (eval.c:2955)
> ==4711== by 0x50200CB: R_DispatchOrEvalSP (subassign.c:1535)
> ==4711== by 0x50200CB: do_subassign (subassign.c:1567)
> ==4711== by 0x4F66398: bcEval (eval.c:6795)
> ==4711== by 0x4F7D86D: R_compileAndExecute (eval.c:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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 4
> ==4711== at 0x501C587: INTEGER_ELT (Rinlinedfuns.h:381)
> ==4711== by 0x501C587: VectorAssign (subassign.c:710)
> ==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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Address 0x19b3abc0 is 48 bytes inside a block of size 160,048
> free'd
> ==4711== at 0x4C2ACBD: free (vg_replace_malloc.c:530)
> ==4711== by 0x4FAFCB2: ReleaseLargeFreeVectors (memory.c:1055)
> ==4711== by 0x4FAFCB2: RunGenCollect (memory.c:1825)
> ==4711== by 0x4FAFCB2: R_gc_internal (memory.c:2998)
> ==4711== by 0x4FB166F: Rf_allocVector3 (memory.c:2682)
> ==4711== by 0x4FB2310: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x4FB2310: R_alloc (memory.c:2197)
> ==4711== by 0x5023F7A: logicalSubscript (subscript.c:575)
> ==4711== by 0x5026DA3: Rf_makeSubscript (subscript.c:994)
> ==4711== by 0x501A2F3: VectorAssign (subassign.c:656)
> ==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:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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== Block was alloc'd at
> ==4711== at 0x4C29BC3: malloc (vg_replace_malloc.c:299)
> ==4711== by 0x4FB1B04: Rf_allocVector3 (memory.c:2712)
> ==4711== by 0x5027574: Rf_allocVector (Rinlinedfuns.h:577)
> ==4711== by 0x5027574: Rf_ExtractSubset (subset.c:115)
> ==4711== by 0x502ADCD: VectorSubset (subset.c:198)
> ==4711== by 0x502ADCD: do_subset_dflt (subset.c:823)
> ==4711== by 0x502BE90: do_subset (subset.c:661)
> ==4711== by 0x4F7741C: Rf_eval (eval.c:691)
> ==4711== by 0x4F7BAC3: Rf_evalListKeepMissing (eval.c:2955)
> ==4711== by 0x50200CB: R_DispatchOrEvalSP (subassign.c:1535)
> ==4711== by 0x50200CB: do_subassign (subassign.c:1567)
> ==4711== by 0x4F66398: bcEval (eval.c:6795)
> ==4711== by 0x4F7D86D: R_compileAndExecute (eval.c:1407)
> ==4711== by 0x4F7DA70: do_for (eval.c:2185)
> ==4711== by 0x4F7741C: 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==
> 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
> ...
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
>
> On Wed, Feb 27, 2019 at 12:31 AM Gabriel Becker <gabembecker using gmail.com>
> wrote:
>
> > Hi Brian,
> >
> > I don't have a windows machine, but on a modern macbook pro I'm not able to
> > get this to crash in 3.5.1 or a very recent built-from-source R-devel. I
> > increased the length of x by 2 orders of magnitude but that just made the
> > loop take a lot longer to successfully run in both R versions i tested.
> >
> > So seems like there is some OS/machine dependency at work here (?).
> >
> > Best,
> > ~G
> >
> > On Wed, Feb 27, 2019 at 12:01 AM Brian Montgomery via R-devel <
> > r-devel using r-project.org> wrote:
> >
> > > 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 below it works correctly
> > > (prints out 1:1000 and ends normally) every time.
> > >
> > > x <- 1:200000
> > > y <- rep(letters[1:5], length(x) / 5L)
> > > for (i in 1:1000) {
> > > # x[y == 'a'] <- x[y == 'b']
> > > x <- `[<-`(x, y == 'a', x[y == 'b'])
> > > cat(i, '')
> > > }
> > > cat('\n')
> > >
> > > The point of using this syntax is to make it work better with pipes, but
> > > the errors occur without pipes or magrittr.
> > >
> > > Thank you for your help!
> > >
> > > ______________________________________________
> > > R-devel using r-project.org mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-devel
> > >
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-devel using r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
More information about the R-devel
mailing list