luaL_newstate 在 valgrind 下没有成功?

标签 lua valgrind luajit

我正在尝试在 64 位 Linux 下调试基于 luajit 的应用程序的一些问题。

该脚本通过 FFI 回调多个库,我正在尝试找出一些内存损坏问题。 Valgrind 通常是我选择的工具,但是我发现 luaL_newstate 在 Valgrind 下运行时会失败。

经过一番研究后,我发现标准 luajit 也无法加载。我认为这可能是 valgrind 的问题而不是 luajit 的问题。有没有办法给 valgrind 更多的内存?

最佳答案

如果您使用的 valgrind 版本从 3.9.0 版本开始一直到(但不包括)3.11.0 版本,则可能是问题所在。

这些版本似乎在使用 luajit 的 x86_64 上“损坏”。

参见this email来自迈克·帕尔:

[Note that Valgrind 3.9.0 has chosen to block MAP_32BIT, which breaks LuaJIT on Linux/x64:

https://bugs.kde.org/show_bug.cgi?id=324181

Older versions of Valgrind still work. It wasn't that useful to debug LuaJIT on x64, anyway, due to the mandatory use of the builtin allocator. But none of that relates to your problem.]

关于luaL_newstate 在 valgrind 下没有成功?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33905301/

相关文章:

c++ - 了解 Valgrind 输出

lua - 我可以从通过 string.dump() 检索的 lua 字节码中得到什么?

c++ - lua_open 使用 luaJIT 返回 null

Luajit 从当前工作目录而不是默认搜索路径加载共享对象

c++ - 将 Lua 嵌入到与 C 混合的 C++ 中

c - Valgrind 中未初始化字节错误

csv - 如何输出多于一列

c - 导致 sysMalloc 断言失败和双重 free() 错误的结构

c++ - C++和Lua之间的简单数学计算不同

module - 扩展标准库模块