fsanitize =未定义会导致链接器错误

如何解决fsanitize =未定义会导致链接器错误

我正在尝试使用conda g ++编译器使用-fsanitize = undefined来编译程序。我遇到了__ubsan_handle_type_mismatch链接器错误。我已经按照以下建议在编译和链接中使用了标志:

包括在链接末尾添加-lubsan并编译我不推荐的命令,但是我没有成功。我还确保了我的LD_LIBRARY_PATH为空,以确保在这方面没有任何麻烦。

下面是一个最小的示例问题,其中包括我的python环境的配置

vehicles.h

#include<string>
#include<memory>

#ifndef VEHICLES
#define VEHICLES

class vehicle{

    public:
        vehicle( );

        std::shared_ptr< vehicle > buildVehicle( const std::string & _type );

    protected:

        std::string type;

        unsigned int wheel_count;

};

class truck : public vehicle{

    public:
        truck( );

};

#endif

vehicles.cpp

#include "vehicles.h"

vehicle::vehicle( ){

    return;
}

std::shared_ptr< vehicle > vehicle::buildVehicle( const std::string &_type ){

    if ( _type.compare( "truck" ) ){

        return std::make_shared< vehicle >( );

    }

    return NULL;

}

truck::truck( ){

    type = "truck";
    wheel_count = 4;

}

test.cpp

#include "vehicles.h"
#include<iostream>

int main( ){

    //Build a truck
    std::shared_ptr< vehicle > truck = vehicle( ).buildVehicle( "truck" );

    std::cout << "Built a truck\n";

}

makefile

EXECUTABLE = eval
OBJECTS = test.o vehicles.o
INCS = -I. -I/home/nathan/anaconda3/include
LIBS = -L/home/nathan/anaconda3/lib
FLAGS = -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr

eval: $(OBJECTS)
        $(CXX) $(INCS) $(LIBS) -o $@ $^ $(FLAGS)

test.o: test.cpp vehicles.h
        $(CXX) $(INCS) $(LIBS) -c $< $(FLAGS)

vehicles.o: vehicles.cpp vehicles.h
        $(CXX) $(INCS) $(LIBS) -c $< $(FLAGS)

clean:
        rm -f $(EXECUTABLE)
        rm -f $(OBJECTS)

.PHONY: all clean

我的conda环境YAML文件是:

name: compile
channels:
  - anaconda
  - conda-forge
  - defaults
dependencies:
  - _libgcc_mutex=0.1=conda_forge
  - _openmp_mutex=4.5=1_gnu
  - binutils=2.32=he1b5a44_3
  - binutils_impl_linux-64=2.31.1=h7fc9f1b_5
  - binutils_linux-64=2.31.1=h6176602_9
  - bzip2=1.0.8=h516909a_3
  - c-ares=1.16.1=h516909a_3
  - c-compiler=1.1.1=h516909a_0
  - ca-certificates=2020.6.20=hecda079_0
  - certifi=2020.6.20=py38h32f6830_0
  - cmake=3.18.2=h5c55442_0
  - cxx-compiler=1.1.1=hc9558a2_0
  - expat=2.2.9=he1b5a44_2
  - gcc_impl_linux-64=7.3.0=habb00fd_1
  - gcc_linux-64=7.3.0=h553295d_9
  - gxx_impl_linux-64=7.3.0=hdf63c60_1
  - gxx_linux-64=7.3.0=h553295d_9
  - hdf5=1.12.0=nompi_h54c07f9_101
  - icu=67.1=he1b5a44_0
  - jpeg=9d=h516909a_0
  - krb5=1.17.1=hfafb76e_3
  - ld_impl_linux-64=2.34=h53a641e_7
  - libcurl=7.71.1=hcdd3856_5
  - libedit=3.1.20191231=he28a2e2_2
  - libev=4.33=h516909a_1
  - libffi=3.2.1=he1b5a44_1007
  - libgcc-ng=9.3.0=h24d8f2e_16
  - libgfortran-ng=7.5.0=hdf63c60_16
  - libgomp=9.3.0=h24d8f2e_16
  - libiconv=1.16=h516909a_0
  - libnghttp2=1.41.0=h8cfc5f6_2
  - libssh2=1.9.0=hab1572f_5
  - libstdcxx-ng=9.3.0=hdf63c60_16
  - libtiff=4.1.0=h2733197_1
  - libuv=1.39.0=h516909a_0
  - libxml2=2.9.10=h68273f3_2
  - lz4-c=1.9.2=he1b5a44_3
  - ncurses=6.2=he1b5a44_1
  - openssl=1.1.1g=h516909a_1
  - pcre=8.44=he1b5a44_0
  - pip=20.2.3=py_0
  - python=3.8.5=h1103e12_7_cpython
  - python_abi=3.8=1_cp38
  - readline=8.0=he28a2e2_2
  - rhash=1.3.6=h14c3975_1001
  - setuptools=49.6.0=py38h32f6830_0
  - sqlite=3.33.0=h4cf870e_0
  - swig=4.0.2=he1b5a44_0
  - tk=8.6.10=hed695b0_0
  - wheel=0.35.1=pyh9f0ad1d_0
  - xz=5.2.5=h516909a_1
  - zlib=1.2.11=h516909a_1009
  - zstd=1.4.4=h6597ccf_3
