Termination of application developed in QNX4.25 using Photon

APPLICATION for Process Industry: 60 T Eccentric Bottom taping ELECTRIC ARC FURNACE

Process Computer Configuration:

(1)Hardware Configuration: PIII, 750 MHZ .128 MB RAM.
(2)Software Configuration: Operating system - QNX 4.25
GUI – Photon Runtime and Application Builder
Compiler- Watcom C
Application was developed for
(a)Monitoring the process parameter such as temperature, pressure, flow rate.
(b)Control of set point for feeding raw material inside the furnace.
(c)Generation of events on receiving interrupts.
(d)Trend logging of various process parameter

Problem Occurred: Our developed application is running as per logic. During running of project,application terminates with error- memory fault after gap period of Days or some times with a gap period of Hours.

Our Observation: The cause of problem may be one

of the following.

(1)There was a generation multiple text boxes for recording of time in text box using a code on receiving Process interrupts. After editing of records, application terminates with error memory fault after gap Period of Days or some times with a gap period of Hours.

Memory was allocated to the struct SHDATA using malloc
and it is free using free(malloc).

After making such correction , termination of application has been reduced up to some extent but still problem is there.

Pl. share us your views on the above problem and following queries

(2)In our application the code associated with base window is in setup.c.

The shared memory is open with coding
fd = shm_open("Shared_Mem,O_RDWR | O_CBEAT,0777);

         The memory is mapped using

sh = (unsigned int ) mmap (0,sizeof(struct SHDATA),PROT_READ

This code is executed at the start of application only. The shared memory is used by struct SHDATA in other part of application ,which is activated on the occurrence of events.This memory is not deallocated
at any point of programmed.Is it required to deallocate this memory with
pgshmemCleanup() or pgshmemDeattach() function ?.

(2) Are shared variable utilized cummulative memory, whenever the code is executed ?

(3) Do you found any bug in real time appllication using photon?

Can any body share his views on above problem . The code is attached herewith.

Is this application in development, or in production? Random SEGV’s on a system which is been successfully running for months/years usually implies hardware which is starting to fail.

Are you running dumper, or can you run the program under the debugger so you can see where the fault occurred.

Are you running out of memory? ‘sin in’ will show the amount of memory on startup and after running a little while, the free memory should stabalize.

Your system is large enough that it is hard to debug even with the source code. Using the debugger, or dumper to see where it crashes is probably the first important step.