Replies: 6 comments
-
通过加 LD_PRELOAD 可解决。 sudo LD_PRELOAD=libasan.so.8:libubsan.so.1 python3 ../src/pymodule/test.py |
Beta Was this translation helpful? Give feedback.
-
It can be solved by adding LD_PRELOAD. sudo LD_PRELOAD=libasan.so.8:libubsan.so.1 python3 ../src/pymodule/test.py |
Beta Was this translation helpful? Give feedback.
-
shared 得用 add_shflags. 另外有内置的
|
Beta Was this translation helpful? Give feedback.
-
我们想同时支持 asan ubsan 这些,这个配置是不是就不行? |
Beta Was this translation helpful? Give feedback.
-
参考内部 rules 配置,自己定制 |
Beta Was this translation helpful? Give feedback.
-
Refer to the internal rules configuration and customize it yourself |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Xmake 版本
xmake v2.8.1+20230728
操作系统版本和架构
Linux 10-16-43-32 5.14.0-70.13.1.el9_0.x86_64 #1 SMP PREEMPT Wed May 25 21:01:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
描述问题
使用 c++ 开发 python 的 so 模块,debug 版本会加上
编译普通的 binary 时,link 会加上 ldflags,但是编译 shared 共享库时不会。
这在开发 python 模块时会遇到问题,python 解释器通常没有去 link sanitizer,导致 python 在 load 对应的共享库时会报 undefined 错误。
期待的结果
link 动态库时也需要加上 -fsanitize=address 等相关的 link 选项。
工程配置
以下是一个最小复现的例子
附加信息和错误日志
无
Beta Was this translation helpful? Give feedback.
All reactions