EMCluster icon indicating copy to clipboard operation
EMCluster copied to clipboard

CRAN packages using uninitialised values

Open snoweye opened this issue 5 years ago • 1 comments

From Prof Brian Ripley on Mar 7, 2021:

All of these are from within the package and using values which were never initialized or already freed. Some are showing other issues which look a consequence of this.

Please correct as soon as possible and before Apr 7 to safely retain the package on CRAN.

==3788493== Memcheck, a memory error detector ==3788493== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==3788493== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info ==3788493== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R --vanilla ==3788493==

R Under development (unstable) (2021-03-03 r80061) -- "Unsuffered Consequences" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

** Examples

library(EMCluster, quietly = TRUE) set.seed(1234) x1 <- da1$da

emobj <- emgroup(x1, nclass = 10) summary(emobj) Method: svd.kmeans.em n = 500, p = 2, nclass = 10, flag = 0, total parameters = 59, conv.iter = 10, conv.eps = 9.218137e-07, logL = -5657.6121, AIC = 11433.2242, BIC = 11681.8861. nc: [1] 42 99 35 38 49 39 57 51 43 47 pi: [1] 0.08462 0.19800 0.07000 0.07600 0.09783 0.07837 0.11408 0.10160 0.08637 [10] 0.09313

ret.0 <- starts.via.svd(x1, nclass = 10, method = "kmeans") ==3788493== Conditional jump or move depends on uninitialised value(s) ==3788493== at 0x5AE183: rsum (svn/R-devel/src/main/summary.c:165) ==3788493== by 0x5AF8AB: do_summary (svn/R-devel/src/main/summary.c:832) ==3788493== by 0x4D3566: bcEval (svn/R-devel/src/main/eval.c:7115) ==3788493== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==3788493== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==3788493== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==3788493== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==3788493== by 0x4F4299: do_set (svn/R-devel/src/main/eval.c:2969) ==3788493== by 0x4F04C4: Rf_eval (svn/R-devel/src/main/eval.c:802) ==3788493== by 0x52125C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==3788493== by 0x5215A7: R_ReplConsole (svn/R-devel/src/main/main.c:314) ==3788493== by 0x521634: run_Rmainloop (svn/R-devel/src/main/main.c:1113) ==3788493== Uninitialised value was created by a client request ==3788493== at 0x52D667: Rf_allocVector3 (svn/R-devel/src/main/memory.c:2890) ==3788493== by 0x1C3ADA5D: R_starts_via_svd (packages/tests-vg/EMCluster/src/R_init_svd.c:84) ==3788493== by 0x49D123: R_doDotCall (svn/R-devel/src/main/dotcode.c:614) ==3788493== by 0x49D663: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==3788493== by 0x4DA5CA: bcEval (svn/R-devel/src/main/eval.c:7671) ==3788493== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==3788493== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==3788493== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==3788493== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==3788493== by 0x4F4299: do_set (svn/R-devel/src/main/eval.c:2969) ==3788493== by 0x4F04C4: Rf_eval (svn/R-devel/src/main/eval.c:802) ==3788493== by 0x52125C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==3788493== ==3788493== Conditional jump or move depends on uninitialised value(s) ==3788493== at 0x5AE1B8: rsum (svn/R-devel/src/main/summary.c:166) ==3788493== by 0x5AF8AB: do_summary (svn/R-devel/src/main/summary.c:832) ==3788493== by 0x4D3566: bcEval (svn/R-devel/src/main/eval.c:7115) ==3788493== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==3788493== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==3788493== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==3788493== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==3788493== by 0x4F4299: do_set (svn/R-devel/src/main/eval.c:2969) ==3788493== by 0x4F04C4: Rf_eval (svn/R-devel/src/main/eval.c:802) ==3788493== by 0x52125C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==3788493== by 0x5215A7: R_ReplConsole (svn/R-devel/src/main/main.c:314) ==3788493== by 0x521634: run_Rmainloop (svn/R-devel/src/main/main.c:1113) ==3788493== Uninitialised value was created by a client request ==3788493== at 0x52D667: Rf_allocVector3 (svn/R-devel/src/main/memory.c:2890) ==3788493== by 0x1C3ADA5D: R_starts_via_svd (packages/tests-vg/EMCluster/src/R_init_svd.c:84) ==3788493== by 0x49D123: R_doDotCall (svn/R-devel/src/main/dotcode.c:614) ==3788493== by 0x49D663: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==3788493== by 0x4DA5CA: bcEval (svn/R-devel/src/main/eval.c:7671) ==3788493== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==3788493== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==3788493== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==3788493== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==3788493== by 0x4F4299: do_set (svn/R-devel/src/main/eval.c:2969) ==3788493== by 0x4F04C4: Rf_eval (svn/R-devel/src/main/eval.c:802) ==3788493== by 0x52125C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==3788493== summary(ret.0) Method: kmeans n = 500, p = 2, nclass = 10, flag = 0, total parameters = 19. nc: [1] 40 29 37 44 25 56 169 29 55 16 mean: [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -27.70 403.1 -45.57 187.8 63.3 19.39 180.91 52.82 96.65 122.0 [2,] -96.17 398.9 62.66 -118.6 -11.3 189.64 19.08 -148.39 91.05 159.8

snoweye avatar Mar 08 '21 14:03 snoweye

*C_pi seems to be free or altered inside the call ... make a copy that seems to resolve the issue caught by valgrind.

snoweye avatar Mar 08 '21 19:03 snoweye