Automattic / Automattic/node-canvas
Segfault if used with another native lib called naudiodon
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 1
Description
## Issue or Feature
- [] If this is an issue with installation, I have read the [troubleshooting guide](https://github.com/Automattic/node-canvas/issues/1511).
When using the getContext function it crashes the application.
```
...\node_modules\segfault-handler\src\StackWalker.cpp (941): StackWalker::ShowCallstack
...\node_modules\segfault-handler\src\segfault-handler.cpp (242): segfault_handler
00007FFC58327A8A (ntdll): (filename not available): RtlGetLengthWithoutLastFullDosOrNtPathElement
00007FFC582CE242 (ntdll): (filename not available): RtlFindCharInUnicodeString
00007FFC58304475 (ntdll): (filename not available): RtlRaiseException
00007FFC55C0565C (KERNELBASE): (filename not available): RaiseException
00007FFC5703B467 (msvcrt): (filename not available): CxxThrowException
00007FFC519EA5AE (DWrite): (filename not available): DWriteCreateFactory
00007FFC5198ECF1 (DWrite): (filename not available): (function-name not available)
00007FFC5198A26C (DWrite): (filename not available): (function-name not available)
00007FFC5198A0F6 (DWrite): (filename not available): (function-name not available)
00007FFC5198A055 (DWrite): (filename not available): (function-name not available)
00007FFC5199D50E (DWrite): (filename not available): (function-name not available)
00007FFC5199D324 (DWrite): (filename not available): (function-name not available)
00007FFC5198880E (DWrite): (filename not available): (function-name not available)
00007FFC51989CC9 (DWrite): (filename not available): (function-name not available)
00007FFC519893E0 (DWrite): (filename not available): (function-name not available)
00007FFC5197C41D (DWrite): (filename not available): (function-name not available)
00007FFC1E646ECD (libpangowin32-1.0-0): (filename not available): pango_win32_fontmap_cache_remove
00007FFC1E6471E5 (libpangowin32-1.0-0): (filename not available): pango_win32_font_get_dwrite_font_face
00007FFC1E64585E (libpangowin32-1.0-0): (filename not available): pango_win32_font_cache_unload
00007FFC1E97AD03 (libgobject-2.0-0): (filename not available): g_type_create_instance
00007FFC1E95D813 (libgobject-2.0-0): (filename not available): g_object_unref
00007FFC1E95F0A5 (libgobject-2.0-0): (filename not available): g_object_new_with_properties
00007FFC1E95FBD3 (libgobject-2.0-0): (filename not available): g_object_new
00007FFC437939A5 (libpangocairo-1.0-0): (filename not available): pango_cairo_font_map_get_default
00007FFC43791B73 (libpangocairo-1.0-0): (filename not available): pango_cairo_create_layout
00007FFC23318508 (canvas): (filename not available): Canvas::getHeight
00007FFC23304308 (canvas): (filename not available): Backend::getHeight
00007FF78796363D (node): (filename not available): v8::internal::Builtins::code
00007FF787962EC6 (node): (filename not available): v8::internal::Builtins::code
00007FF7879634F7 (node): (filename not available): v8::internal::Builtins::code
00007FF787963370 (node): (filename not available): v8::internal::Builtins::code
00007FF787A48151 (node): (filename not available): v8::internal::SetupIsolateDelegate::SetupHeap
00007FF7879C9420 (node): (filename not available): v8::internal::SetupIsolateDelegate::SetupHeap
00007FF787AE6553 (node): (filename not available): v8::internal::SetupIsolateDelegate::SetupHeap
```
## Steps to Reproduce
```sh
npm i naudiodon
npm i canvas
node index.js
```
Index.js:
```js
const portAudio = require('naudiodon');
const { createCanvas } = require('canvas');
(async () => {
const canvas = createCanvas(10, 10);
const ctx = canvas.getContext('2d');
})()
```
## Your Environment
OS: Windows 11@x86_64
* Version of node-canvas (output of `npm list canvas` or `yarn list canvas`): canvas@2.11.2
* Environment (e.g. node 20.9.0 on macOS 14.1.1): v18.16.0 and v20.10.0
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.