arch
(Evan(bx))
1
BMC Studio 后端启动失败:undefined symbol _CNat6FutureIG_E14executeClosureHF0G_E(Cangjie 运行时版本不匹配)
预置条件
- OS/架构:Ubuntu x86_64
- BMC Studio 安装路径:
/usr/share/bmc_studio
- 后端可执行:
/usr/share/bmc_studio/server/bmc_studio_server
- Cangjie Runtime 路径:
/opt/cangjie
- 现场版本对比:
- 失败:
Cangjie-0.53.13-linux_x64
- 成功:
cangjie-sdk-linux-x64-1.0.3.tar.gz(升级后可正常启动)
- 下载中心-仓颉编程语言官网 下载链接
操作步骤
- 在
Cangjie-0.53.13 环境下启动:
bash -x /usr/share/bmc_studio/bmc_studio.sh start
# 或:
cd /usr/share/bmc_studio/server && ./bmc_studio_server 8000
- 观察后端启动失败;执行依赖检查:
ldd ./bmc_studio_server | egrep 'cangjie|ssh2|telnet|securec|sqlite'
- 扫描运行时库以定位符号:
find /opt/cangjie/runtime/lib/linux_x86_64_llvm /usr/share/bmc_studio/server -name "*.so*" -print0 | \
xargs -0 -I{} sh -c '
nm -D "{}" 2>/dev/null | grep -q "_CNat6FutureIG_E14executeClosureHF0G_E" && echo "REFERS: {}"
nm -D "{}" 2>/dev/null | grep -q "executeClosureHF0G" && echo "MAYBE: {}"
'
- 将运行时升级为 Cangjie-1.0.3 后再次启动,问题消失。
结果描述
./bmc_studio_server: symbol lookup error: ./bmc_studio_server: undefined symbol: _CNat6FutureIG_E14executeClosureHF0G_E
ldd 显示 Cangjie 相关库来源正确(均指向 /opt/cangjie/runtime/lib/linux_x86_64_llvm),但 0.53.13 这套运行时未导出上述符号;例如扫描输出(节选):
REFERS: /opt/cangjie/runtime/lib/linux_x86_64_llvm/libcangjie-std-core.so
MAYBE: /opt/cangjie/runtime/lib/linux_x86_64_llvm/libcangjie-std-core.so
- 将运行时升级至 1.0.3 后,
bmc_studio_server 正常启动,错误不再出现。
预期结果
- 明确支持的 Cangjie 运行时版本下(建议 ≥ 1.0.0),
bmc_studio_server 能正常启动,不出现 symbol lookup error;目标符号在运行时中可被解析。
根因分析
bmc_studio_server 依赖的 Cangjie 标准库/运行时新增符号 _CNat6FutureIG_E14executeClosureHF0G_E,在 0.53.13 不存在;
- 属于运行时 ABI 不匹配(非脚本/顺序/路径问题)。
2 个赞