Re: Minimum VC++ for Multi-Core?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



The example program mentioned (kb/192570) runs fine in Dual Core mode. About
two years ago I stripped the example down to bare bones, then built it back
up to fit my needs.

My program "crashes" immediately and the error is this:
"This application has requested the Runtime to terminate it in an unusual
way".

It's an MFC dialog-based application. Service Pk is 6

On a development system with Dual Core enabled, the error does *not* occur
in Debug.
Occasionally it does not occur in Release mode either. Also, started from
the DeskTop it may not always occur.

When the error occurs in Release Mode the call stack window shows the
following;

KERNEL32! 7c812a5b()
MSVCRT! 77c2272c()
MFC42! 73e309c1()
MFC42! 73ddbaf0()
MFC42! 73de9562()
MFC42! 73de5f14()
MFC42! 73de0bc7()
MSVCRT! 77c3a3b0()
KERNEL32! 7c80b683()

My program starts from zero to ten client threads to pull data from our
control systems.
The program does not crash if only one connection is enabled.

A loop starts the threads by calling my DoConnect(). I wound up putting a
Beep() in that loop as a troubleshooting tool. With the beep, no more
crash. I cut the Beep() down to 10ms and no more crash. Remove the Beep()
and it crashes.

If I start the app with all connections disabled then enable them one at at
time, there is no crash.

It seems like the delay from the Beep() a helpful delay but I don't know
why.

In my app CClientThread is derived from CWinThread and has the member
m_Socket which is derived from CAsyncSocket. DoConnect() starts a new
thread each time it's called.

I have proven that the crash occurs before the loop that calls DoConnect()
completes. It happens whether any connection is made or not. So no
OnConnect or OnReceive has ever occured and the app has not tried to use the
connection.

This is the gist of the code:
void StartAllThreads()
{
for(int i=0; i < nNumConnections; ++i)
{
DoConnect(Name of PC, etc );
}

AfxMessageBox("Hi ") // (debugging) The crash occurs before this point.
}


bool CAsyncClientDlg::DoConnect(
{
// Start the client thread suspended
CClientThread* pThread =
(CClientThread*)AfxBeginThread(RUNTIME_CLASS(CClientThread),
THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
if (pThread == NULL)
{
// error message
return FALSE;
}

// Set a few variables via pThread->
//

// Let thread run
pThread->ResumeThread();
return TRUE;
}

Again, problem does not occur if I put a delay between thread starts. But I
hate to do that without knowing what is actually causing the error.

Ideas ???

Thanks,
Tom


.



Relevant Pages

  • RE: Entourage 2008 reproducibly crashes
    ... My team is investigating this crash but we couldn't reproduce it in-house. ... The kind of network connection that you have. ... Does Entourage crash if losing wired network connection? ... As soon as the connection is down, it crashes. ...
    (microsoft.public.mac.office.entourage)
  • minister pulls Jays federation
    ... He may crash the alone dispute and nod it on its chair. ... Just circulating in connection with a toe on behalf of the ... Plenty of marine orange or nation, ... Rasul confers, then Said definitely ...
    (rec.arts.books.tolkien)
  • Re: [OT] Signed and unsigned int
    ... > What do you think is overflowing here? ... What is it that even bothers ... No intenet connection was up, ... The crash reproduced with EXACTLY THE SAME SYMPTOMS ...
    (comp.lang.c)
  • Re: ActiveSynnc 4.2 & Orange SPV M600...
    ... haven't had a crash since the 4.1 beta that I can recall. ... creates a new wired network connection; could this be confusing windows? ... I've been trying to sync my SPV with Active Sync, ...
    (microsoft.public.pocketpc.activesync)
  • Re: Damn you, FEDEX! or Nikon D40 lost in Springfield, MO blackhole.
    ... the 2 mp Mavica he had been using with a Nikon D40. ... After shopping around, he got me to order one for him. ... The shipper had it insured, but from what I have read it could take weeks to sort this crap out. ... You may get your insurance from FedEx and a couple weeks later they find it and deliver it. ...
    (alt.photography)