LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

"General Protection" fault occur after main() return

The followings dialog appear at the end of run of my CVI programme:

1. When Debugging:

FATAL RUN-TIME ERROR

Unknown source position, thread id 0x00000340
The program has caused a 'General Protection' fault at 001B:6850442B

2. When Not Debugging:

The instruction at "0x6850442b" referenced memory at "0x00000034". The memory could not be "read".
Click on OK to terminate the program

My programme use malloc() and free().
Could you suggest a solution for that?
0 Kudos
Message 1 of 2
(2,756 Views)
Hi,

The General Protection Fault (GPF) errors can be hard to track down; usually they appear when a function access a piece of memory that does no longer belongs to the application.

My advice is to run your application step by sted to find out what function is the one causing the GPF; then watch the content of all the parameters that go into the function to make sure that you have memory reserved for all of them.

I hopes this helps to fix the problem or to get more information about it. Let me know if you have further questions on this.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 2
(2,756 Views)