LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

cvi 7.0 crashes in debug mode

Hi everyone,

Are you all able to run and debug a simple command prompt program? Attempt to debug the following simple code in CVI:

#include <ansi_c.h>

int main(){
 printf("Hello World");
 getchar();
 return 0;
}

It seems as if user created threads are not being handled correctly - such as attempting to access killed threads.

Nestor
0 Kudos
Message 11 of 16
(1,404 Views)
Hi, I can debug the program you sent Nestor, but I still can't run my program in debug mode. I'm using user created threads. Is there some condition to consider for threads that I must check if it is being done correctly? I tried changing the Debugging level to in the Debugging Options from Build Options Window, and it did not work. Is there anything else that I can change or verify? Thanks.
0 Kudos
Message 12 of 16
(1,396 Views)
Hello

I can't remember how I solved my problem... maybe I should have replied myself Smiley Sad

Are your thread handles ok?

Have you tried to recompile your program?

Good luck!
Carlos Arcediano del Amo
0 Kudos
Message 13 of 16
(1,389 Views)
And I remember an other problem, I don't know if it causes the same result.

I managed to compile a program with functions that were supposed to return a value but they didn't (or viceversa, they returned something when the weren't supposed to) and the program crashed when they were invoked.

I hope my post is helpful.
Carlos Arcediano del Amo
0 Kudos
Message 14 of 16
(1,383 Views)
Hi carcediano, The Threads are fine, they have been working for a while (more than 5 years in production. I alse tried recompiling the program and it has the same condition. I suppose you solve the problem of the functions assuring they return the value they must, right? I'm going to check if there is any function in that condition. Thanks.
0 Kudos
Message 15 of 16
(1,381 Views)
Threads are always difficult to debug, especially when they are not handled correctly. The result is unexpected data, behavior or worse, a General Protection Fault. I encountered a similar error when I had two treads managing the same UIR panel; the designed was to have one thread update the panel, and the second thread close the panel. However, due to the indeterministic nature of threads, sometimes the second thread killed the panel and hence cause the first thread to generate a GPF. It took time to find this was the cause of this issue - especially when it's not one's code.
 
Essentially roslocke, threads are indeterministic and hence you must protect your data. I strongly suggest reading MultithreadingOverview.pdf.
You will find the file in: C:\Program Files\National Instruments\CVI71\bin
 
 
Nestor
0 Kudos
Message 16 of 16
(1,377 Views)