prefix: /home/nathan/anaconda3/envs/compile

make的结果是:

/home/nathan/anaconda3/envs/compile/bin/x86_64-conda_cos6-linux-gnu-c++ -I. -I/home/nathan/anaconda3/include -L/home/nathan/anaconda3/lib -c test.cpp -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr
/home/nathan/anaconda3/envs/compile/bin/x86_64-conda_cos6-linux-gnu-c++ -I. -I/home/nathan/anaconda3/include -L/home/nathan/anaconda3/lib -c vehicles.cpp -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr
/home/nathan/anaconda3/envs/compile/bin/x86_64-conda_cos6-linux-gnu-c++ -I. -I/home/nathan/anaconda3/include -L/home/nathan/anaconda3/lib -o eval test.o vehicles.o -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr
/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: test.o: in function `__gnu_cxx::__exchange_and_add_single(int*,int)':
test.cpp:(.text+0xa8): undefined reference to `__ubsan_handle_type_mismatch'
/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: test.cpp:(.text+0x10d): undefined reference to `__ubsan_handle_type_mismatch'
/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: test.cpp:(.text+0x158): undefined reference to `__ubsan_handle_type_mismatch'
/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: test.o: in function `main':
test.cpp:(.text+0x2d4): undefined reference to `__ubsan_handle_type_mismatch'
/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: test.o: in function `vehicle::~vehicle()':
test.cpp:(.text._ZN7vehicleD2Ev[_ZN7vehicleD5Ev]+0x2f): undefined reference to `__ubsan_handle_type_mismatch'
/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: test.o:test.cpp:(.text._ZN7vehicleD2Ev[_ZN7vehicleD5Ev]+0x5c): more undefined references to `__ubsan_handle_type_mismatch' follow
collect2: error: ld returned 1 exit status
makefile:8: recipe for target 'eval' failed
make: *** [eval] Error 1

编辑:使用详细的链接程序重新运行

/home/nathan/anaconda3/envs/compile/bin/x86_64-conda_cos6-linux-gnu-c++ -I. -I/home/nathan/anaconda3/include -L/home/nathan/anaconda3/lib -c test.cpp -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr
/home/nathan/anaconda3/envs/compile/bin/x86_64-conda_cos6-linux-gnu-c++ -I. -I/home/nathan/anaconda3/include -L/home/nathan/anaconda3/lib -c vehicles.cpp -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr
/home/nathan/anaconda3/envs/compile/bin/x86_64-conda_cos6-linux-gnu-c++ -I. -I/home/nathan/anaconda3/include -L/home/nathan/anaconda3/lib -v -o eval test.o vehicles.o -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr
Reading specs from /home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/specs
COLLECT_GCC=/home/nathan/anaconda3/envs/compile/bin/x86_64-conda_cos6-linux-gnu-c++
COLLECT_LTO_WRAPPER=/home/nathan/anaconda3/envs/compile/bin/../libexec/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/lto-wrapper
Target: x86_64-conda_cos6-linux-gnu
Configured with: /home/rdonnelly/mc/conda-bld/compilers_linux-64_1534865402226/work/.build/x86_64-conda_cos6-linux-gnu/src/gcc/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=x86_64-conda_cos6-linux-gnu --prefix=/home/rdonnelly/mc/conda-bld/compilers_linux-64_1534865402226/work/gcc_built --with-sysroot=/home/rdonnelly/mc/conda-bld/compilers_linux-64_1534865402226/work/gcc_built/x86_64-conda_cos6-linux-gnu/sysroot --enable-languages=c,c++,fortran,objc,obj-c++ --with-pkgversion='crosstool-NG 1.23.0.449-a04d0' --enable-__cxa_atexit --disable-libmudflap --enable-libgomp --disable-libssp --enable-libquadmath --enable-libquadmath-support --enable-libsanitizer --enable-libmpx --with-gmp=/home/rdonnelly/mc/conda-bld/compilers_linux-64_1534865402226/work/.build/x86_64-conda_cos6-linux-gnu/buildtools --with-mpfr=/home/rdonnelly/mc/conda-bld/compilers_linux-64_1534865402226/work/.build/x86_64-conda_cos6-linux-gnu/buildtools --with-mpc=/home/rdonnelly/mc/conda-bld/compilers_linux-64_1534865402226/work/.build/x86_64-conda_cos6-linux-gnu/buildtools --with-isl=/home/rdonnelly/mc/conda-bld/compilers_linux-64_1534865402226/work/.build/x86_64-conda_cos6-linux-gnu/buildtools --enable-lto --enable-threads=posix --enable-target-optspace --enable-plugin --enable-gold --disable-nls --disable-multilib --with-local-prefix=/home/rdonnelly/mc/conda-bld/compilers_linux-64_1534865402226/work/gcc_built/x86_64-conda_cos6-linux-gnu/sysroot --enable-long-long --enable-default-pie
Thread model: posix
gcc version 7.3.0 (crosstool-NG 1.23.0.449-a04d0) 
COMPILER_PATH=/home/nathan/anaconda3/envs/compile/bin/../libexec/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/:/home/nathan/anaconda3/envs/compile/bin/../libexec/gcc/:/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/
LIBRARY_PATH=/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/:/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/:/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/lib/../lib/:/home/nathan/anaconda3/envs/compile/bin/../x86_64-conda_cos6-linux-gnu/sysroot/lib/../lib/:/home/nathan/anaconda3/envs/compile/bin/../x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/../lib/:/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/lib/:/home/nathan/anaconda3/envs/compile/bin/../x86_64-conda_cos6-linux-gnu/sysroot/lib/:/home/nathan/anaconda3/envs/compile/bin/../x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/
COLLECT_GCC_OPTIONS='-I' '.' '-I' '/home/nathan/anaconda3/include' '-L/home/nathan/anaconda3/lib' '-v' '-o' 'eval' '-fsanitize=address' '-fsanitize=undefined' '-fno-sanitize=vptr' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /home/nathan/anaconda3/envs/compile/bin/../libexec/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/collect2 -plugin /home/nathan/anaconda3/envs/compile/bin/../libexec/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/liblto_plugin.so -plugin-opt=/home/nathan/anaconda3/envs/compile/bin/../libexec/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccaD6hAv.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/home/nathan/anaconda3/envs/compile/bin/../x86_64-conda_cos6-linux-gnu/sysroot --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o eval /home/nathan/anaconda3/envs/compile/bin/../x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/../lib/Scrt1.o /home/nathan/anaconda3/envs/compile/bin/../x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/../lib/crti.o /home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/crtbeginS.o -L/home/nathan/anaconda3/lib -L/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0 -L/home/nathan/anaconda3/envs/compile/bin/../lib/gcc -L/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/lib/../lib -L/home/nathan/anaconda3/envs/compile/bin/../x86_64-conda_cos6-linux-gnu/sysroot/lib/../lib -L/home/nathan/anaconda3/envs/compile/bin/../x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/../lib -L/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/lib -L/home/nathan/anaconda3/envs/compile/bin/../x86_64-conda_cos6-linux-gnu/sysroot/lib -L/home/nathan/anaconda3/envs/compile/bin/../x86_64-conda_cos6-linux-gnu/sysroot/usr/lib -rpath /home/nathan/anaconda3/envs/compile/lib /home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/lib/../lib/libasan_preinit.o -lasan test.o vehicles.o -lstdc++ -lm -lubsan -lgcc_s -lgcc -lc -lgcc_s -lgcc /home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/crtendS.o /home/nathan/anaconda3/envs/compile/bin/../x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/../lib/crtn.o
/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: test.o: in function `__gnu_cxx::__exchange_and_add_single(int*,int)':
test.cpp:(.text+0xa8): undefined reference to `__ubsan_handle_type_mismatch'
/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: test.cpp:(.text+0x10d): undefined reference to `__ubsan_handle_type_mismatch'
/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: test.cpp:(.text+0x158): undefined reference to `__ubsan_handle_type_mismatch'
/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: test.o: in function `main':
test.cpp:(.text+0x2d4): undefined reference to `__ubsan_handle_type_mismatch'
/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: test.o: in function `vehicle::~vehicle()':
test.cpp:(.text._ZN7vehicleD2Ev[_ZN7vehicleD5Ev]+0x2f): undefined reference to `__ubsan_handle_type_mismatch'
/home/nathan/anaconda3/envs/compile/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: test.o:test.cpp:(.text._ZN7vehicleD2Ev[_ZN7vehicleD5Ev]+0x5c): more undefined references to `__ubsan_handle_type_mismatch' follow
collect2: error: ld returned 1 exit status
makefile:8: recipe for target 'eval' failed
make: *** [eval] Error 1

