Subject: Re: libssh crash on Mac

Re: libssh crash on Mac

From: Peter Stuge <>
Date: Tue, 13 Aug 2019 12:06:34 +0000

Jan Ehrhardt wrote:
> Libssh2 does not need any engine, so it is safe to remove both
> ENGINE_load_builtin_engines() and ENGINE_register_all_complete() by
> applying this patch in src/openssl.h:
> In libssh2 1.9.0+ you could also recompile with a defined

True as that may be, it merely papers over the actual programming error.

OpenSSL wouldn't crash unless it is being called in a wrong way, through

In particular, libssh2_init(3) notes that the function is not thread
safe. Leos test case in a minimal SFTP application working well
suggests that a complexity in the full application causes the crash.

Multiple threads are a fairly likely candidate, but no matter what the
cause is, ensuring that libssh2_init() is only called a single time on
startup could solve the problem properly.

Received on 2019-08-13