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
Segfault when resizing and rendering SVG canvas #1380
Comments
Thanks for all the details. Were you changing the width/height of your canvas after you create it? Sorta confused by the stack trace; the code that crashed should only kick in when you use |
@zbjornson yes, sometimes we are changing the size a few times after creating the context. Sidenote: That's not very efficient of course, but unavoidable due to the way the we serialize/deserialize data. The rendered data is used by an interactive component in browsers where users can add/remove things that affect the size. Turns out it is indeed the resizing that is causing the crash. I can reproduce it with this simple example:
|
Thanks for confirming. That relates to one of the oldest open bugs then, #63 -- resizing a canvas is not a nice codepath right now, and I don't think its behavior conforms to spec either. |
@zbjornson Can confirm that the issue is fixed, thank you. Would it be possible to provide this fix in a new tagged version? |
Let's release 🚀 |
Released 2.6.0 🚀 |
Seems the MSYS2 issue from #1351 is back, so no Windows builds. I'll try to look into it soon |
We recently upgraded from 1.x to 2.x; now with the new version, the node process terminates with the following error when rendering SVG:
Other formats (PNG, PDF) work perfectly fine. I can also render an empty canvas as SVG; the error seems to related to the contents / issues rendering commands.
I did what the error message suggested, and came up with the following stacktrace. The last relevant frame here seems to be #15
Closure::writeVec [...] at closure.h:29
; then the actual crash happens somewhere inside some stdlib routines for string processing.Stacktrace: https://gist.github.com/Tharit/670228ebc114c97231ff6f71368d5696
It was created locally on OSX Mojave using node v8.9.4 and a debug build of node-canvas v2.3.1
I also tried node v10.15.3 in combination with node-canvas v2.3.1 and v2.0.0, to make sure the error was not related to the node version, or see if it was introduced recently. I could reproduce the crash with ALL versions.
The same crash is observed on our debian based live systems.
We were using a really old version of node-canvas before (v1.3.0), so at the moment I can only say that the issue appeared between v1.3.0 and v2.0.0, which is probably not super helpful.
I will try to see if I can isolate the issue down to a specific drawing command, but that could take some time. In the meantime, if there is some other information that I could provide please let me know.
The text was updated successfully, but these errors were encountered: