C
cerr
Hi There,
I had to add a certain portion of code to an application which had
been considered to run stable (bewfore my addition). Now the QA guy
came back to me saying that he's seeing a SIGKILL after a while
(several hours) since my code addition. The code I added simply writes
a string (PIDMessageBuf - declared private) and a at runtime generated
timestamp into a text file a la:
I cannot see how this code would lead to a SIGKILL, anyone?
Oh by the way, this is running in a threaded while(1) loop that comes
around once a second.
Any hints or suggestions are greatly appreciated!
Thank you!
I had to add a certain portion of code to an application which had
been considered to run stable (bewfore my addition). Now the QA guy
came back to me saying that he's seeing a SIGKILL after a while
(several hours) since my code addition. The code I added simply writes
a string (PIDMessageBuf - declared private) and a at runtime generated
timestamp into a text file a la:
Code:
if(gpsDataObj->getGPSLatitude() < 49.1937 && gpsDataObj-[QUOTE]
getGPSLatitude() > 49.1292){[/QUOTE]
struct tm *ptr;
time_t sec;
time(&sec);
char tmpFileName[500];
ptr = localtime(&sec);
sprintf(tmpFileName, "/var/log/PIDdata%d%d%d",
(ptr->tm_year + 1900),
(ptr->tm_mon + 1),
ptr->tm_mday);
ofstream PIDfile (tmpFileName,ios::app);
if (PIDfile.is_open()){
PIDfile << PIDMessageBuf << ", " << ptr->tm_year + 1900 << "/" <<
ptr->tm_mon + 1 << "/" << ptr->tm_mday << ", " << ptr->tm_hour << ":"
<< ptr->tm_min << ":" << ptr->tm_sec << endl;
PIDfile.close();
}
else{
cout<< "Couldn't open " << tmpFileName << endl;
}
}
Oh by the way, this is running in a threaded while(1) loop that comes
around once a second.
Any hints or suggestions are greatly appreciated!
Thank you!