Segfault错误发生在R启动后(在新的conda环境中)。

huangapple go评论55阅读模式
英文:

Segfault error directly after R startup (within fresh conda env)

问题

以下是翻译的部分内容:

这个问题似乎涉及到R,conda安装问题和可能的内存映射。

以下是一个已经出现问题的最小示例:

运行mamba create -n R_test r-base -c r似乎工作正常。但是当尝试从此环境中运行R时,我会得到以下错误(重要部分):

Segfault错误发生在R启动后(在新的conda环境中)。

当查找此错误消息时,它经常与不同的包和库不匹配相关的问题一起出现(例如,https://stackoverflow.com/questions/49190251/caught-segfault-memory-not-mapped-error-in-r),这些问题似乎可以在R中进行检查... 除非它直接在启动时就发生,就像对我而言那样。

在另一个已经存在的R 4.1.2环境中运行R是有效的。指定新环境的版本也导致了相同的问题。所以似乎问题不在于版本,而是在于创建新环境时发生的事情。

我尝试使用conda clean --all来移除潜在有问题的未使用的包,以下是需要重启以移除文件句柄的一些包的示例,例如removing conda-env-2.6.0-1 WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(143): Could not remove or rename /opt/anaconda/anaconda3/pkgs/conda-env-2.6.0-1/info/recipe/meta.yaml. Please remove this file manually (you may need to reboot to free file handles)

最小示例在我们计算集群的另一位用户那里可以正常工作,所以我排除了一些“全局”原因作为问题的原因。另外:我不能自己重启计算集群,所以我希望我能够自己解决这个问题。

有人有任何关于这里可能是什么问题或者(因为我不是IT专家)如何进一步调查正在发生的事情的想法吗?非常感谢您的建议!

编辑:根据@merv的评论进行了一些编辑和添加:

创建新环境的命令:mamba create -c conda-forge r-base -n R_test_cf

以下是为新conda环境安装的所有软件包:

(未翻译的软件包列表)

这里是mamba env export的输出:

(未翻译的输出)

conda info的详细信息:

(未翻译的信息)

LD_LIBRARY_PATH没有值

ldd ~/.conda/envs/R_test_cf/bin/R 返回not a dynamic executable

另一位用户在集群上似乎能够简单地从我的环境中运行R... -->也许问题不在于安装方式,而在于如何激活环境或者我意外地全局安装了一些正在访问的内容。

英文:

The following issue seems to touch R, conda installation issues and possibly memory mapping.

Here is a minimal example that already results in the problem:

Running mamba create -n R_test r-base -c r seems to work just fine. But when trying to run R from within this env I get the following error (important part):

Segfault错误发生在R启动后(在新的conda环境中)。

When looking up this error message online, it often popped up in relation to distinct packages with library mismatches (e.g. https://stackoverflow.com/questions/49190251/caught-segfault-memory-not-mapped-error-in-r) which seem to be examinable from within R ... unless it happens directly at startup like it does for me.

Running R in another, already existing, R 4.1.2 env worked. Also scpecifying that version for a new env resulted in the same problem. So it seems, rather than the version, the issue is with whatever happens when I icreate a new envirmonment.

I tried removing potentially problematic unused packages with conda clean --all and the follwing packages seem to require reboot to remove file handle, e.g.removing conda-env-2.6.0-1
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(143): Could not remove or rename /opt/anaconda/anaconda3/pkgs/conda-env-2.6.0-1/info/recipe/meta.yaml. Please remove this file manually (you may need to reboot to free file handles)
:

blas-1.0-mkl                                  15 KB
conda-env-2.6.0-1                              6 KB
_libgcc_mutex-0.1-main                         7 KB
path.py-12.5.0-0                               8 KB
get_terminal_size-1.0.0-haa9412d_0             7 KB
importlib_metadata-3.10.0-hd3eb1b0_0          37 KB
prompt_toolkit-3.0.17-hd3eb1b0_0              39 KB
numpy-1.20.1-py38h93e21f0_0                   70 KB
matplotlib-3.3.4-py38h06a4308_0               92 KB
anaconda-2021.05-py38_0                       81 KB
dask-2021.4.0-pyhd3eb1b0_0                    12 KB
_openmp_mutex-4.5-1_gnu                       93 KB
openssl-1.1.1k-h7f98852_0                    6.0 MB
conda-4.10.1-py38h06a4308_1                 11.7 MB
python_abi-3.9-2_cp39                         11 KB
_libgcc_mutex-0.1-conda_forge                  6 KB
python_abi-3.8-2_cp38                         11 KB
libgfortran-ng-7.5.0-ha8ba4b0_17              92 KB
numpy-1.21.5-py38he7a7128_2                   26 KB

The minimal example works for someone else on our computing cluster, so I'd exclude some "global" reasons as the culprit. Btw: I cannot reboot the cluster myself, so I am hoing there might be something I can do on my own to resolve the issue.

Does anyone have an idea what could be the problem here or (since I am not an IT expert) how to further investigate what's going on? Thanks a lot for your suggestions!

---------------------------------EDIT--------------------------------------

Some edits and additions based on comments by @merv :

New environment creation command: mamba create -c conda-forge r-base -n R_test_cf

Here's all packages installed for the new conda env:

_libgcc_mutex                       0.1  conda_forge          conda-forge/linux-64     Cached
_openmp_mutex                       4.5  2_gnu                conda-forge/linux-64     Cached
_r-mutex                          1.0.1  anacondar_1          conda-forge/noarch       Cached
binutils_impl_linux-64             2.40  hf600244_0           conda-forge/linux-64     Cached
blas                                1.1  openblas             conda-forge/linux-64     Cached
bwidget                          1.9.14  ha770c72_1           conda-forge/linux-64     Cached
bzip2                             1.0.8  h7f98852_4           conda-forge/linux-64     Cached
c-ares                           1.19.0  h5eee18b_0           pkgs/main/linux-64       Cached
ca-certificates              2023.01.10  h06a4308_0           pkgs/main/linux-64       Cached
cairo                            1.16.0  h35add3b_1015        conda-forge/linux-64     Cached
curl                             7.88.1  hdc1c0ab_1           conda-forge/linux-64     Cached
expat                             2.5.0  hcb278e6_1           conda-forge/linux-64     Cached
font-ttf-dejavu-sans-mono          2.37  hab24e00_0           conda-forge/noarch       Cached
font-ttf-inconsolata              3.000  h77eed37_0           conda-forge/noarch       Cached
font-ttf-source-code-pro          2.038  h77eed37_0           conda-forge/noarch       Cached
font-ttf-ubuntu                    0.83  hab24e00_0           conda-forge/noarch       Cached
fontconfig                       2.14.2  h14ed4e7_0           conda-forge/linux-64     Cached
fonts-conda-ecosystem                 1  0                    conda-forge/noarch       Cached
fonts-conda-forge                     1  0                    conda-forge/noarch       Cached
freetype                         2.12.1  hca18f0e_1           conda-forge/linux-64     Cached
fribidi                          1.0.10  h516909a_0           conda-forge/linux-64     Cached
gcc_impl_linux-64                12.2.0  hcc96c02_19          conda-forge/linux-64     Cached
gettext                          0.21.1  h27087fc_0           conda-forge/linux-64     Cached
gfortran_impl_linux-64           12.2.0  h55be85b_19          conda-forge/linux-64     Cached
graphite2                        1.3.14  h295c915_1           pkgs/main/linux-64       Cached
gsl                               2.7.1  h917eeb2_1           pkgs/main/linux-64       Cached
gxx_impl_linux-64                12.2.0  hcc96c02_19          conda-forge/linux-64     Cached
harfbuzz                          6.0.0  h3ff4399_1           conda-forge/linux-64     Cached
icu                                72.1  hcb278e6_0           conda-forge/linux-64     Cached
kernel-headers_linux-64          2.6.32  he073ed8_15          conda-forge/noarch       Cached
keyutils                          1.6.1  h166bdaf_0           conda-forge/linux-64     Cached
krb5                             1.20.1  h81ceb04_0           conda-forge/linux-64     Cached
ld_impl_linux-64                   2.40  h41732ed_0           conda-forge/linux-64     Cached
lerc                              4.0.0  h27087fc_0           conda-forge/linux-64     Cached
libblas                           3.9.0  16_linux64_openblas  conda-forge/linux-64     Cached
libcurl                          7.88.1  hdc1c0ab_1           conda-forge/linux-64     Cached
libdeflate                         1.18  h0b41bf4_0           conda-forge/linux-64     Cached
libedit                    3.1.20221030  h5eee18b_0           pkgs/main/linux-64       Cached
libev                              4.33  h516909a_1           conda-forge/linux-64     Cached
libexpat                          2.5.0  hcb278e6_1           conda-forge/linux-64     Cached
libffi                            3.4.2  h7f98852_5           conda-forge/linux-64     Cached
libgcc-devel_linux-64            12.2.0  h3b97bd3_19          conda-forge/linux-64     Cached
libgcc-ng                        12.2.0  h65d4601_19          conda-forge/linux-64     Cached
libgfortran-ng                   12.2.0  h69a702a_19          conda-forge/linux-64     Cached
libgfortran5                     12.2.0  h337968e_19          conda-forge/linux-64     Cached
libglib                          2.74.1  h606061b_1           conda-forge/linux-64     Cached
libgomp                          12.2.0  h65d4601_19          conda-forge/linux-64     Cached
libiconv                           1.17  h166bdaf_0           conda-forge/linux-64     Cached
libjpeg-turbo                   2.1.5.1  h0b41bf4_0           conda-forge/linux-64     Cached
liblapack                         3.9.0  16_linux64_openblas  conda-forge/linux-64     Cached
libnghttp2                       1.52.0  h61bc06f_0           conda-forge/linux-64     Cached
libopenblas                      0.3.21  pthreads_h78a6416_3  conda-forge/linux-64     Cached
libpng                           1.6.39  h753d276_0           conda-forge/linux-64     Cached
libsanitizer                     12.2.0  h46fd767_19          conda-forge/linux-64     Cached
libssh2                          1.10.0  hf14f497_3           conda-forge/linux-64     Cached
libstdcxx-devel_linux-64         12.2.0  h3b97bd3_19          conda-forge/linux-64     Cached
libstdcxx-ng                     12.2.0  h46fd767_19          conda-forge/linux-64     Cached
libtiff                           4.5.0  ha587672_6           conda-forge/linux-64     Cached
libuuid                          2.38.1  h0b41bf4_0           conda-forge/linux-64     Cached
libwebp-base                      1.3.0  h0b41bf4_0           conda-forge/linux-64     Cached
libxcb                             1.13  h7f98852_1004        conda-forge/linux-64     Cached
libxml2                          2.10.3  hfdac1af_6           conda-forge/linux-64     Cached
libzlib                          1.2.13  h166bdaf_4           conda-forge/linux-64     Cached
lz4-c                             1.9.4  hcb278e6_0           conda-forge/linux-64     Cached
make                                4.3  hd18ef5c_1           conda-forge/linux-64     Cached
ncurses                             6.4  h6a678d5_0           pkgs/main/linux-64       Cached
openblas                         0.3.21  pthreads_h320a7e8_3  conda-forge/linux-64     Cached
openssl                           3.1.0  h0b41bf4_0           conda-forge/linux-64     Cached
pango                           1.50.14  hd33c08f_0           conda-forge/linux-64     Cached
pcre2                             10.40  hc3806b6_0           conda-forge/linux-64     Cached
pixman                           0.40.0  h36c2ea0_0           conda-forge/linux-64     Cached
pthread-stubs                       0.4  h36c2ea0_1001        conda-forge/linux-64     Cached
r-base                            4.2.3  h4a03800_2           conda-forge/linux-64     Cached
readline                            8.2  h8228510_1           conda-forge/linux-64     Cached
sed                                 4.8  he412f7d_0           conda-forge/linux-64     Cached
sysroot_linux-64                   2.12  he073ed8_15          conda-forge/noarch       Cached
tk                               8.6.12  h27826a3_0           conda-forge/linux-64     Cached
tktable                            2.10  hb7b940f_3           conda-forge/linux-64     Cached
xorg-kbproto                      1.0.7  h14c3975_1002        conda-forge/linux-64     Cached
xorg-libice                      1.0.10  h516909a_0           conda-forge/linux-64     Cached
xorg-libsm                        1.2.3  hd9c2040_1000        conda-forge/linux-64     Cached
xorg-libx11                       1.8.4  h0b41bf4_0           conda-forge/linux-64     Cached
xorg-libxau                       1.0.9  h14c3975_0           conda-forge/linux-64     Cached
xorg-libxdmcp                     1.1.3  h516909a_0           conda-forge/linux-64     Cached
xorg-libxext                      1.3.4  h0b41bf4_2           conda-forge/linux-64     Cached
xorg-libxrender                  0.9.10  h7f98852_1003        conda-forge/linux-64     Cached
xorg-libxt                        1.2.1  h7f98852_2           conda-forge/linux-64     Cached
xorg-renderproto                 0.11.1  h14c3975_1002        conda-forge/linux-64     Cached
xorg-xextproto                    7.3.0  h0b41bf4_1003        conda-forge/linux-64     Cached
xorg-xproto                      7.0.31  h14c3975_1007        conda-forge/linux-64     Cached
xz                               5.2.10  h5eee18b_1           pkgs/main/linux-64       Cached
zlib                             1.2.13  h166bdaf_4           conda-forge/linux-64     Cached
zstd                              1.5.4  hc292b87_0           pkgs/main/linux-64       Cached
Summary:
Install: 93 packages
Total download: 0  B

Here's the output of mamba env export:

name: R_test_cf
channels:
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=2_gnu
- _r-mutex=1.0.1=anacondar_1
- binutils_impl_linux-64=2.40=hf600244_0
- blas=1.1=openblas
- bwidget=1.9.14=ha770c72_1
- bzip2=1.0.8=h7f98852_4
- c-ares=1.19.0=h5eee18b_0
- ca-certificates=2023.01.10=h06a4308_0
- cairo=1.16.0=h35add3b_1015
- curl=7.88.1=hdc1c0ab_1
- expat=2.5.0=hcb278e6_1
- font-ttf-dejavu-sans-mono=2.37=hab24e00_0
- font-ttf-inconsolata=3.000=h77eed37_0
- font-ttf-source-code-pro=2.038=h77eed37_0
- font-ttf-ubuntu=0.83=hab24e00_0
- fontconfig=2.14.2=h14ed4e7_0
- fonts-conda-ecosystem=1=0
- fonts-conda-forge=1=0
- freetype=2.12.1=hca18f0e_1
- fribidi=1.0.10=h516909a_0
- gcc_impl_linux-64=12.2.0=hcc96c02_19
- gettext=0.21.1=h27087fc_0
- gfortran_impl_linux-64=12.2.0=h55be85b_19
- graphite2=1.3.14=h295c915_1
- gsl=2.7.1=h917eeb2_1
- gxx_impl_linux-64=12.2.0=hcc96c02_19
- harfbuzz=6.0.0=h3ff4399_1
- icu=72.1=hcb278e6_0
- kernel-headers_linux-64=2.6.32=he073ed8_15
- keyutils=1.6.1=h166bdaf_0
- krb5=1.20.1=h81ceb04_0
- ld_impl_linux-64=2.40=h41732ed_0
- lerc=4.0.0=h27087fc_0
- libblas=3.9.0=16_linux64_openblas
- libcurl=7.88.1=hdc1c0ab_1
- libdeflate=1.18=h0b41bf4_0
- libedit=3.1.20221030=h5eee18b_0
- libev=4.33=h516909a_1
- libexpat=2.5.0=hcb278e6_1
- libffi=3.4.2=h7f98852_5
- libgcc-devel_linux-64=12.2.0=h3b97bd3_19
- libgcc-ng=12.2.0=h65d4601_19
- libgfortran-ng=12.2.0=h69a702a_19
- libgfortran5=12.2.0=h337968e_19
- libglib=2.74.1=h606061b_1
- libgomp=12.2.0=h65d4601_19
- libiconv=1.17=h166bdaf_0
- libjpeg-turbo=2.1.5.1=h0b41bf4_0
- liblapack=3.9.0=16_linux64_openblas
- libnghttp2=1.52.0=h61bc06f_0
- libopenblas=0.3.21=pthreads_h78a6416_3
- libpng=1.6.39=h753d276_0
- libsanitizer=12.2.0=h46fd767_19
- libssh2=1.10.0=hf14f497_3
- libstdcxx-devel_linux-64=12.2.0=h3b97bd3_19
- libstdcxx-ng=12.2.0=h46fd767_19
- libtiff=4.5.0=ha587672_6
- libuuid=2.38.1=h0b41bf4_0
- libwebp-base=1.3.0=h0b41bf4_0
- libxcb=1.13=h7f98852_1004
- libxml2=2.10.3=hfdac1af_6
- libzlib=1.2.13=h166bdaf_4
- lz4-c=1.9.4=hcb278e6_0
- make=4.3=hd18ef5c_1
- ncurses=6.4=h6a678d5_0
- openblas=0.3.21=pthreads_h320a7e8_3
- openssl=3.1.0=h0b41bf4_0
- pango=1.50.14=hd33c08f_0
- pcre2=10.40=hc3806b6_0
- pixman=0.40.0=h36c2ea0_0
- pthread-stubs=0.4=h36c2ea0_1001
- r-base=4.2.3=h4a03800_2
- readline=8.2=h8228510_1
- sed=4.8=he412f7d_0
- sysroot_linux-64=2.12=he073ed8_15
- tk=8.6.12=h27826a3_0
- tktable=2.10=hb7b940f_3
- xorg-kbproto=1.0.7=h14c3975_1002
- xorg-libice=1.0.10=h516909a_0
- xorg-libsm=1.2.3=hd9c2040_1000
- xorg-libx11=1.8.4=h0b41bf4_0
- xorg-libxau=1.0.9=h14c3975_0
- xorg-libxdmcp=1.1.3=h516909a_0
- xorg-libxext=1.3.4=h0b41bf4_2
- xorg-libxrender=0.9.10=h7f98852_1003
- xorg-libxt=1.2.1=h7f98852_2
- xorg-renderproto=0.11.1=h14c3975_1002
- xorg-xextproto=7.3.0=h0b41bf4_1003
- xorg-xproto=7.0.31=h14c3975_1007
- xz=5.2.10=h5eee18b_1
- zlib=1.2.13=h166bdaf_4
- zstd=1.5.4=hc292b87_0

The conda info details:

     active environment : R_test_cf
active env location : /home/rstrasser/.conda/envs/R_test_cf
shell level : 1
user config file : /home/rstrasser/.condarc
populated config files : /home/rstrasser/.condarc
conda version : 4.12.0
conda-build version : 3.21.4
python version : 3.8.8.final.0
virtual packages : __linux=3.10.0=0
__glibc=2.17=0
__unix=0=0
__archspec=1=x86_64
base environment : /opt/anaconda/anaconda3  (read only)
conda av data dir : /opt/anaconda/anaconda3/etc/conda
conda av metadata url : None
channel URLs : https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /opt/anaconda/anaconda3/pkgs
/home/rstrasser/.conda/pkgs
envs directories : /home/rstrasser/.conda/envs
/opt/anaconda/anaconda3/envs
platform : linux-64
user-agent : conda/4.12.0 requests/2.25.1 CPython/3.8.8 Linux/3.10.0-1160.53.1.el7.x86_64 centos/7.9.2009 glibc/2.17
UID:GID : 1003:1004
netrc file : None
offline mode : False

LD_LIBRARY_PATH does not have a value

ldd ~/.conda/envs/R_test_cf/bin/R returns not a dynamic executable

-------------------EDIT 2-----------------------------------------

Another user on the cluster seems to be able to simply run R from my environment... --> Maybe the issue is not how things are installed, but how the env is activated or that I accidentally installed something globally that is being accessed now.

答案1

得分: 2

我们在我们的大学集群遇到了相同的问题。我们在.bashrc文件的末尾添加了以下行:
LANG=en_US.UTF-8
英文:

We faced the same problem at our university cluster. We added the line

LANG=en_US.UTF-8

at the end of the .bashrc file and it solved the problem.

答案2

得分: 0

我遇到了和你类似的问题。而且我发现在核心转储之前打印了一些警告消息。
警告消息
所以我觉得可能是地区设置是这种奇怪现象的根源。我执行了以下命令并通过conda重新安装了R。

sudo apt-get install language-pack-en

对我来说有效。
结果

英文:

I faced a similar problem to you.
And I found that some Warning messages are printed before the core dump.
Warning messages
So I feel maybe the locale setting is the source of this strange phenomenon. I executed the following command and reinstalled R through conda.

sudo apt-get install language-pack-en

And it works for me.
Result

huangapple
  • 本文由 发表于 2023年3月31日 18:37:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/75897562.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定