Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

![image](https://github.com/Tencent/LuaPanda/assets/16960038/542e775c-5686-4bb2-a702-25629b0229af) #183

Open
89cs opened this issue Apr 26, 2024 · 2 comments

Comments

@89cs
Copy link

89cs commented Apr 26, 2024

          ![image](https://github.com/Tencent/LuaPanda/assets/16960038/542e775c-5686-4bb2-a702-25629b0229af)

我看了下代码最后崩溃在luaD_hook中,这个函数的作用是在 lua_Debug 中填充调试信息,并调用调试器设置的hook函数。
看起来是因为 plibdebug 库中设置的 lua_hook 函数指针有问题,导致调用时崩溃了。

建议参照这个文档,把useCHook选项设置为false ,观察下效果看是否还会崩溃。
https://github.com/Tencent/LuaPanda/blob/e3ac3d3314f24cf939c36cac5b7dc1f2ed6ee129/Docs/Manual/launch-json-introduction.md

Originally posted by @stuartwang in #182 (comment)

您好,我把 useCHook 设为 false,还是崩溃,这是崩溃堆栈
20774a86a88f605556b030a6d8e3e997

@89cs
Copy link
Author

89cs commented Apr 26, 2024

ea74fe88324facb16c8ae16671c796d8

@stuartwang
Copy link
Collaborator

不好意思项目有点忙,我刚看到补充issue.

我看了下 luaH_getshortstr 是 Lua 的内部函数,看起来实在查询短字符串时出现了异常。我的分析是:

  • 因为 useCHook 设置为 false 时,调试器是纯 lua 代码编写的,不会调用chook模块加速。此时调试器使用 lua 层的 debug.xxx API 获取调试信息。如果调试器代码出错会产生 lua error 而不应造成崩溃。
  • 调用栈中都是 lua 内部函数。根据上一条issue提供的信息也就是在 debug.getinfo 接口内部出错了。

综合以上信息我分析是lua虚拟机代码被修改过或者遇到了什么边界情况导致lua虚拟机内部崩溃了,从调试器层我们目前没有办法绕过。如果有更详细的信息也可以提供给我,我再做分析

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants