LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I am getting general protection fault in threads.

Solved!
Go to solution

I am using 3 thread safe queues for sending data over k-line have 1 main function  thread and 2 other threads which does the work to update GUI and receiving data from com port.

Where is the chances of general protection fault???Please reply!!!!!

0 Kudos
Message 1 of 7
(4,416 Views)

There can be several reasons for the GPF to arise while running a problem, it's difficult to give you a list (which could also include many situations that do not apply to your actual program). The most common problems are related to dynamic memory not properly inizialized / disposed of in the code but it's not the only possibility.

 

Nevertheless, error messages normally give some additional informations as of where they arise: the name of the module in error and a memory address: these element scan help you in trobleshooting your code. You may want to generate the map file for your application (go to Build >> Target settings and check Generate map file checkbox) next double check the address on error with the ones shown in the map file to find the function on error (see this discussion).

Don't forget to enable Resource tracking (see here for an example) that can help you in determining when memory is allocated and released and if there is some mempry leaking that can cause the GPF.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 7
(4,410 Views)

i am using labwindows/cvi 9.0,where to see that MAP file ,i mean where is its location in folder.its not in my project's folder.

 

 

steps in my project:

#creating 2 threads.1 for sending to /reading data from ECU and 2nd for proccessing that data and updating in GUI such as graph,list etc.

#CREATING THREAD SAFE QUEUE.

#loading file

#storing data such as length,datatype etc.

#then taking ECU addresses from file and connecting to ECU using K-line pod.

as soon as i try to connect it shows GPF.at this moment in program both threads are in running state.

0 Kudos
Message 3 of 7
(4,398 Views)
Solution
Accepted by MAPJ

The map file is generated into the CVIBUILDxxx directory in your project folder. Does the GPF error text mention a module in your program or some external library?

 

Have you tried to run in a single thread, for ECU communication only?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 7
(4,392 Views)

It shows this message:

 

unknown source position,thread id 0x000009F0,function id 1

the program has caused GPF at 001B:003964D3.

 

 

single thread works fine.

but both are not working together.its like one thread takes data from ECU and stores into List Type and other thread takes it from List type and displays on GUI.

 

 

0 Kudos
Message 5 of 7
(4,386 Views)

I got solution.

thanks for your MAP file suggestion.

from MAP file i got function where memory problem was occured.

Actually in Labwindows/cvi we can mention stack size in build option.that size was fallen short in my function.

so i increased it and its working now.

thank you very much.

0 Kudos
Message 6 of 7
(4,382 Views)

You're welcome!



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 7 of 7
(4,378 Views)