Bugs item #2800519, was opened at 2009-06-03 13:55 Message generated for change (Tracker Item Submitted) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2800519&group_id=125852
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: libssh2 library is not thread safe Initial Comment: By default, there is no "-D_REENTRANT" flag passed to the C preprocessor (nor any -mt (Sun Studio) or -pthreads (gcc) option to the C compiler). Note: I'm using libssh2 on Solaris 9/10, using Sun Studio 12. Referencing errno in many pieces of code makes the whole library not thread safe (libssh2_session_startup() for example). There are many EAGAIN errors that are now thrown internally (because of new non-blocking sockets in 1.1), but unfortunately, the errno value is not correctly accessed, leading to undefined behaviour. This can be "easily" reproduced using something like (compiled in a thread safe manner): Th.1: set errno Th.1: detach thread 2 Th.2: establish an SSH connection. libssh2_session_startup() will usually fail. I've passed CPPFLAGS="-D_REENTRANT" to the configure script, and things seem now to be OK. Miscellaneous defects of the "configure" script: - Specifying LDFLAGS="-mt -pthreads" does not pass these options to the ld linker. - Specifying --disable-debug still compiles with "-g". ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2800519&group_id=125852 ------------------------------------------------------------------------------ OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get _______________________________________________ libssh2-devel mailing list libssh2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libssh2-devel