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

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

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环境安装的所有软件包:

  1. (未翻译的软件包列表)

这里是mamba env export的输出:

  1. (未翻译的输出)

conda info的详细信息:

  1. (未翻译的信息)

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)
:

  1. blas-1.0-mkl 15 KB
  2. conda-env-2.6.0-1 6 KB
  3. _libgcc_mutex-0.1-main 7 KB
  4. path.py-12.5.0-0 8 KB
  5. get_terminal_size-1.0.0-haa9412d_0 7 KB
  6. importlib_metadata-3.10.0-hd3eb1b0_0 37 KB
  7. prompt_toolkit-3.0.17-hd3eb1b0_0 39 KB
  8. numpy-1.20.1-py38h93e21f0_0 70 KB
  9. matplotlib-3.3.4-py38h06a4308_0 92 KB
  10. anaconda-2021.05-py38_0 81 KB
  11. dask-2021.4.0-pyhd3eb1b0_0 12 KB
  12. _openmp_mutex-4.5-1_gnu 93 KB
  13. openssl-1.1.1k-h7f98852_0 6.0 MB
  14. conda-4.10.1-py38h06a4308_1 11.7 MB
  15. python_abi-3.9-2_cp39 11 KB
  16. _libgcc_mutex-0.1-conda_forge 6 KB
  17. python_abi-3.8-2_cp38 11 KB
  18. libgfortran-ng-7.5.0-ha8ba4b0_17 92 KB
  19. 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:

  1. _libgcc_mutex 0.1 conda_forge conda-forge/linux-64 Cached
  2. _openmp_mutex 4.5 2_gnu conda-forge/linux-64 Cached
  3. _r-mutex 1.0.1 anacondar_1 conda-forge/noarch Cached
  4. binutils_impl_linux-64 2.40 hf600244_0 conda-forge/linux-64 Cached
  5. blas 1.1 openblas conda-forge/linux-64 Cached
  6. bwidget 1.9.14 ha770c72_1 conda-forge/linux-64 Cached
  7. bzip2 1.0.8 h7f98852_4 conda-forge/linux-64 Cached
  8. c-ares 1.19.0 h5eee18b_0 pkgs/main/linux-64 Cached
  9. ca-certificates 2023.01.10 h06a4308_0 pkgs/main/linux-64 Cached
  10. cairo 1.16.0 h35add3b_1015 conda-forge/linux-64 Cached
  11. curl 7.88.1 hdc1c0ab_1 conda-forge/linux-64 Cached
  12. expat 2.5.0 hcb278e6_1 conda-forge/linux-64 Cached
  13. font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge/noarch Cached
  14. font-ttf-inconsolata 3.000 h77eed37_0 conda-forge/noarch Cached
  15. font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge/noarch Cached
  16. font-ttf-ubuntu 0.83 hab24e00_0 conda-forge/noarch Cached
  17. fontconfig 2.14.2 h14ed4e7_0 conda-forge/linux-64 Cached
  18. fonts-conda-ecosystem 1 0 conda-forge/noarch Cached
  19. fonts-conda-forge 1 0 conda-forge/noarch Cached
  20. freetype 2.12.1 hca18f0e_1 conda-forge/linux-64 Cached
  21. fribidi 1.0.10 h516909a_0 conda-forge/linux-64 Cached
  22. gcc_impl_linux-64 12.2.0 hcc96c02_19 conda-forge/linux-64 Cached
  23. gettext 0.21.1 h27087fc_0 conda-forge/linux-64 Cached
  24. gfortran_impl_linux-64 12.2.0 h55be85b_19 conda-forge/linux-64 Cached
  25. graphite2 1.3.14 h295c915_1 pkgs/main/linux-64 Cached
  26. gsl 2.7.1 h917eeb2_1 pkgs/main/linux-64 Cached
  27. gxx_impl_linux-64 12.2.0 hcc96c02_19 conda-forge/linux-64 Cached
  28. harfbuzz 6.0.0 h3ff4399_1 conda-forge/linux-64 Cached
  29. icu 72.1 hcb278e6_0 conda-forge/linux-64 Cached
  30. kernel-headers_linux-64 2.6.32 he073ed8_15 conda-forge/noarch Cached
  31. keyutils 1.6.1 h166bdaf_0 conda-forge/linux-64 Cached
  32. krb5 1.20.1 h81ceb04_0 conda-forge/linux-64 Cached
  33. ld_impl_linux-64 2.40 h41732ed_0 conda-forge/linux-64 Cached
  34. lerc 4.0.0 h27087fc_0 conda-forge/linux-64 Cached
  35. libblas 3.9.0 16_linux64_openblas conda-forge/linux-64 Cached
  36. libcurl 7.88.1 hdc1c0ab_1 conda-forge/linux-64 Cached
  37. libdeflate 1.18 h0b41bf4_0 conda-forge/linux-64 Cached
  38. libedit 3.1.20221030 h5eee18b_0 pkgs/main/linux-64 Cached
  39. libev 4.33 h516909a_1 conda-forge/linux-64 Cached
  40. libexpat 2.5.0 hcb278e6_1 conda-forge/linux-64 Cached
  41. libffi 3.4.2 h7f98852_5 conda-forge/linux-64 Cached
  42. libgcc-devel_linux-64 12.2.0 h3b97bd3_19 conda-forge/linux-64 Cached
  43. libgcc-ng 12.2.0 h65d4601_19 conda-forge/linux-64 Cached
  44. libgfortran-ng 12.2.0 h69a702a_19 conda-forge/linux-64 Cached
  45. libgfortran5 12.2.0 h337968e_19 conda-forge/linux-64 Cached
  46. libglib 2.74.1 h606061b_1 conda-forge/linux-64 Cached
  47. libgomp 12.2.0 h65d4601_19 conda-forge/linux-64 Cached
  48. libiconv 1.17 h166bdaf_0 conda-forge/linux-64 Cached
  49. libjpeg-turbo 2.1.5.1 h0b41bf4_0 conda-forge/linux-64 Cached
  50. liblapack 3.9.0 16_linux64_openblas conda-forge/linux-64 Cached
  51. libnghttp2 1.52.0 h61bc06f_0 conda-forge/linux-64 Cached
  52. libopenblas 0.3.21 pthreads_h78a6416_3 conda-forge/linux-64 Cached
  53. libpng 1.6.39 h753d276_0 conda-forge/linux-64 Cached
  54. libsanitizer 12.2.0 h46fd767_19 conda-forge/linux-64 Cached
  55. libssh2 1.10.0 hf14f497_3 conda-forge/linux-64 Cached
  56. libstdcxx-devel_linux-64 12.2.0 h3b97bd3_19 conda-forge/linux-64 Cached
  57. libstdcxx-ng 12.2.0 h46fd767_19 conda-forge/linux-64 Cached
  58. libtiff 4.5.0 ha587672_6 conda-forge/linux-64 Cached
  59. libuuid 2.38.1 h0b41bf4_0 conda-forge/linux-64 Cached
  60. libwebp-base 1.3.0 h0b41bf4_0 conda-forge/linux-64 Cached
  61. libxcb 1.13 h7f98852_1004 conda-forge/linux-64 Cached
  62. libxml2 2.10.3 hfdac1af_6 conda-forge/linux-64 Cached
  63. libzlib 1.2.13 h166bdaf_4 conda-forge/linux-64 Cached
  64. lz4-c 1.9.4 hcb278e6_0 conda-forge/linux-64 Cached
  65. make 4.3 hd18ef5c_1 conda-forge/linux-64 Cached
  66. ncurses 6.4 h6a678d5_0 pkgs/main/linux-64 Cached
  67. openblas 0.3.21 pthreads_h320a7e8_3 conda-forge/linux-64 Cached
  68. openssl 3.1.0 h0b41bf4_0 conda-forge/linux-64 Cached
  69. pango 1.50.14 hd33c08f_0 conda-forge/linux-64 Cached
  70. pcre2 10.40 hc3806b6_0 conda-forge/linux-64 Cached
  71. pixman 0.40.0 h36c2ea0_0 conda-forge/linux-64 Cached
  72. pthread-stubs 0.4 h36c2ea0_1001 conda-forge/linux-64 Cached
  73. r-base 4.2.3 h4a03800_2 conda-forge/linux-64 Cached
  74. readline 8.2 h8228510_1 conda-forge/linux-64 Cached
  75. sed 4.8 he412f7d_0 conda-forge/linux-64 Cached
  76. sysroot_linux-64 2.12 he073ed8_15 conda-forge/noarch Cached
  77. tk 8.6.12 h27826a3_0 conda-forge/linux-64 Cached
  78. tktable 2.10 hb7b940f_3 conda-forge/linux-64 Cached
  79. xorg-kbproto 1.0.7 h14c3975_1002 conda-forge/linux-64 Cached
  80. xorg-libice 1.0.10 h516909a_0 conda-forge/linux-64 Cached
  81. xorg-libsm 1.2.3 hd9c2040_1000 conda-forge/linux-64 Cached
  82. xorg-libx11 1.8.4 h0b41bf4_0 conda-forge/linux-64 Cached
  83. xorg-libxau 1.0.9 h14c3975_0 conda-forge/linux-64 Cached
  84. xorg-libxdmcp 1.1.3 h516909a_0 conda-forge/linux-64 Cached
  85. xorg-libxext 1.3.4 h0b41bf4_2 conda-forge/linux-64 Cached
  86. xorg-libxrender 0.9.10 h7f98852_1003 conda-forge/linux-64 Cached
  87. xorg-libxt 1.2.1 h7f98852_2 conda-forge/linux-64 Cached
  88. xorg-renderproto 0.11.1 h14c3975_1002 conda-forge/linux-64 Cached
  89. xorg-xextproto 7.3.0 h0b41bf4_1003 conda-forge/linux-64 Cached
  90. xorg-xproto 7.0.31 h14c3975_1007 conda-forge/linux-64 Cached
  91. xz 5.2.10 h5eee18b_1 pkgs/main/linux-64 Cached
  92. zlib 1.2.13 h166bdaf_4 conda-forge/linux-64 Cached
  93. zstd 1.5.4 hc292b87_0 pkgs/main/linux-64 Cached
  94. Summary:
  95. Install: 93 packages
  96. Total download: 0 B

