You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you using the latest version? Is the version currently in use as reported by npm ls sharp the same as the latest version as reported by npm view sharp dist-tags.latest?
yes
What are the steps to reproduce?
When creating a raw buffer .data() from an skr-canvas canvas, then passing it into sharp, sharp crashes (after the first or a few attempts on different instances) when using toBuffer() on this instance:
Please can you provide a standalone repo including dependency versions in apackage.json, complete, minimal code and images that allows someone else to reproduce this.
My best guess would be that the @napi-rs/canvas module is susceptible to nodejs/node#32463 and may need to add code to workaround a race condition when multiple Buffer instances can point to the same memory location.
sharp does not do this and is not susceptible to this problem on its own - please see #2196
Instead of passing the canvas data directly, I use a pool of existing instances, along with buffers they copy to, and do the copy at the end of drawing and pass this copy into sharp. There's almost no noticeable time overhead. There's a separate issue regarding memory not being released but I don't think that's relevant here.
Are you using the latest version? Is the version currently in use as reported by
npm ls sharp
the same as the latest version as reported bynpm view sharp dist-tags.latest
?yes
What are the steps to reproduce?
When creating a raw buffer
.data()
from an skr-canvas canvas, then passing it into sharp, sharp crashes (after the first or a few attempts on different instances) when usingtoBuffer()
on this instance:That is to say, sometimes it doesn't crash, but after a few re-runs of the function, it always eventually crashes.
What is the output of running
npx envinfo --binaries --system
?The text was updated successfully, but these errors were encountered: