测试环境 :
uname -r
5.4.0-107-generic
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
我运行 R 并收到以下错误
*** caught bus error ***
address 0x7f96618407a4, cause 'non-existent physical address'
Traceback:
1: NextMethod(.Generic)
2: Ops.numeric_version(R_version_built_under, "3.0.0")
3: testRversion(pkgInfo, package, pkgpath)
4: library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, warn.conflicts = warn.conflicts, quietly = quietly, mask.ok = mask.ok, exclude = exclude, include.only = include.only, attach.required = attach.required)
5: doTryCatch(return(expr), name, parentenv, handler)
6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
7: tryCatchList(expr, classes, parentenv, handlers)
8: tryCatch(library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, warn.conflicts = warn.conflicts, quietly = quietly, mask.ok = mask.ok, exclude = exclude, include.only = include.only, attach.required = attach.required), error = function(e) e)
9: require(pkg, quietly = TRUE, warn.conflicts = FALSE, character.only = TRUE)
10: .OptRequireMethods()
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:
如果我按 ctrl+c,正常的 R 脚本就会打开,甚至命令(如 R 脚本中的计算 1+1=2)也会起作用
R version 4.1.3 (2022-03-10) -- "One Push-Up"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
>
我搜索了以下错误*** caught bus error *** address 0x7f96618407a4, cause 'non-existent physical address'
,有几个答案说这是硬件相关的问题。
但是对于其他应用程序(例如使用 Python 和 Jupyter 笔记本执行代码)来说,工作正常,所以我认为硬件似乎没有问题。
我卸载了 R
sudo apt-get remove r-base-core
sudo apt-get remove r-base
我还删除了从中搜索的目录,R command> .libPaths()
例如
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
[3] "/usr/lib/R/library"
我重新安装了 R,但没有什么变化,还是出现上述错误。*** caught bus error *** address 0x7f96618407a4, cause 'non-existent physical address'
日志输出rstudio-server status
如下
● rstudio-server.service - RStudio Server
Loaded: loaded (/lib/systemd/system/rstudio-server.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2022-04-03 14:19:12 KST; 57min ago
Process: 4604 ExecStop=/usr/bin/killall -TERM rserver (code=exited, status=0/SUCCESS)
Process: 4835 ExecStart=/usr/lib/rstudio-server/bin/rserver (code=exited, status=0/SUCCESS)
Main PID: 4836 (rserver)
Tasks: 3 (limit: 12287)
CGroup: /system.slice/rstudio-server.service
└─4836 /usr/lib/rstudio-server/bin/rserver
4, 03 14:19:12 resso225 systemd[1]: Starting RStudio Server...
4, 03 14:19:12 resso225 systemd[1]: Started RStudio Server.
4, 03 14:19:13 resso225 rserver[4836]: ERROR R did not return any output when queried for directory location information; LOGGED FROM: bool rstudio::core::r_util::{anonymous}::detectRLocationsUsingR(const string&, rstudio::core::FilePath*, rstudio::core::FilePath*, rstudio::
4, 03 14:19:13 resso225 rserver[4836]: ERROR system error 71 (Protocol error) [description: Unable to parse version from R, version-info: , r-error:
*** caught bus error ***
address 0x7f964bc637a4, cause 'non-existent physical address'
Traceback:
1: NextMethod(.Generic)
2: Ops.numeric_version(R_version_built_under, "3.0.0")
3: testRversion(pkgInfo, package, pkgpath)
4: library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, warn.conflicts = warn.conflicts, quietly = quietly, mask.ok = mask.ok, exclude = exclude, include.only = include.only, attach.required = atta
5: doTryCatch(return(expr), name, parentenv, handler)
6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
7: tryCatchList(expr, classes, parentenv, handlers)
8: tryCatch(library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, warn.conflicts = warn.conflicts, quietly = quietly, mask.ok = mask.ok, exclude = exclude, include.only = include.only, attach.re
9: require(pkg, quietly = TRUE, warn.conflicts = FALSE, character.only = TRUE)
10: .OptRequireMethods()
An irrecoverable exception occurred. R is aborting now ...
Bus error (core dumped)
]; OCCURRED AT rstudio::core::Error rstudio::core::r_util::rVersion(const rstudio::core::FilePath&, const rstudio::core::FilePath&, const string&, const string&, const string&, const rstudio::core::FilePath&, std::__cxx11::string*) src
4, 03 14:56:24 resso225 rserver[4836]: ERROR system error 111 (Connection refused) [request-uri: /rpc/client_init]; OCCURRED AT void rstudio::core::http::LocalStreamAsyncClient::handleConnect(const rstudio_boost::system::error_code&) src/cpp/server/ServerSessionProxy.cpp:124
我想解决上述问题caught bus error...
并运行 R Studio 服务器。请帮忙。
附加信息
> ldd $(type -p R)
not a dynamic executable
> (set -x ; R) or ldd $(set -x ; R)
+ R
*** caught bus error ***
address 0x7f593efea7a4, cause 'non-existent physical address'
Traceback:
1: NextMethod(.Generic)
2: Ops.numeric_version(R_version_built_under, "3.0.0")
3: testRversion(pkgInfo, package, pkgpath)
4: library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, warn.conflicts = warn.conflicts, quietly = quietly, mask.ok = mask.ok, exclude = exclude, include.only = include.only, attach.required = attach.required)
5: doTryCatch(return(expr), name, parentenv, handler)
6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
7: tryCatchList(expr, classes, parentenv, handlers)
8: tryCatch(library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, warn.conflicts = warn.conflicts, quietly = quietly, mask.ok = mask.ok, exclude = exclude, include.only = include.only, attach.required = attach.required), error = function(e) e)
9: require(pkg, quietly = TRUE, warn.conflicts = FALSE, character.only = TRUE)
10: .OptRequireMethods()
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: