xrobin / pROC

Display and analyze ROC curves in R and S+
https://cran.r-project.org/web/packages/pROC/
GNU General Public License v3.0
121 stars 31 forks source link

DeLong test with the same ROC curve crashes R #100

Closed xrobin closed 3 years ago

xrobin commented 3 years ago

Probably as a result of the refactors in PR #95, it is no longer possible to perform a DeLong test with the same ROC curve.

library(pROC)
data(aSAH)
r.wfns <- roc(aSAH$outcome, aSAH$wfns)
r.wfns2 <- roc(aSAH$outcome, aSAH$wfns)
roc.test(r.wfns, r.wfns2)

Crashes R:

*** caught segfault ***
address 0x200000002, cause 'memory not mapped'

Traceback:
 1: delongPlacementsCpp(roc)
 2: delongPlacements(roc1)
 3: delong.paired.calculations(roc1, roc2)
 4: roc.test.roc(r.wfns, r.wfns2)
 5: roc.test(r.wfns, r.wfns2)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace

Previously (pROC 1.17) this used to work and resulted in a p-value of 1.0.

Additional information:

> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=fr_FR.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=fr_CH.UTF-8        LC_COLLATE=fr_FR.UTF-8    
 [5] LC_MONETARY=fr_CH.UTF-8    LC_MESSAGES=fr_FR.UTF-8   
 [7] LC_PAPER=fr_CH.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=fr_CH.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] Cairo_1.5-12.2

loaded via a namespace (and not attached):
[1] compiler_4.1.1 plyr_1.8.6     Rcpp_1.0.7     pROC_1.18.0   

@wzbillings would you have some time to check what is causing this regression?

xrobin commented 3 years ago

Hum, that doesn't seem reproducible outside of my own machine. I will need to investigate what is going on.

xrobin commented 3 years ago

After a few reinstallations of pROC and restarts of R, the problem disappeared. Not sure what was going on, but at least now the behavior is tested.