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

fix(NODE-6108): allow building from source on latest Node.js 20.x #172

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

addaleax
Copy link
Contributor

See nodejs/node#52229 – addons using certain features of the node-addon-api package have been broken by an upstream Node.js change if they were setting NAPI_EXPERIMENTAL, which kerberos is doing.

Description

What is changing?

Is there new documentation needed for these changes?

What is the motivation for this change?

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

See nodejs/node#52229 – addons using certain features
of the node-addon-api package have been broken by an upstream Node.js change if
they were setting `NAPI_EXPERIMENTAL`, which `kerberos` is doing.
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Apr 19, 2024
@nbbeeken nbbeeken self-assigned this Apr 19, 2024
Copy link
Collaborator

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I caught up on the conversation in the related node issue, LGTM

@nbbeeken nbbeeken merged commit c1f7aca into main Apr 19, 2024
7 of 9 checks passed
@nbbeeken nbbeeken deleted the node-api-nogc-env-opt-out branch April 19, 2024 14:57
@pcicman
Copy link

pcicman commented Jul 3, 2024

Whereas the build of 2.1.1-alpha seems to work on RHEL 8.9, node 20.15.0, an attempt to invoke any of the API methods seems to lead to SEGFAULT.
The situation seems to be the same/simillar for node 20.11.1 / kerberos 2.0.1, also SEGFAULT.

PID 10833 received SIGSEGV for address: 0x18
/opt/vestr/node_modules/segfault-handler/build/Release/segfault-handler.node(+0x2f86)[0x42ac50cf86]
/lib64/libpthread.so.0(+0x12cf0)[0x400157ecf0]
/lib64/libc.so.6(cfree+0x21)[0x4001827e31]
/lib64/libcrypto.so.1.1(+0x185c7d)[0x42ad876c7d]
/lib64/libcrypto.so.1.1(+0x185ccd)[0x42ad876ccd]
/lib64/libk5crypto.so.3(krb5int_derive_random+0x2c8)[0x42acecaa18]
/lib64/libk5crypto.so.3(+0x9ae5)[0x42acecaae5]
/lib64/libk5crypto.so.3(+0xf70a)[0x42aced070a]
/lib64/libk5crypto.so.3(+0xfb2d)[0x42aced0b2d]
/lib64/libk5crypto.so.3(krb5_c_string_to_key_with_params+0x127)[0x42aced1187]
/lib64/libkrb5.so.3(+0x56af0)[0x42ac9d7af0]
/lib64/libkrb5.so.3(krb5_init_creds_step+0xf91)[0x42ac9d4851]
/lib64/libkrb5.so.3(+0x54bc1)[0x42ac9d5bc1]
/lib64/libkrb5.so.3(+0x54d2b)[0x42ac9d5d2b]
/lib64/libkrb5.so.3(krb5_get_init_creds_password+0x148)[0x42ac9d8038]
/opt/vestr/node_modules/kerberos/build/Release/kerberos.node(_ZN13node_kerberos25authenticate_user_krb5pwdEPKcS1_S1_S1_+0x34a)[0x42ac76d5fa]
/opt/vestr/node_modules/kerberos/build/Release/kerberos.node(+0x20552)[0x42ac770552]
/opt/vestr/node_modules/kerberos/build/Release/kerberos.node(_ZN4Napi11AsyncWorker18OnAsyncWorkExecuteEP10napi_env__Pv+0x5f)[0x42ac7672cf]
/root/.nvm/versions/node/v20.15.0/bin/node(_ZZN4node14ThreadPoolWork12ScheduleWorkEvENUlP9uv_work_sE_4_FUNES2_+0x59)[0xc78a49]
/root/.nvm/versions/node/v20.15.0/bin/node[0x18ab5b0]
/lib64/libpthread.so.0(+0x81ca)[0x40015741ca]
/lib64/libc.so.6(clone+0x43)[0x40017c5e73]

@addaleax
Copy link
Contributor Author

addaleax commented Jul 8, 2024

@pcicman Thanks for reaching out! I opened https://jira.mongodb.org/browse/NODE-6253 to track this in our internal JIRA bug tracker. You can follow that ticket for updates.

Most relevant for you is probably that you should be able to work around this issue by installing kerberos via

env GYP_DEFINES=kerberos_use_rtld=true npm install kerberos --build-from-source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
3 participants