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

about napi version. #2338

Open
xicilion opened this issue Jan 13, 2024 · 1 comment
Open

about napi version. #2338

xicilion opened this issue Jan 13, 2024 · 1 comment

Comments

@xicilion
Copy link

It looks like the canvas module was compiled with an earlier version of node-addon-api, and as a result introduces a dependency on references to v8 functions, which may lead to compatibility issues with later versions of nodejs, or with non-v8 napi runtimes.

Under linux, this can be seen with objdump:

objdump -R node_modules/canvas/build/Release/canvas.node | grep v8

This command returns something like the following:

0000000000059b20 R_X86_64_JUMP_SLOT  _ZN3Nan3SetEN2v85LocalINS0_6ObjectEEENS1_INS0_5ValueEEES5_@@Base
0000000000059b30 R_X86_64_JUMP_SLOT  _Z9str_valueN2v85LocalINS_5ValueEEEPKcb@@Base
0000000000059b68 R_X86_64_JUMP_SLOT  _ZN2v816FunctionTemplate16InstanceTemplateEv
0000000000059b80 R_X86_64_JUMP_SLOT  _ZN2v812api_internal8MakeWeakEPmPvPFvRKNS_16WeakCallbackInfoIvEEENS_16WeakCallbackTypeE
0000000000059b88 R_X86_64_JUMP_SLOT  _ZN2v816FunctionTemplate11GetFunctionENS_5LocalINS_7ContextEEE
0000000000059ba0 R_X86_64_JUMP_SLOT  _ZN2v812Float64Array3NewENS_5LocalINS_11ArrayBufferEEEmm
0000000000059bb0 R_X86_64_JUMP_SLOT  _ZN2v88TryCatch7ReThrowEv
0000000000059bc8 R_X86_64_JUMP_SLOT  _ZN2v811Uint16Array3NewENS_5LocalINS_11ArrayBufferEEEmm
0000000000059bd0 R_X86_64_JUMP_SLOT  _ZN2v88TryCatchC1EPNS_7IsolateE
0000000000059c28 R_X86_64_JUMP_SLOT  _ZN2v88internal35IsolateFromNeverReadOnlySpaceObjectEm
0000000000059c30 R_X86_64_JUMP_SLOT  _ZN2v87Context6GlobalEv
0000000000059c38 R_X86_64_JUMP_SLOT  _ZN2v88External3NewEPNS_7IsolateEPv
0000000000059c40 R_X86_64_JUMP_SLOT  _ZNK2v88External5ValueEv
0000000000059c48 R_X86_64_JUMP_SLOT  _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeEPKNS_9CFunctionEttt
0000000000059c80 R_X86_64_JUMP_SLOT  _ZNK2v86String6LengthEv
0000000000059ce0 R_X86_64_JUMP_SLOT  _ZNK2v86Object18InternalFieldCountEv
0000000000059cf0 R_X86_64_JUMP_SLOT  _ZNK2v85Value8ToStringENS_5LocalINS_7ContextEEE
0000000000059d00 R_X86_64_JUMP_SLOT  _ZN5Image10InitializeEN2v85LocalINS0_6ObjectEEE@@Base
0000000000059d18 R_X86_64_JUMP_SLOT  _ZN2v812api_internal17FromJustIsNothingEv
0000000000059d50 R_X86_64_JUMP_SLOT  _ZNK2v84Date7ValueOfEv
0000000000059d68 R_X86_64_JUMP_SLOT  _ZN2v820EscapableHandleScopeC1EPNS_7IsolateE
0000000000059db8 R_X86_64_JUMP_SLOT  _ZNK2v88Function11NewInstanceENS_5LocalINS_7ContextEEEiPNS1_INS_5ValueEEE
0000000000059de8 R_X86_64_JUMP_SLOT  _ZN2v815ArrayBufferView6BufferEv
0000000000059df8 R_X86_64_JUMP_SLOT  _ZN2v86Object38SlowGetAlignedPointerFromInternalFieldEi
0000000000059e30 R_X86_64_JUMP_SLOT  _ZN12ImageBackend10InitializeEN2v85LocalINS0_6ObjectEEE@@Base
0000000000059e48 R_X86_64_JUMP_SLOT  _ZN2v87Integer15NewFromUnsignedEPNS_7IsolateEj
0000000000059e68 R_X86_64_JUMP_SLOT  _ZN2v816FunctionTemplate11HasInstanceENS_5LocalINS_5ValueEEE
0000000000059e80 R_X86_64_JUMP_SLOT  _ZNK2v85Value8IsUint32Ev
0000000000059eb8 R_X86_64_JUMP_SLOT  _ZN7Backend4initERKN3Nan20FunctionCallbackInfoIN2v85ValueEEE@@Base
0000000000059ed0 R_X86_64_JUMP_SLOT  _ZN2v88Function4CallENS_5LocalINS_7ContextEEENS1_INS_5ValueEEEiPS5_
0000000000059f10 R_X86_64_JUMP_SLOT  _ZNK2v812BackingStore4DataEv
0000000000059f38 R_X86_64_JUMP_SLOT  _ZN7Pattern10InitializeEN2v85LocalINS0_6ObjectEEE@@Base
0000000000059f50 R_X86_64_JUMP_SLOT  _ZN2v814ObjectTemplate11NewInstanceENS_5LocalINS_7ContextEEE
0000000000059fa0 R_X86_64_JUMP_SLOT  _ZN2v811HandleScopeD1Ev
0000000000059fc0 R_X86_64_JUMP_SLOT  _ZN3Nan3imp9ToFactoryIiE7convertEN2v85LocalINS3_5ValueEEE@@Base
0000000000059fc8 R_X86_64_JUMP_SLOT  _ZNK2v85Value11NumberValueENS_5LocalINS_7ContextEEE
0000000000059fd0 R_X86_64_JUMP_SLOT  _ZN2v811ArrayBuffer15GetBackingStoreEv
0000000000059fe0 R_X86_64_JUMP_SLOT  _ZN3Nan3GetEN2v85LocalINS0_6ObjectEEENS1_INS0_5ValueEEE@@Base
0000000000059ff0 R_X86_64_JUMP_SLOT  _ZN9Context2d11setFillRuleEN2v85LocalINS0_5ValueEEE@@Base
000000000005a020 R_X86_64_JUMP_SLOT  _ZN2v87Isolate17GetCurrentContextEv
000000000005a068 R_X86_64_JUMP_SLOT  _ZNK2v85Value8ToObjectENS_5LocalINS_7ContextEEE
000000000005a098 R_X86_64_JUMP_SLOT  _ZNK2v85Value8IsNumberEv
000000000005a0d0 R_X86_64_JUMP_SLOT  _ZN2v814ObjectTemplate21SetInternalFieldCountEi
000000000005a0e8 R_X86_64_JUMP_SLOT  _ZN2v87Context10GetIsolateEv
000000000005a100 R_X86_64_JUMP_SLOT  _ZN2v88Template3SetENS_5LocalINS_4NameEEENS1_INS_4DataEEENS_17PropertyAttributeE
000000000005a138 R_X86_64_JUMP_SLOT  _ZN2v86Object3GetENS_5LocalINS_7ContextEEENS1_INS_5ValueEEE

Example:

000000000005a0e8 R_X86_64_JUMP_SLOT  _ZN2v87Context10GetIsolateEv

is a reference to v8::Context::GetIsolate().

In order to fix this issue, it may be necessary to change to a newer version node-addon-api and do some testing.

@zbjornson
Copy link
Collaborator

Please provide the issue in the issue template. Unless you're installing from GitHub, you're using the NAN version still, as we haven't published the NAPI release yet.

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

No branches or pull requests

2 participants