再会!我有一个关于在 tarantool 中重新加载 c 模块的小问题,例如:我有 c 模块,它公开了一个方法:
int calculate(lua_State* L);
另外我声明了入口点:
extern "C"
{
LUA_API int luaopen_cuendemodule(lua_State *L);
}
现在,我在 tarantool 中加载这个模块(“testmodule.so”):
require('testmodule')
box.schema.func.create('testmodule.calculate')
box.schema.user.grant('user', 'execute', 'function', 'testmodule.calculate')
现在我从我的 c# 客户端调用这个方法:
await tarantoolClient.Call<TarantoolTuple<CalculateParameters>, CalculationResults>("testmodule.calculate", TarantoolTuple.Create(....));
它按预期工作 - 执行方法计算并返回结果
但是如果我想更新我的模块而不是问题开始:在我替换so文件并调用计算方法后,我的tarantool重新启动,我可以在dmesg中看到类似“tarntool invalid opcode in testmodule.so”的内容
阅读文档后,我在函数定义中看到了额外的参数,如下所示:
box.schema.func.create('testmodule.calculate', {language = 'C'})
但在此之后,如果我从 c# 调用它,我会收到异常消息“无法动态加载函数未定义符号计算”
我在 ubuntu 上使用 tarantool 1.7 我用 gcc 8.1.0 编译