Here's the output of mamba env export:

  1. name: R_test_cf
  2. channels:
  3. - conda-forge
  4. - defaults
  5. dependencies:
  6. - _libgcc_mutex=0.1=conda_forge
  7. - _openmp_mutex=4.5=2_gnu
  8. - _r-mutex=1.0.1=anacondar_1
  9. - binutils_impl_linux-64=2.40=hf600244_0
  10. - blas=1.1=openblas
  11. - bwidget=1.9.14=ha770c72_1
  12. - bzip2=1.0.8=h7f98852_4
  13. - c-ares=1.19.0=h5eee18b_0
  14. - ca-certificates=2023.01.10=h06a4308_0
  15. - cairo=1.16.0=h35add3b_1015
  16. - curl=7.88.1=hdc1c0ab_1
  17. - expat=2.5.0=hcb278e6_1
  18. - font-ttf-dejavu-sans-mono=2.37=hab24e00_0
  19. - font-ttf-inconsolata=3.000=h77eed37_0
  20. - font-ttf-source-code-pro=2.038=h77eed37_0
  21. - font-ttf-ubuntu=0.83=hab24e00_0
  22. - fontconfig=2.14.2=h14ed4e7_0
  23. - fonts-conda-ecosystem=1=0
  24. - fonts-conda-forge=1=0
  25. - freetype=2.12.1=hca18f0e_1
  26. - fribidi=1.0.10=h516909a_0
  27. - gcc_impl_linux-64=12.2.0=hcc96c02_19
  28. - gettext=0.21.1=h27087fc_0
  29. - gfortran_impl_linux-64=12.2.0=h55be85b_19
  30. - graphite2=1.3.14=h295c915_1
  31. - gsl=2.7.1=h917eeb2_1
  32. - gxx_impl_linux-64=12.2.0=hcc96c02_19
  33. - harfbuzz=6.0.0=h3ff4399_1
  34. - icu=72.1=hcb278e6_0
  35. - kernel-headers_linux-64=2.6.32=he073ed8_15
  36. - keyutils=1.6.1=h166bdaf_0
  37. - krb5=1.20.1=h81ceb04_0
  38. - ld_impl_linux-64=2.40=h41732ed_0
  39. - lerc=4.0.0=h27087fc_0
  40. - libblas=3.9.0=16_linux64_openblas
  41. - libcurl=7.88.1=hdc1c0ab_1
  42. - libdeflate=1.18=h0b41bf4_0
  43. - libedit=3.1.20221030=h5eee18b_0
  44. - libev=4.33=h516909a_1
  45. - libexpat=2.5.0=hcb278e6_1
  46. - libffi=3.4.2=h7f98852_5
  47. - libgcc-devel_linux-64=12.2.0=h3b97bd3_19
  48. - libgcc-ng=12.2.0=h65d4601_19
  49. - libgfortran-ng=12.2.0=h69a702a_19
  50. - libgfortran5=12.2.0=h337968e_19
  51. - libglib=2.74.1=h606061b_1
  52. - libgomp=12.2.0=h65d4601_19
  53. - libiconv=1.17=h166bdaf_0
  54. - libjpeg-turbo=2.1.5.1=h0b41bf4_0
  55. - liblapack=3.9.0=16_linux64_openblas
  56. - libnghttp2=1.52.0=h61bc06f_0
  57. - libopenblas=0.3.21=pthreads_h78a6416_3
  58. - libpng=1.6.39=h753d276_0
  59. - libsanitizer=12.2.0=h46fd767_19
  60. - libssh2=1.10.0=hf14f497_3
  61. - libstdcxx-devel_linux-64=12.2.0=h3b97bd3_19
  62. - libstdcxx-ng=12.2.0=h46fd767_19
  63. - libtiff=4.5.0=ha587672_6
  64. - libuuid=2.38.1=h0b41bf4_0
  65. - libwebp-base=1.3.0=h0b41bf4_0
  66. - libxcb=1.13=h7f98852_1004
  67. - libxml2=2.10.3=hfdac1af_6
  68. - libzlib=1.2.13=h166bdaf_4
  69. - lz4-c=1.9.4=hcb278e6_0
  70. - make=4.3=hd18ef5c_1
  71. - ncurses=6.4=h6a678d5_0
  72. - openblas=0.3.21=pthreads_h320a7e8_3
  73. - openssl=3.1.0=h0b41bf4_0
  74. - pango=1.50.14=hd33c08f_0
  75. - pcre2=10.40=hc3806b6_0
  76. - pixman=0.40.0=h36c2ea0_0
  77. - pthread-stubs=0.4=h36c2ea0_1001
  78. - r-base=4.2.3=h4a03800_2
  79. - readline=8.2=h8228510_1
  80. - sed=4.8=he412f7d_0
  81. - sysroot_linux-64=2.12=he073ed8_15
  82. - tk=8.6.12=h27826a3_0
  83. - tktable=2.10=hb7b940f_3
  84. - xorg-kbproto=1.0.7=h14c3975_1002
  85. - xorg-libice=1.0.10=h516909a_0
  86. - xorg-libsm=1.2.3=hd9c2040_1000
  87. - xorg-libx11=1.8.4=h0b41bf4_0
  88. - xorg-libxau=1.0.9=h14c3975_0
  89. - xorg-libxdmcp=1.1.3=h516909a_0
  90. - xorg-libxext=1.3.4=h0b41bf4_2
  91. - xorg-libxrender=0.9.10=h7f98852_1003
  92. - xorg-libxt=1.2.1=h7f98852_2
  93. - xorg-renderproto=0.11.1=h14c3975_1002
  94. - xorg-xextproto=7.3.0=h0b41bf4_1003
  95. - xorg-xproto=7.0.31=h14c3975_1007
  96. - xz=5.2.10=h5eee18b_1
  97. - zlib=1.2.13=h166bdaf_4
  98. - zstd=1.5.4=hc292b87_0

