?
Solved

WaitForSingleObject Errors only in Release mode..

Posted on 2002-07-01
11
Medium Priority
?
390 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
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 1600 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

750 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