Skip to content

Fix segmentation fault when use token auth #407

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

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

shibd
Copy link
Member

@shibd shibd commented Mar 7, 2025

Motivation

#395 Introduce a regression on node:20-alpine env. if use a token to connect to pulsar, will get a segmentation fault when client closes.

[INFO][ClientConnection:282] [10.88.0.2:51556 -> 34.28.200.175:6651] Destroyed connection to ****
[INFO][ClientConnection:282] [10.88.0.2:51544 -> 34.28.200.175:6651] Destroyed connection to ****
Bus error (core dumped)

Happend here:

if (this->tokenSupplier != nullptr) {
this->tokenSupplier->callback.Release();
}

Modifications

  • We need to explicitly set tokenSupplier to nullptr, as uninitialized pointers in C++ have undefined default values.

Verifying this change

  • Verified on my local test.

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Please explain why)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@shibd shibd self-assigned this Mar 7, 2025
@BewareMyPower BewareMyPower changed the title Fix segament falt when use token auth Fix segmentation fault when use token auth Mar 7, 2025
@shibd shibd merged commit b79ead0 into apache:master Mar 7, 2025
12 checks passed
shibd added a commit that referenced this pull request Mar 7, 2025
@klaatu01
Copy link
Contributor

klaatu01 commented Mar 7, 2025

I randomly get a segmentation fault on startup when using 1.13.0 with promise-based tokenSupplier. Is this related?

@shibd
Copy link
Member Author

shibd commented Mar 7, 2025

I randomly get a segmentation fault on startup when using 1.13.0 with promise-based tokenSupplier. Is this related?

@klaatu01 I think so. Could you help verify if the issue still exists in version v1.13.1? You can use the following cmd to install it:

npm i pulsar-client@1.13.1-rc.1 --pulsar_binary_host_mirror=https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-node/

@doug8679
Copy link

@shibd what is the testing / release process and timing for an update to this in npm? We had this issue crop up in on of our services under active development and we have had to lock our pulsar-client version at 1.12.0 until a fix is available. I tried testing the RC.1 package locally but have not been successful getting that package installed in a Docker image for a full test of the situation we ran into.

@shibd
Copy link
Member Author

shibd commented Mar 12, 2025

@doug8679 The v1.13.1 has been released, you can try it.

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

Successfully merging this pull request may close these issues.

4 participants