简体   繁体   English

R软件包无法在x64上运行示例,但可以在i386和Debian上运行

[英]R package fails to run examples on x64 but works on i386 and Debian

I've been having trouble loading a package onto CRAN. 我在将软件包加载到CRAN时遇到了麻烦。 I am using R Studio to build my package and some lower-level C code for optimization. 我正在使用R Studio构建我的程序包和一些用于优化的较低级C代码。 Within R Studio I'm able to load/build/check my package with no problems (I am using a Mac btw). 在R Studio中,我可以毫无问题地加载/构建/检查程序包(我使用的是Mac btw)。 However, when I build the package and submit it to CRAN, it's rejected with the following: 但是,当我生成该程序包并将其提交给CRAN时,将被以下拒绝:

Flavor: r-devel-windows-ix86+x86_64
Check: running examples for arch 'x64', Result: ERROR

Upon looking at the log that is provided for me, the examples run perfectly fine for Debian and windows i386. 在查看为我提供的日志后,这些示例在Debian和Windows i386上运行得很好。

Does anyone have an idea as to why my examples fail for x64 but work fine on i386? 有谁知道为什么我的示例无法在x64上运行但在i386上运行良好?

Below is the code in the 00check.log: 以下是00check.log中的代码:

** running examples for arch 'i386' ... OK
** running examples for arch 'x64' ... ERROR
Running examples in 'fastcmprsk-Ex.R' failed
The error most likely occurred in:
.
.
.
> ### ** Examples
> 
> library(fastcmprsk)
> 
> set.seed(10)
> ftime <- rexp(200)
> fstatus <- sample(0:2, 200, replace = TRUE)
> cov <- matrix(runif(1000), nrow = 200)
> dimnames(cov)[[2]] <- c('x1','x2','x3','x4','x5')
> fit <- fastCrr(Crisk(ftime, fstatus) ~ cov, variance = FALSE)
* DONE
Status: 1 ERROR, 1 NOTE

I'm led to believe that the culprit is the fastCrr function. 我被认为是罪魁祸首是fastCrr函数。 However, the example seems to have run fine for arch 'i386' (see above) and for Debian. 但是,该示例对于arch'i386'(见上文)和Debian似乎运行良好。 I can't understand why it fails for x64, is there a hardware issue that I'm not aware of? 我不明白为什么它无法在x64上运行,是否存在我不知道的硬件问题? The function I'm calling does call C for the optimization routine. 我正在调用的函数确实会为优化例程调用C Perhaps there's a leak somewhere but I double checked and made sure that I Free every Calloc variable. 也许某处有泄漏,但是我仔细检查并确保我Free每个Calloc变量。 I'm not sure how else leaks can happen or why it'll only be specific to one system and not the other. 我不确定还会发生其他泄漏,或者为什么泄漏只会特定于一个系统而不是其他系统。

Hope this helps. 希望这可以帮助。

Thank you to all who've been viewing this and for your feedback. 感谢所有查看此内容的人以及您的反馈。

Using the wch1/r-debug docker image I have run UBSAN tools on your code. 使用wch1/r-debug镜像,我已在代码上运行了UBSAN工具。 The ones from gcc found something: 来自gcc的人发现了一些东西:

ralf@barra:~$ docker run --rm -it wch1/r-debug
root@9131acbabe1f:/# git clone https://github.com/erickawaguchi/fastcmprsk
root@9131acbabe1f:/# cd fastcmprsk/
root@9131acbabe1f:/fastcmprsk# git checkout developer
root@9131acbabe1f:/fastcmprsk# cd -
root@9131acbabe1f:/# RDsan -e "install.packages(c('doParallel', 'dynpred', 'codetools', 'survival'))"
root@9131acbabe1f:/# RDsan CMD build fastcmprsk
root@9131acbabe1f:/# RDsan CMD check fastcmprsk_1.0.3.tar.gz 
[...]
==5515==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6180002383d0 at pc 0x7ff3b5ad8d3f bp 0x7ffebeb2bb90 sp 0x7ffebeb2bb80  
READ of size 4 at 0x6180002383d0 thread T0
    #0 0x7ff3b5ad8d3e in ccd_dense /fastcmprsk.Rcheck/00_pkg_src/fastcmprsk/src/denseFit.c:148

Indeed, at https://github.com/erickawaguchi/fastcmprsk/blob/319138af6dfe5414608a89dbb168ea1e0ab1a797/src/denseFit.c#L148 you are reading from ici past the array boundary, since the test i == (n - 1) is evaluated after the test ici[i + 1] != 1 . 实际上,在https://github.com/erickawaguchi/fastcmprsk/blob/319138af6dfe5414608a89dbb168ea1e0ab1a797/src/denseFit.c#L148中,您正在从ici中读取数组边界,因为测试i == (n - 1)测试ici[i + 1] != 1 I would start there, even though I am not sure why this leads to a deterministic failure on x64 Windows. 即使我不确定为什么这会导致x64 Windows上的确定性失败,我还是从这里开始。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 R包中的src- {i386,x64}文件夹 - src-{i386,x64} folders in R package 无法在Windows上安装iGraph(i386和x64) - Trouble Installing iGraph on Windows (i386 and x64) LyX R 3.4.3 Rscript.exe i386 / X64损坏的脚本 - LyX R 3.4.3 Rscript.exe i386/X64 broken script 在R中执行库(程序包)会报告该程序包是为i386构建的,是否可以将其安装在x86_64系统上? - Executing library(package) in R reports that package was built for i386, can it be installed on an x86_64 system? 在R OS Windows 7 32位,R版本3.1.2,平台i386-w64-mingw32,系统:i386,mingw32中安装rjava软件包时出错 - Error in Installing rjava package in R OS windows 7 32bit, R Version 3.1.2 , Platform i386-w64-mingw32, system:i386, mingw32 R - 无法安装xlsxjars,64位Windows但尝试加载i386 - R - Cannot install xlsxjars, 64-bit Windows but trying to load i386 R.NET中的错误“错误:未为&#39;arch = i386&#39;安装软件包&#39;RMySQL&#39;” - Error in R.NET “Error: package 'RMySQL' is not installed for 'arch = i386' ” RStudio中的View()可以工作,但是R x64中的View()不能吗? - View() in RStudio works but View() in R x64 doesn't? 套件无法通过R CMD检查&#39;套件 <mypackage> 没有为arch = i386&#39;安装,为什么会发生这种情况? - Package failing to pass R CMD check 'package <mypackage> is not installed for arch =i386', any reason why this would happen? 我正在使用: R x64 ,并且无法运行我的代码,我不知道是什么问题 - I'm using : R x64 , and can't run my code, I don't know what the problem
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM