Closed CsVeryLoveXieWenLi closed 6 months ago
抱歉,我不会说英语,英语都是谷歌机器翻译的。 Sorry, I don't speak English, the English is all machine translated by Google.
旧的问题。 old question.
我的代码,使用@bun,我的服务会出现错误。但是,不使用@bun,一切正常。 My code, using @bun, gives an error on my service. However, without using @bun, everything works fine.
经过我的再次测试,我觉得就是这样的BUG,就算不是也是相似吧。 After my re-test, I think it is just such a BUG, even if it is not, it is similar.
这BUG是内存访问越界吗,我查询了相关的资料,我觉得是这样。 Is this BUG an out-of-bounds memory access? I checked the relevant information and I think so.
在旧问题中,我提到了,可能是因为ptr函数转换的指针无效才导致问题。 In the old question, I mentioned that the problem might be caused by an invalid pointer converted by the ptr function.
可以测试一下,我要睡了。 You can test it, I'm going to sleep.
请问什么时候修复呢? When will it be repaired?
我使用了NodeAddon,发现也是这样,就算我使用dlopen单独导入,也是这样,看来并不只是ffi的问题。 I used NodeAddon and found that it was the same. Even if I used dlopen to import it separately, it was still the same. It seems that it is not just a problem with ffi.
经过我的测试,这个BUG已经在目前最新版本被修复了。 After my test, this BUG has been fixed in the latest version.
使用Bun版本:1.1.12+43f0913c3。 Using Bun version: 1.1.12+43f0913c3.
使用Opencv版本:4.9.0。 Using Opencv version: 4.9.0.
备注:仅仅在Linux下测试,该BUG也来源于Linux,在我的多台机器或服务器下测试均没问题。 Note: This is only tested on Linux. This BUG also comes from Linux. There is no problem when testing on multiple machines or servers.
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