Weird libssh deadlock / heap corruption 0 : 1 stkn
Long story short: both, apr and libssh have a function called “sha1_init” and of course, the runtime linker deceided to use the one contained in libfreeswitch.so instead of the (right) one from mod_ssh.so (libssh) resulting in a corrupted heap after calling it (even destroying some data used by the memory allocator in glibc, hence the deadlock in free).
Thing that saved the day: GCC Visibility support (hooray for marking all internal functions hidden)
And GDB command scripts are a wonderful thing (even if there are some bugs):
set pagination off
break buffer.c:buffer_free commands print *buffer continue end
With that obstacle out of the way it was fairly easy to get mod_ssh to do something a bit more useful…
The current code is in the git repository, it’s still not useable but moving in the right direction. The configure script works with GCC and SUN’s compiler, visibility support is a must though (>= GCC-4.0; SunStudio 12 / Express from July 2008 or newer).