Solved

WaitForSingleObject Errors only in Release mode..

Posted on 2002-07-01
11
377 Views
Last Modified: 2008-03-06
I have a Winsock application using Overlapped I/O.  I have looked and I have all the same libs and includes for release that I have for debug, but when starting up our application in release mode, it crashes on:
WaitForSingleObject(RxEvent, INFINITE);

There are no compile errors or warnings.   Debug works great, but in release, it fails..   Anyone have this issue before?

Actual Error:
The instruction at "0x0a646574" referenced memory at "0x0a646574".  The memory could not be "read".
0
Comment
Question by:Chizl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +3
11 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 7123314
>>Debug works great, but in release, it fails

This usually points to uninitialized varibles (esp. pointers) - can you post some code?
0
 
LVL 22

Expert Comment

by:ambience
ID: 7123601
is this line inside some class member function ? invalid pointers somewhere ? post the code .
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7123736
You are doing an asynchronous reading.
I don't know, may be becoz of some problems in handling the IO Completion callback handling.

Please Quote some code.

Becoz of non-blocking operation (overlapped IO), you have to use some callback for IO completion..

Roshmon
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 49

Expert Comment

by:DanRollins
ID: 7123743
It is unlikely that that particular line is causing that particular error:  It does not reference memory directly.  The RxEvent value may be wrong, but it is a handle.  Be sure to initialize it to zero then ASSERT if it is 0 before calling WaitForSingleObject.  Then the problem will surely be visible in debug build.

Are you certain that the problem is with that line of code?  I ask becasue in Release mode, one normally does not get information as to the line of code that causes the problem.

One tip:
You can make a Release Build that contains symbols.  Then you can place breakpoints and excute it.  When you get a GPF, the call stack may have some meaningful information.

-- Dan
0
 
LVL 32

Accepted Solution

by:
jhance earned 400 total points
ID: 7124469
RxEvent refers to an invalid handle, perhaps it's NULL.  Did you forget to initialize it?  What is its value before calling WaitForSingleObject?  A good place for an ASSERT would be here.
0
 
LVL 4

Author Comment

by:Chizl
ID: 7125397
Hummm   Can't change it to 50..   How do I close it out?
0
 
LVL 4

Author Comment

by:Chizl
ID: 7125399
Thanx all,

I don't know what the problem was, but it worked about 3 months ago and not much of anything had changed since then, so I just rolled back my versioning for that cpp and it works now..   I can't post the code, because every function relies on the other function, so I would end up posting the whole CPP, which is very large.    It has call backs and link lists for the multi messages from one socket, and link lists for the multi sockets, etc..   as you can tell this is a very complex application and a lot here, so posting a snippet would only hinder the problem..

I have it working now, but appreciate everyone's effort..  Wish I could give you all some points just for the effort..

I changed the points to 50 and accept the first comment, just to close this out.

Again thanx all..
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7125515
You must post to Community Support in order to get a Moderator to make changes to this question such as you desire.  Please give the points to jhance, becasue he needs them the most.

It is unusual for a user to request to lower the point value of a question.  More commonly, you would just request a refund.  Say that you solved it yourself and that you don't want to thank the experts who helped you, so please refund the points.  Be sure to post the QID of this question.

-- Dan
0
 
LVL 32

Expert Comment

by:jhance
ID: 7125598
>>Please give the points to jhance, becasue he needs them the most.

What kind of a comment is this?
0
 
LVL 4

Author Comment

by:Chizl
ID: 7125814
Haha..  Dan..  I have been on this website before it was a website..  I understand the points, and noone here actually helped me, but I don't care who gets the points.  I know people get piss off if they think they deserved the points more than the person that gets the points.  I was just trying to be fair and the only way to do that was not to give them to anyone since I fixed it on my own.

If everyone says give them to jhance, then I will, not a problem..  I don't ask enough questions to use all my points ever anyway..
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7125898
>>What kind of a comment is this?
A bit of levity, to brighten an otherwise dull day.  No harm done, I hope?
-- Dan
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

740 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