Reminds me that OpenSSH fails with some insane error indicating memory corruption if you try to run it with tcmalloc, which can happen by accident if you call it from a Python program that uses it.
(tcmalloc is commonly used to fix memory 'leaks' (fragmentation?) in Pytorch, so this happens a lot to me. At least, I've been bitten twice.)
It's hard to imagine what might be going on to make it sensitive to the details of malloc/free... and I'm not sure that I want to.
I tried OpenSSH, libssh and libssh2. All three fail, though admittedly I don't know for sure this was the cause of failure for the two latter; they gave me no diagnostics.
They all worked fine without LD_PRELOAD though, so...
OpenSSH security features are tightly coupled to the underlying OS. I remember reading the code and seeing how sshd forks and re-execs itself in order to leverage dynamic library address randomization in each connection. I wouldn't be surprised if there are some malloc/free-related tweaks in a similar manner.
(tcmalloc is commonly used to fix memory 'leaks' (fragmentation?) in Pytorch, so this happens a lot to me. At least, I've been bitten twice.)
It's hard to imagine what might be going on to make it sensitive to the details of malloc/free... and I'm not sure that I want to.