-
Notifications
You must be signed in to change notification settings - Fork 51
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
Crash occurs in Node20 environment #134
Comments
I'm currently working on the V7. I will invite you soon to try it :) |
It seems that you can reproduce it just by calling copyAsync(). + const frame = await img.copyAsync(); // this method call will be the trigger
- const copied = await img.copyAsync(); // this method call will be the trigger
- frame = applyMask(copied, maskbits); |
you can try the Version 7.0.0-alpha-5. |
the version should works as ESM and CJS |
7.0.0-alpha-6 is out, and works fine as ESM. |
@u4/[email protected] exports were incorrect. |
@u4/opencv4nodejs@7 is out. |
Although v7.0.0 has been released, the installation fails in my environment due to the following problem.
It looks like the python logic is treating something as UTF-8. Attach the log below. npm error log
Also, in the change logs,
However, is there a way to prevent this when npm install? This behavior is not desirable for me.
|
I notice some strange error with nodeJS 22. what is your environement ? |
Below is my environment.
|
Some progress has been made on installation issues. factor
By applying the above patch, I was just able to build and run it. |
Unfortunately, I have confirmed that the crash problem still occurs even with v7.0.0 installed with the above fix. How to reproduce the issue
NodeJS : 20.12.2 |
Thank you for your great job.
The case of calling some specific API in a Node20 environment, the application seems to crash when garbage collection occurs.
The issue has been confirmed in the Node20 environment on both Windows 11 and ubuntu 22.04. It does not occur in a Node18 environment.
It is also independent of OpenCV version. I confirmed with v4.7.0 and v4.9.0.
According to this article, there seems to have been a change in the garbage collection mechanism with Node20, but I don't know the details.
Condition
It seems to occur when operating on copyAsync() memory through map().
This issue does not happen if you use copy() instead of copyAsync() or if you use the original data as is.
However, it is possible that there are other APIs besides copyAsync() that are problematic.
Error Message
How to reproduce the issue
Unzip cv-crash-case.zip
npm ci
npm run rebuild
node ./node_modules/@u4/opencv4nodejs/bin/install.js rebuild
npm start
OpenCV version : 4.9.0 (4.7.0)
With OpenCV-contrib? : no
OS: Windows 11, Ubuntu 22.04 (WSL2)
Build Tools (Win): Visual Studio Build Tools 2017 (15.9.42)
I hope this report helps you solve this problem.
The text was updated successfully, but these errors were encountered: