Hi dfrey
In application, onr is main thread and another thread I am using for data send and receive process.
I am running timer and some interval time I am sending some data to server using that 2nd thread . To separate this socket method, I have used this thread.
I have removed all unwanted loops or thread which was initially started.
and
Initiated handlers in main thread for services like GPS service , SMS service, Data connect service, le_mrc for network registration and le_sim for sim registration checking .
signal 11 error is now resolved.
Now Application get stopped when “posDaemon” service get killed with error “signal 9” at api call “le_gnss_GetLocation()”.
Error logs as below:
Mar 30 17:37:33 | tr300_290318[18222]/framework T=main | le_gnss_client.c le_gnss_GetPositionState() 1837 | Sending message to server and waiting for response : 4 bytes sent Mar 30 17:37:33 | tr300_290318[18222]/TR300_290318Component T=main | GpsLocation.cpp posHandlerFunc() 52 | position state 2 Mar 30 17:37:33 | tr300_290318[18222]/framework T=main | le_gnss_client.c le_gnss_GetLocation() 1921 | Sending message to server and waiting for response : 4 bytes sent Mar 30 17:37:34 | tr300_290318[18222]/framework T=main | le_gnss_client.c le_gnss_GetLocation() 1924 | Valid response was not received from server Mar 30 17:37:34 | supervisor[468]/supervisor T=main | proc.c proc_SigChildHandler() 1956 | Process 'posDaemon' (PID: 8408) has exited due to signal 9 (Killed). Mar 30 17:37:35 | supervisor[468]/supervisor T=main | app.c app_SigChildHandler() 3227 | Process 'posDaemon' in app 'positioningService' faulted: Restarting process. Mar 30 17:37:35 | supervisor[468]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxCoreDumpFileBytes to value 102400. Mar 30 17:37:35 | supervisor[468]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxFileBytes to value 102400. Mar 30 17:37:35 | supervisor[468]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxLockedMemoryBytes to value 8192. Mar 30 17:37:35 | supervisor[468]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxFileDescriptors to value 256. Mar 30 17:37:35 | supervisor[468]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxMQueueBytes to value 512. Mar 30 17:37:35 | supervisor[468]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxThreads to value 20. Mar 30 17:37:35 | supervisor[468]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxQueuedSignals to value 100. Mar 30 17:37:35 | supervisor[468]/supervisor T=main | proc.c proc_Start() 1190 | Starting process 'posDaemon' with pid 17590 Mar 30 17:37:35 | supervisor[17590]/supervisor T=main | proc.c proc_Start() 1155 | Execing 'posDaemon' Mar 30 17:37:35 | _appStopClient[17575]/framework T=main | LE_FILENAME CreateSocket() 550 | Socket opened as standard i/o file descriptor 2! Mar 30 17:37:35 | posDaemon[17590]/swiQmi T=main | swiQmi.c InitService() 367 | Init QMI service QMI_SERVICE_DMS (2) Mar 30 17:37:35 | posDaemon[17590]/swiQmi T=main | swiQmi.c PrintServiceDetails() 343 | Service.2: library_version.6 idl_version.1 service_id.0x2 idl_minor_version.35 Mar 30 17:37:35 | posDaemon[17590]/swiQmi T=main | swiQmi.c StartService() 107 | qmi_client_get_service_list rc=0, numServices=1 Mar 30 17:37:35 | dcsDaemon[517]/dataConnectionService T=main | dcsServer.c CloseSessionEventHandler() 2113 | Client 0x28a3c killed, remove allocated resources Mar 30 17:37:35 | gpioService[519]/sysfsGpio T=main | gpioSysfsUtils.c gpioSysfs_SessionCloseHandlerFunc() 1107 | Releasing GPIO 22 Mar 30 17:37:35 | supervisor[468]/supervisor T=main | proc.c proc_SigChildHandler() 1942 | Process 'tr300_290318' (PID: 18222) has exited with exit code 1. Mar 30 17:37:35 | supervisor[468]/supervisor T=main | proc.c GetFaultAction() 1744 | No fault action specified for process 'tr300_290318'. Assuming 'ignore'. Mar 30 17:37:35 | modemDaemon[520]/modemDaemon T=main | le_antenna.c le_antenna_RemoveStatusEventHandler() 376 | Invalid reference ((nil)) provided! Mar 30 17:37:35 | gpioService[519]/sysfsGpio T=main | gpioSysfsUtils.c gpioSysfs_SessionCloseHandlerFunc() 1107 | Releasing GPIO 23 Mar 30 17:37:35 | gpioService[519]/sysfsGpio T=main | gpioSysfsUtils.c gpioSysfs_SessionCloseHandlerFunc() 1107 | Releasing GPIO 24 Mar 30 17:37:35 | dcsDaemon[517]/dataConnectionService T=main | dcsServer.c SetDefaultGateway() 1010 | Default gateway or interface is empty Mar 30 17:37:35 | supervisor[468]/supervisor T=main | app.c app_SigChildHandler() 3221 | Process 'tr300_290318' in app 'TR300_290318' faulted: Ignored. Mar 30 17:37:35 | _appStopClient[17598]/framework T=main | LE_FILENAME CreateSocket() 550 | Socket opened as standard i/o file descriptor 2! Mar 30 17:37:35 | supervisor[468]/supervisor T=main | apps.c DeactivateAppContainer() 340 | Application 'TR300_290318' has stopped.
`
My code snippet :
void GpsLocation::posHandlerFunc(le_gnss_SampleRef_t positionSampleRef,
void* contextPtr) {
le_result_t res;
le_gnss_FixState_t state;
res = le_gnss_GetPositionState(positionSampleRef, &state);
if (res == LE_OK) {
LE_INFO("\n position state %d", state);
if (state != LE_GNSS_STATE_FIX_NO_POS) {
GpsFixed = 1;
} else {
GpsFixed = 0;
}
} else {
LE_INFO("FAILED pos state");
}
if(GpsFixed == 1)
{
int32_t lat = 0;
int32_t longi = 0;
int32_t acc = 0;
memset(latitude, '\0', sizeof(latitude));
memset(longitude, '\0', sizeof(longitude));
res = le_gnss_GetLocation(positionSampleRef, &lat, &longi, &acc);
if (res == LE_OK) {
LE_INFO("\n location: latitude = %d, longitude = %d, accuracy = %d",
lat, longi, acc);
char latArray[10];
char longiArray[11];
sprintf(latArray, "%0.6f", (float) lat / 1000000);
sprintf(longiArray, "%0.6f", (float) longi / 1000000);
LE_INFO("lattitude latArray %s ", latArray);
LE_INFO("longitude longiArray %s ", longiArray);
mOdometerCurrentValue = fOdometerCalculation(latArray, longiArray,
PrevLatitude, PrevLongitude);
mOdometerTotalVal += mOdometerCurrentValue;
fsaveOdometerValueToFile();
LE_INFO("\n now convert lat long in protocol standard");
mOdometerCurrentValue = 0;
LatLongConversion((const unsigned char*) latArray,
(const unsigned char*) longiArray, (unsigned char*) latitude,
(unsigned char*) longitude);
LE_INFO("\nLat Long converted in defined format ");
PrevLatitude[0] = latArray[0];
PrevLatitude[1] = latArray[1];
PrevLatitude[2] = latArray[2];
PrevLongitude[0] = longiArray[0];
PrevLongitude[1] = longiArray[1];
PrevLongitude[2] = longiArray[2];
} else if (res == LE_FAULT) {
LE_INFO("failed get location");
} else if (res == LE_OUT_OF_RANGE) {
LE_INFO("out of range. set to int 32_max");
}
le_result_t result;
// Date parameters
uint16_t year;
uint16_t month;
uint16_t day;
// Time parameters
uint16_t hours;
uint16_t minutes;
uint16_t seconds;
uint16_t milliseconds;
int32_t altitude;
int32_t vAccuracy;
// Get UTC date
result = le_gnss_GetDate(positionSampleRef, &year, &month, &day);
if (result == LE_OK) {
mYear = year;
mMonth = month;
mDay = day;
}
// Get UTC time
result = le_gnss_GetTime(positionSampleRef, &hours, &minutes, &seconds,
&milliseconds);
// Display time/date format 13:45:30 2009-06-15
LE_INFO("\n %02d:%02d:%02d:%02d %d-%02d-%02d,", hours, minutes, seconds,
milliseconds, year, month, day);
if (result == LE_OK) {
mHour = hours;
mMinutes = minutes;
mSeconds = seconds;
mMiliSeconds = milliseconds;
}
// Get altitude
result = le_gnss_GetAltitude(positionSampleRef, &altitude, &vAccuracy);
if (result == LE_OK) {
LE_INFO("\n Altitude:%d, vAccuracy:%d", altitude / 1000,
vAccuracy / 10);
mAltitude = altitude / 1000;
} else {
LE_INFO("\n Altitude unknown [%d,%d]", altitude, vAccuracy);
}
unsigned int speed = 0;
result = le_gnss_GetHorizontalSpeed(positionSampleRef, &speed, &mSpeedAcc);
if (result == LE_OK) {
LE_INFO("\n speed %d ", speed);
mSpeed = speed;
} else {
LE_INFO("\n Speed unknown [%d,%d]", speed, mSpeedAcc);
}
uint32_t directn = 0;
uint32_t direcAcc = 0;
result = le_gnss_GetDirection(positionSampleRef, &directn, &direcAcc);
if (result == LE_OK) {
LE_INFO("\n Direction %u ", directn);
mDirection = directn;
} else {
LE_INFO("\n Direction unknown ");
}
}
}
`
Can you look in to my code and give me reason of failing posdaemon service