The conda info details:

  1. active environment : R_test_cf
  2. active env location : /home/rstrasser/.conda/envs/R_test_cf
  3. shell level : 1
  4. user config file : /home/rstrasser/.condarc
  5. populated config files : /home/rstrasser/.condarc
  6. conda version : 4.12.0
  7. conda-build version : 3.21.4
  8. python version : 3.8.8.final.0
  9. virtual packages : __linux=3.10.0=0
  10. __glibc=2.17=0
  11. __unix=0=0
  12. __archspec=1=x86_64
  13. base environment : /opt/anaconda/anaconda3 (read only)
  14. conda av data dir : /opt/anaconda/anaconda3/etc/conda
  15. conda av metadata url : None
  16. channel URLs : https://conda.anaconda.org/conda-forge/linux-64
  17. https://conda.anaconda.org/conda-forge/noarch
  18. https://repo.anaconda.com/pkgs/main/linux-64
  19. https://repo.anaconda.com/pkgs/main/noarch
  20. https://repo.anaconda.com/pkgs/r/linux-64
  21. https://repo.anaconda.com/pkgs/r/noarch
  22. package cache : /opt/anaconda/anaconda3/pkgs
  23. /home/rstrasser/.conda/pkgs
  24. envs directories : /home/rstrasser/.conda/envs
  25. /opt/anaconda/anaconda3/envs
  26. platform : linux-64
  27. 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
  28. UID:GID : 1003:1004
  29. netrc file : None
  30. 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

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

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

  1. LANG=en_US.UTF-8

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

答案2

得分: 0

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

  1. 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.

  1. 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:

确定