Solved

My application is having issue with Windows Vista

Posted on 2008-06-23
8
432 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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Windows 7 VM unable to boot up after shutdown 12 146
fizzArray  challenge 1 47
NotAlone Challenge 20 70
mapAB Challlenge 35 85
The Service applet starts in Extended Mode by Default, with a taskpad on the left of the services pane. This view mode was introduced in XP. As I find it not very usefull, I like to use the Standard view as default, and without the Console tree. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now