-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
bun:ffi module error: Segmentation fault. #6933
Comments
抱歉,我不会说英语,英语都是谷歌机器翻译的。 |
旧的问题。 |
这BUG是内存访问越界吗,我查询了相关的资料,我觉得是这样。 |
在旧问题中,我提到了,可能是因为ptr函数转换的指针无效才导致问题。 可以测试一下,我要睡了。 |
请问什么时候修复呢? 我使用了NodeAddon,发现也是这样,就算我使用dlopen单独导入,也是这样,看来并不只是ffi的问题。 |
经过我的测试,这个BUG已经在目前最新版本被修复了。 使用Bun版本:1.1.12+43f0913c3。 使用Opencv版本:4.9.0。 |
备注:仅仅在Linux下测试,该BUG也来源于Linux,在我的多台机器或服务器下测试均没问题。 |
What version of Bun is running?
1.0.9+98f20170a
What platform is your computer?
Linux version 5.10.0-25-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.191-1 (2023-08-16)
1. 重现BUG || Reproduce BUG
设置好bun的注释、在函数setTimeout里调用共享库的函数、设置合理的延迟时间,就能重现BUG。
By setting the comments of the bun, calling the shared library function in the setTimeout function, and setting a reasonable delay time, the BUG can be reproduced.
共享库的函数需要访问内存,100毫秒以上的时间就能触发BUG,不行就多加点时间。
The functions of the shared library need to access memory, and it can trigger a BUG in more than 100 milliseconds. If not, add more time.
在这里我调用了函数imdecode,这是opencv库中一个从内存数据中解码图片的函数。
Here I called the function imdecode, which is a function in the opencv library that decodes images from memory data.
2. 预期输出 || expect output
过低的延迟导致无法重现BUG,成功执行共享库的函数,输出正确的数字。
Excessive low latency makes it impossible to reproduce the BUG, successfully execute the function of the shared library, and output the correct number.
3. 错误输出 || error output
重现BUG。
Reproduce the BUG.
4. 附加说明 || Additional information
如果你有别的问题,不相信我说的,请下载我的源代码调试或者你编写代码自行重现。我使用了版本为4.8.0的opencv库。
If you have other questions and don't believe what I say, please download my source code for debugging or write code to reproduce it yourself. I used the opencv library with version 4.8.0.
如果这个不是bun本身的BUG,我感到很抱歉。
I'm sorry if this is not a bug in the bun itself.
我的源代码 || my source code
The text was updated successfully, but these errors were encountered: