pc-ble-driver-js 2.8.2 + pc-ble-driver 4.1.4 + node 14.19.1 - SIGSEGV on linux, but success on windows

Hi,
We have a central app running pc-ble-driver-js 2.7.2 with dongles burnt with 4.1.2 firmware, on node 12.x.x, which has been running successfully on windows + ubuntu + debian + rhel for a while now, with the upcoming production aimed for linux distros only.
We are now trying to upgrade to node 14, pc-ble-driver-js 2.8.2, and with dongles burnt with 4.1.4 firmware, but are running into segmentation faults in linux only.

The PCs are all x64, running node 14.19.1 x64, and were installed and rebuilt via "yarn install" from scratch.
On the Windows PC, all is well - the app continues to run after opening the adapter, and succeeds in connecting to our nrf peripherals with no issues so far.

On both linux PCs (1 rhel and 1 ubuntu focal fossa), the driver fails with a segmentation fault (SIGSEGV).
By adding segfault-handler to our code (https://httptoolkit.tech/blog/how-to-debug-node-segfaults/), I was able to narrow down the problem on our ubuntu PC:

PID 40997 received SIGSEGV for address: 0x0
error: [libs/bleAdapter] BLE Received SERIALIZATION_RESPONSE but command did not provide a buffer for the reply.
/central/code/node_modules/segfault-handler/build/Release/segfault-handler.node(+0x3785)[0x7f9c06abe785]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x143c0)[0x7f9c067573c0]
/central/code/node_modules/pc-ble-driver-js/build/Release/pc-ble-driver-js-sd_api_v5.node(_Z13encode_decodeP9adapter_tRKSt8functionIFjPhPjEERKS1_IFjS2_jS3_EE+0x454)[0x7f9bfd286554]
/central/code/node_modules/pc-ble-driver-js/build/Release/pc-ble-driver-js-sd_api_v5.node(sd_ble_cfg_set+0xaa)[0x7f9bfd25089a]
/central/code/node_modules/pc-ble-driver-js/build/Release/pc-ble-driver-js-sd_api_v5.node(_ZN7Adapter9enableBLEEP9adapter_tP19enable_ble_params_t+0x2c)[0x7f9bfd1ee5ac]
/central/code/node_modules/pc-ble-driver-js/build/Release/pc-ble-driver-js-sd_api_v5.node(_ZN7Adapter4OpenEP9uv_work_s+0x23f)[0x7f9bfd1ee93f]
/usr/local/bin/node[0x13bbc14]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8609)[0x7f9c0674b609]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43)[0x7f9c06670163]
Segmentation fault (core dumped)
error Command failed with exit code 139.
After googling the underscored and bolded line, I was able to find it in the pc-ble-driver cpp code: lines 229 and 230 in master (https://github.com/NordicSemiconductor/pc-ble-driver/blob/master/src/common/transport/serialization_transport.cpp).
What is the solution to this?
Thanks,
Roi
Parents Reply Children
No Data
Related