已开启
go build -msan编出的二进制执行失败 #80
xu_lei_123创建于  2023年5月30日
xu_lei_123
xu_lei_123
2023年5月30日 创建

【标题描述】【kernel 4.19 & arm】【golang】 go build -msan编出的二进制执行失败,报错FATAL: Code xxx is out of application range...
【环境信息】
 硬件信息:
arm虚机
 软件信息:

【问题复现步骤】
1.安装包
yum install -y golang clang llvm compiler-rt
2.配置编译器为clang
export CC=clang
3.编译go代码
go build -msan main.go
4.运行二进制文件
./main

【预期结果】
执行成功  打印 “Hello, world!”
【实际结果】
FATAL: Code xxx is out of application range...

likedislike
xu_lei_123xu_lei_123
2023年5月30日 创建了任务
2023年5月30日 评论:

Hi xu_lei_123, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: sig-golang, and any of the maintainers: @jing-rui , @caihaomin , @genedna

likedislike
openeuler-ci-botopeneuler-ci-bot成员
2023年5月30日 添加了   sig/sig-golang 标签
xu_lei_123xu_lei_123
2023年5月30日 修改了描述
haozi007haozi007
2023年8月21日 将任务状态从 待办的 修改为已拒绝
haozi007haozi007
2023年8月21日 将任务状态从 已拒绝 修改为待办的
2023年10月23日 评论:

Hi xu_lei_123, welcome to the openEuler Community.
The description does not provide a specific version of Golang.
Can you provide a version?

likedislike
xu_lei_123
xu_lei_123
2023年10月23日 评论:

go版本1.15.7,希望该问题得以解决。

采用如下方法可以规避该问题,但没有从根本上解决该问题:
1、指定二进制执行不使用ASLR: setarch uname -m -R ./your_binary_file
2、临时关闭ASLR(地址空间布局随机化):sysctl -w kernel.randomize_va_space = 0;

likedislike