Ubuntu 升级后在 R 应用程序中检测到堆栈粉碎

stack smashing detected in R application after Ubuntu upgrade

昨晚我将计算机升级到 Ubuntu 16.04。今天我无法在 Jupyter 中创建 R 笔记本。以前我可以在 Jupyter 中使用 R。

我修复的第一个错误是 R 的 zmq 库的某种问题。内核一直停止:

[I 14:41:28.584 NotebookApp] KernelRestarter: restarting kernel (1/5)
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/usr/local/lib/R/site-library/rzmq/libs/rzmq.so':
  libzmq.so.3: cannot open shared object file: No such file or directory
Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted

我下载并安装了 rzmq,这个问题就消失了。

现在我看到这个错误:

[I 14:55:40.860 NotebookApp] Kernel started: 98fbc635-6ba4-4e99-88aa-85e49c6e8e8b
*** stack smashing detected ***: /usr/lib/R/bin/exec/R terminated
[I 14:55:43.860 NotebookApp] KernelRestarter: restarting kernel (1/5)
[W 14:55:50.897 NotebookApp] Timeout waiting for kernel_info reply from 98fbc635-6ba4-4e99-88aa-85e49c6e8e8b
*** stack smashing detected ***: /usr/lib/R/bin/exec/R terminated

R 可执行文件中是否存在某种损坏?我尝试重新安装 R:

sudo apt-get install --reinstall r-base r-base-dev

虽然没有改变任何事情。

当我从命令行 运行 R 时它工作正常,但后来我注意到:

jim@main:~/Projects/learning/introduction_to_statistical_learning$ which R
/usr/bin/R

这与 jupyter 使用的可执行文件路径不同。

请注意,jupyter 运行正在通过我的 anaconda 安装,我是 R 的新手。

我如何让它再次工作?

编辑:

我发现了这个:

https://github.com/conda/conda-recipes/issues/558

这表明 conda 和 gcc 存在一些已知问题。不过尚不清楚如何解决此问题。

我只是通过创建一个 Anaconda R 环境并将 Jupyter R 内核指向 Anaconda 的可执行文件来让它工作。这是一个解决方案,但比以前更干净的设置,因为我更愿意使用 Anaconda 环境。

https://www.continuum.io/blog/developer/jupyter-and-conda-r