Why my program crashed 
Author Message
 Why my program crashed

Hi,

I am writing a program in Visual C++ that has a thread
running in the background.  This thread has an infinite
loop.  Within each loop, it captures a real-time frame
from the video input card and saves it as a DIB format
picture.  After it finishes saving, it opens the DIB
picture and coverts the picture into JPEG using Intel JPEG
library, and then it saves the picture with different file
name.  The problem I am getting is that the program stops
responding after hours of execution. The number of hours
ranges from 5 to 13.  Since I have paid close attention to
managing the usage of memory and it was observed that the
program used a stable amount of memory, I don't think the
problem is illegal usage of memory.

Does anyone have any idea what might be the potential
problem?

Thanks a lot.

Jia An



Mon, 05 Jan 2004 09:17:37 GMT  
 Why my program crashed
I assume the program doesn't crash - it just locks up?
Presumably you have a deadlock in your multi-threaded
program. Very common.

Make sure you are using synchronization primitives where
necessary. Watch for race conditions, and deadlocks caused
by two threads acquiring resources in different orders.

Also, beware that simple things like calling SetWindowText()
from your background thread can cause problems.
SetWindowText() sends a message to your UI thread and
then waits for the message to be processed. If your UI
thread is waiting on your worker thread - deadlock.

You could try attaching the de{*filter*} when you lock up.

Quote:

> Hi,

> I am writing a program in Visual C++ that has a thread
> running in the background.  This thread has an infinite
> loop.  Within each loop, it captures a real-time frame
> from the video input card and saves it as a DIB format
> picture.  After it finishes saving, it opens the DIB
> picture and coverts the picture into JPEG using Intel JPEG
> library, and then it saves the picture with different file
> name.  The problem I am getting is that the program stops
> responding after hours of execution. The number of hours
> ranges from 5 to 13.  Since I have paid close attention to
> managing the usage of memory and it was observed that the
> program used a stable amount of memory, I don't think the
> problem is illegal usage of memory.

> Does anyone have any idea what might be the potential
> problem?

> Thanks a lot.

> Jia An

--
.Bruce Dawson, Humongous Entertainment (we're hiring).
http://www.*-*-*.com/
Send job applications by e-mail, post technical questions
to the newsgroups please. Thanks.


Mon, 05 Jan 2004 10:53:03 GMT  
 Why my program crashed
Besides memory,  you could also leak handles.  If you are running W2K, you
can monitor the
handle count, GDI and User object in the task manager.  You can select them
via the View | Select column option.

James



Wed, 07 Jan 2004 03:59:13 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Why this program crashes at the end of runtime?

2. why does this little program crash ?

3. why does_execlp crash my program

4. Why is Visual C++ launching on Program crashes?

5. Program Crashes - Why?

6. Why does this program crash?

7. Why is this structure access crashing?

8. Compiles but crashes on linking .Why?

9. why does it crash?

10. Why is this crashing?

11. Why does code crash when freeing malloc?

12. WHY is this crashing???!!!

 

 
Powered by phpBB® Forum Software