Solved

My application is having issue with Windows Vista

Posted on 2008-06-23
8
441 Views
Last Modified: 2013-11-20
I have multithreaded MFC application that uses secure socket. The application is running perfectly in XP. But abruptly crashes in Vista (though not always). It crashes when the application calls SSL_library_init. The stack trace shows this crashes at realloc/malloc deep within the SSL_library_init function. The weird thing about this issue is that I can only reproduce in release binary, never in debug or using some tool like boundschecker.
This made be think that this is a timing issue and I added two seconds delay before SSL_library_init, the issue disappeared. Suspecting the previous running instance has not released the socket, I observed the use of socket, but that doesnt looks likely.

I would like to get to the root of it and not able to get the lead. This application is not using more than 22MB, since its known that WIN32 only gets 32MB to work on Vista.
0
Comment
Question by:shuklasunil
  • 3
  • 3
8 Comments
 
LVL 49

Expert Comment

by:DanRollins
ID: 21854008
SSL_library_init must be called (and return :-) before *any* other OpenSSL functions.  Is there a chance that some worker thread or something is assuming that it has already been called?
0
 

Author Comment

by:shuklasunil
ID: 21864820
Than why doesn't it crashes when I add two seconds delay before SSL_library_init. In that case this other thread, that we think, calls OpenSSL before SSL_library_init in more likely be excuted before.

Also if I comment  SSL_library_init the code never crashes.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 21869879
I can't think of anything obvious.  
Are you using the latest version of OpneSSL?  After all, Vista is a relatively new OS... if bugs relating to it exist, they would be fixed onnly in recent versions.
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:shuklasunil
ID: 21897629
I am using OpenSSL and I am having issue even with the latest version
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 21903117
The main reason that a Release build fails while a Debug build works is that some variable or buffer is not being initialized in code (the Debug version presets them to defined values).  So check all variables that you are passinging into the OpenSSL functions.
0
 

Author Comment

by:shuklasunil
ID: 22024804
Ok I am using the workaround of sleeping for few second.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 22226488
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So who is this article for? If you are like most of the computer users out there, you probably only realize the meaning of 'System maintenance' after something goes wrong. This article is for you if you care about keeping your system working opti…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question