2509 bmcstudio 启动异常修复分享

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
  • 现场版本对比:

操作步骤

  1. Cangjie-0.53.13 环境下启动:
bash -x /usr/share/bmc_studio/bmc_studio.sh start
# 或:
cd /usr/share/bmc_studio/server && ./bmc_studio_server 8000
  1. 观察后端启动失败;执行依赖检查:
ldd ./bmc_studio_server | egrep 'cangjie|ssh2|telnet|securec|sqlite'
  1. 扫描运行时库以定位符号:
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: {}"
'
  1. 将运行时升级为 Cangjie-1.0.3 后再次启动,问题消失。

结果描述

  • 0.53.13 环境下,后端启动失败,报错:
./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 个赞