Segfault - Node.js SDK 3.2.0-beta.1

After switch from SDK 2.6 to 3.2.0-beta.1, my Node.js backend keep showing segfault. This happens a lot on my dev env (MacOS BigSur), however, with much less occurrence in the docker containers.

The dump looks as below:
PID 93559 received SIGSEGV for address: 0x4
0 segfault-handler.node 0x00000001046bdfa0 _ZL16segfault_handleriP9__siginfoPv + 304
1 libsystem_platform.dylib 0x00007fff20543d7d _sigtramp + 29
2 ??? 0x00001549a4b0a2d9 0x0 + 23406039835353
3 couchbase_impl.node 0x0000000135148583 _ZN17lcb_QUERY_HANDLE_D2Ev + 115
4 couchbase_impl.node 0x000000013514827e _ZN17lcb_QUERY_HANDLE_D0Ev + 14
5 couchbase_impl.node 0x0000000135137ba1 _ZL14timer_callbackisPv + 49
6 node 0x00000001009e88f6 uv__run_timers + 54
7 node 0x00000001009ed167 uv_run + 247
8 node 0x00000001000e6827 _ZN4node16NodeMainInstance3RunEv + 375
9 node 0x0000000100079c56 _ZN4node5StartEiPPc + 294
10 libdyld.dylib 0x00007fff20519f3d start + 1

Does anyone have a hint on how to prevent/fix this?

Hi @sunny_arthrex do you see the same error with 3.2 and Couchbase 7.0 released last week.
And is this error related to any operation that you seek ?

I upgraded my SDK to 3.2.0, my CB server is 6.6. In my dev env I could not reproduce the crash.

However, on the production env (CB server is also 6.6), which is hosted in AWS with containers, the application became stuck in crash loop, with the dump as below:


Is CB server 7.0 required for running node.js SDK 3.2.0?

Hi AV25242,

This is to update you that we have resolved this issue.

The root cause of the crash is that we are running the application on Debian 10, which the code built on Debian 10. Now we build code on Debian 9 and changed the container to Debian 9, the crash loop finally stopped.

It seems that node.js SDK has a better support on Debian 9 than Debian 10.

1 Like

Thanks @sunny_arthrex this update is super useful. I have created a ticket internally to further investigate.

Hey @sunny_arthrex ,

I managed to reproduce this and have a fix in the pipeline. It should ship in our next release. Feel free to follow the ticket for more concrete details:

Cheers, Brett

1 Like

Hi Brett,

Thank you. Looking forward to your next release.

Best, Sunny

Possibly related? SIGSEGV in 3.2.0

Indeed. Looks very similar.
One caveat we noticed is that if you have a build pipeline, since the nature of CB needs a compilation, the pipeline container OS needs to be the same as the deployment container. Otherwise we will see all kind of weird segfault.

1 Like

yes for our container we run the npm ci command inside the dockerfile during build so were not running into any lib issues there. We have other processes using node and the couchbase 3.0 and 3.1 on the same container base image and just noticed a newly deployed service has been randomly going down and coming back up, the only delta is were using the 3.2.0 image for the improved typescript support. After not being able to reproduce the crash on my mac by just running npm start I decided to try running docker compose and can get it to reproduce sporadically.