Poco::Net::initializeSSL() crashes

Please post support and help requests here.
heinob
Posts: 8
Joined: 24 Apr 2013, 14:24

Poco::Net::initializeSSL() crashes

Postby heinob » 03 Jun 2013, 19:00

Hi,

I have a customer PC (Windows 7 / 32 Bit) on which

Code: Select all

 Poco::Net::initializeSSL() 

crashes. Due to the fact that it is no developer machine my possibilities to debug are small. Through logging I have narrowed the problem down to this single function call. Which runs perfectly on a couple of other machines (XP, Vista, Windows 7/32+64) . Yet I could not find out what makes this machine different. The poco libs are linked statically so it cannot be a DLL problem.

Before I install a development system on that machine (which is quite a mess), is there anybody who has an idea what could be causing the crash?

Thanks for your help!

heinob

alex
Posts: 1297
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Poco::Net::initializeSSL() crashes

Postby alex » 04 Jun 2013, 04:20


heinob
Posts: 8
Joined: 24 Apr 2013, 14:24

Re: Poco::Net::initializeSSL() crashes

Postby heinob » 04 Jun 2013, 08:52

Thanks for your hint. Unfortunately it does not help because:

a) It fixes a problem in uninitializeSSL(). I have the problem in initializeSSL().
b) It affects only Non-Windows, but my customer's machine is Win7...

Or did I get sth wrong?

I will try to dig deeper into the code to see what is the reason for the crash. If you have any other idea in the meantime, I would be very glad...

P.S. The crash does not happen randomly. It crashes EVERYTIME initializeSSL() is called on that machine.

guenter
Posts: 1194
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Poco::Net::initializeSSL() crashes

Postby guenter » 04 Jun 2013, 11:26

Are you sure the OpenSSL libs are also linked statically? If not, there may be another (incompatible) version of the OpenSSL DLLs installed on the machine which cause the troubles.

heinob
Posts: 8
Joined: 24 Apr 2013, 14:24

Re: Poco::Net::initializeSSL() crashes

Postby heinob » 04 Jun 2013, 12:20

I have found a solution!

The function call within initialzeSSL() which lead to the crash was OPENSSL_config(NULL); This is has yet been executed in dependency of the OPENSSL-version. I just tried to comment out the call, and ... it works!!! The code also works on all other machines, which have worked also before, so it seems that this function call is not really necessary, or is it?

I am working with OPENSSL V1.0.1e.

Code: Select all

void OpenSSLInitializer::initialize()
{
   Poco::FastMutex::ScopedLock lock(_mutex);
   if (++_rc == 1)
   {
#if OPENSSL_VERSION_NUMBER >= 0x0907000L
      // OPENSSL_config(NULL);      <-- This line had to be removed
#endif

guenter
Posts: 1194
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Poco::Net::initializeSSL() crashes

Postby guenter » 04 Jun 2013, 14:16

According to the function documentation, new code using OpenSSL should call this function.
Are you sure your application is not picking up older OpenSSL DLLs on the customer machine?

heinob
Posts: 8
Joined: 24 Apr 2013, 14:24

Re: Poco::Net::initializeSSL() crashes

Postby heinob » 04 Jun 2013, 14:36

As sure as one can be...

a) The customer pc has a brand (brand!) new win7 (Home Premium) installation. There shouldn't be any OPENSSL dlls at all on that machine.
b) I am building and linking the poco.libs statically (release_static_mt), so there should not be any dll loading.
c) I do not distribute any OPENSSL dlls. I do not even have one. I am using these two libs: libeay32.lib / ssleay32.lib
d) All my other pc work like charm with and (!) without that function call.

Hhhhmmm. And now?

alex
Posts: 1297
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Poco::Net::initializeSSL() crashes

Postby alex » 04 Jun 2013, 19:53

heinob wrote:Hhhhmmm. And now?

Try linking with libeay32MT.lib / ssleay32MT.lib (found in lib/VC/static subdir of the OpenSSL instal directory)


Return to “Support”

Who is online

Users browsing this forum: er6 and 2 guests

cron