解决方法

可能存在一些可能的问题。

频道混合

在共享库中缺少引用是混合来自不同渠道的程序包构建的典型症状。这是因为不同的通道使用不同的构建堆栈,因此符号在这些堆栈下编译的共享库中可能具有不同的名称。

尝试从一个渠道获取尽可能多的软件包。由于大多数人经常需要至少一个仅位于 conda-forge 上的软件包,因此最通用的解决方案是在创建环境时赋予 conda-forge 优先级,即尝试

channels:
  - conda-forge
  - defaults

在YAML中(请注意 anaconda 默认值的子集,因此不需要)。

标志不一致

当前,INCSLIBS环境变量被设置为指向 base 环境。这也可能导致频道混合问题,因为基本通常由默认值频道中的程序包构建控制。

相反,将这些变量指向 compile 环境更有意义。

INCS = -I. -I/home/nathan/anaconda3/envs/compile/include
LIBS = -L/home/nathan/anaconda3/envs/compile/lib

覆盖环境标志

通过安装诸如cxx-compiler之类的元软件包而来的Conda构建堆栈包括带有激活脚本的软件包,这些激活脚本会自动操纵编译器和链接器环境变量。例如,在anaconda3/envs/compile/etc/conda/activate.d/下进行检查。也就是说,环境可能已经具有默认配置,该默认配置可以在激活时 正确配置标头和运行时依赖项的路径。

通过设置INCS和/或LIBS可能会覆盖或干扰这些内容,因此完全省略此类手动说明可能就足够了。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res