matrix-org / matrix-bifrost

General purpose bridging with a variety of backends including libpurple and xmpp.js
Apache License 2.0
163 stars 31 forks source link

Segmentation fault with Libpurple right after beginning sync #330

Open emassey0135 opened 1 year ago

emassey0135 commented 1 year ago

Hello,

I am trying to install Matrix Bifrost on a Raspberry Pi running Arch Linux ARM, with Synapse 1.74.0 and Synapse and Postgresql running on the same server as the bridge. I ran "yarn install" then "yarn build", customized the configuration file, and generated the registration file and added it to the Synapse configuration file. Line 3 of start.sh sets LD_PRELOAD to ./node_modules/node-purple/deps/libpurple/libpurple.so, but this file does not exist, so I commented out this line and uncommented line 4, which sets it to /usr/lib/libpurple.so.0, which on my system was Libpurple 2.14.12. When I ran this script, it failed with a segmentation fault right after printing "[RoomSync] Beginning sync". When I run Node.js in GDB starting the program with LD_PRELOAD and running the bridge directly without NPM, it says the segmentation fault is in the remove_timeout function in module.node from node-purple. I tried this with both Node 18 and Node 16 with the same result; the dependencies fail to install with Node 19. I also managed to compile Libpurple 2.13.0 using an old PKGBUILD, but the program still fails with a segmentation fault in the same function. I also tried it on my X86_64 laptop running Arch Linux with the same result. The bridge successfully starts the Purple instance and enumerates supported protocols.