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

Client segfaults when creating/destroying readers with listener callbacks repeatedly #374

Closed
roryschadler opened this issue Apr 4, 2024 · 7 comments
Assignees
Labels

Comments

@roryschadler
Copy link
Contributor

roryschadler commented Apr 4, 2024

I found that when I created and immediately closed readers a couple times in a row, the client would fail with a segfault. I'm not familiar with the C++ lib underpinning this client, but it appears to be due to the listener callback.

Segfault stack:

PID 57514 received SIGSEGV for address: 0x10
0   segfault-handler.node               0x000000010624cef8 _ZL16segfault_handleriP9__siginfoPv + 296
1   libsystem_platform.dylib            0x0000000185537584 _sigtramp + 56
2   pulsar.node                         0x0000000119e136a8 _Z19ReaderListenerProxyN4Napi3EnvENS_8FunctionEP23ReaderListenerProxyData + 92
3   pulsar.node                         0x0000000119df41a8 _ZN4Napi18ThreadSafeFunction6CallJSEP10napi_env__P12napi_value__PvS5_ + 68
4   node                                0x000000010095edc4 _ZN6v8impl12_GLOBAL__N_118ThreadSafeFunction7AsyncCbEP10uv_async_s + 440
5   node                                0x000000010135d868 uv__async_io + 268
6   node                                0x000000010136f940 uv__io_poll + 1020
7   node                                0x000000010135de2c uv_run + 476
8   node                                0x00000001008c1754 _ZN4node21SpinEventLoopInternalEPNS_11EnvironmentE + 256
9   node                                0x00000001009ce63c _ZN4node16NodeMainInstance3RunEPNS_8ExitCodeEPNS_11EnvironmentE + 164
10  node                                0x00000001009ce3d8 _ZN4node16NodeMainInstance3RunEv + 124
11  node                                0x0000000100959494 _ZN4node5StartEiPPc + 776
12  dyld                                0x000000018517e0e0 start + 2360

(collected using https://www.npmjs.com/package/segfault-handler)

Reproduction: https://github.com/roryschadler/pulsar-client-segfault-repro

@roryschadler
Copy link
Contributor Author

roryschadler commented Apr 4, 2024

@merlimat
Copy link
Contributor

merlimat commented Apr 4, 2024

1.11 release is going out. It might be worth trying with it.

You can find the pre-built binaries here: https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-node/pulsar-client-node-1.11.0-rc.1 (or wait a couple of days until the release is officially announced)

@roryschadler
Copy link
Contributor Author

I'll do that tomorrow, thanks @merlimat!

@roryschadler
Copy link
Contributor Author

Unfortunately it still occurs with the release candidate. Updated the repro repo accordingly.

@merlimat
Copy link
Contributor

merlimat commented Apr 8, 2024

@shibd Please take a look when you have the chance

@shibd shibd self-assigned this Apr 9, 2024
@shibd shibd added the type/bug label Apr 9, 2024
@shibd shibd modified the milestone: 1.11.0 Apr 9, 2024
@shibd
Copy link
Member

shibd commented Apr 9, 2024

This fix by #376

@roryschadler Can you update to 1.11.0-rc.3 to verify it?

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

@roryschadler
Copy link
Contributor Author

Verified! This resolves the segfault I was seeing. Thank you @shibd!

@merlimat merlimat closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants