Skip to content
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 on %5C data #1

Closed
HKGx opened this issue Jun 21, 2021 · 3 comments
Closed

Segfault on %5C data #1

HKGx opened this issue Jun 21, 2021 · 3 comments

Comments

@HKGx
Copy link
Owner

HKGx commented Jun 21, 2021

MathJax renders %5C as SVG with width and height equal to 0 and it's throwing a segfault.

In code, we're simply to loadImage from SVG string buffer.

async function svgToCanvas(

PID 13004 received SIGSEGV for address: 0x25d66dad
SymInit: Symbol-SearchPath: '.;C:\Users\hkg90\Projects\rendertex;C:\Program Files\nodejs;C:\WINDOWS;C:\WINDOWS\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 530, UserName: 'hkg'
OS-Version: 10.0.19043 () 0x100-0x1
C:\Users\hkg90\Projects\rendertex\node_modules\segfault-handler\src\StackWalker.cpp (941): StackWalker::ShowCallstack
C:\Users\hkg90\Projects\rendertex\node_modules\segfault-handler\src\segfault-handler.cpp (242): segfault_handler
00007FFA42588A4C (ntdll): (filename not available): RtlDeleteAce
00007FFA42561276 (ntdll): (filename not available): RtlRaiseException
00007FFA425B0CAE (ntdll): (filename not available): KiUserExceptionDispatcher
00007FFA25D66DAD (libgobject-2.0-0): (filename not available): g_type_check_instance_is_fundamentally_a
00007FFA25D4B993 (libgobject-2.0-0): (filename not available): g_object_unref
00007FFA25EE87B4 (canvas): (filename not available): Canvas::data
00007FFA25EE5A22 (canvas): (filename not available): Canvas::data
00007FFA25EB6967 (canvas): (filename not available): Canvas::data
00007FF755D86479 (node): (filename not available): v8::internal::Builtins::builtin_handle
00007FF755D85A11 (node): (filename not available): v8::internal::Builtins::builtin_handle
00007FF755D85D01 (node): (filename not available): v8::internal::Builtins::builtin_handle
00007FF755D85B43 (node): (filename not available): v8::internal::Builtins::builtin_handle
00007FF755E5E6E1 (node): (filename not available): v8::internal::SetupIsolateDelegate::SetupHeap

I snooped out the log but it doesn't tell me much.

There's already an issue open at Automattic/node-canvas#1400 but it's not resolved

@HKGx
Copy link
Owner Author

HKGx commented Jun 21, 2021

For a simple hack we can implement the same thing used in: webhintio/hint#2204

though we probably should override the viewbox's 0 0 to 1 1

edit: setting viewbox doesn't work

@HKGx
Copy link
Owner Author

HKGx commented Jun 23, 2021

Current status: trying to see if https://github.com/lovell/sharp would do a better job

@HKGx
Copy link
Owner Author

HKGx commented Jun 23, 2021

Just pushed an update in 4b5a8b7, we switched over from canvas to sharp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant