summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykola Korniichuk (GitHub) <42380041+mkorniichuk@users.noreply.github.com>2020-05-08 18:20:46 +0300
committerGitHub <noreply@github.com>2020-05-08 11:20:46 -0400
commit4f82834f130599247f35144aa130fea208eb9c9e (patch)
tree21f4638f45944f479ef4938a634c57490ae4f095
parent5dc4233b8c31bbff0c9f89758d0ba7dab123e8c7 (diff)
downloadsdl_core-4f82834f130599247f35144aa130fea208eb9c9e.tar.gz
SDL crash during cleanup. (#2621)
* SDL crash during StopComponents() if StartComponents() failed. If resumption_storage_ in ResumeCtrlImpl is failed to initialize, SDL will try to stop components and exit with error code. At this time application manager tries to unregister all applications and call ResumeCtrlImpl::OnIgnitionOff() where resumption_storage_ is used. As a result, a crash will occur. As an example, if AppStorageFolder have no read/write access, resumption_storage_ fails to initialize. Co-authored-by: Jacob Keeler <jacob.keeler@livioradio.com>
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
index 486cb76369..4930f47d21 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -468,6 +468,7 @@ void ResumeCtrlImpl::OnSuspend() {
void ResumeCtrlImpl::OnIgnitionOff() {
LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(resumption_storage_);
if (!application_manager_.IsLowVoltage()) {
resumption_storage_->IncrementIgnOffCount();
resumption_storage_->ResetGlobalIgnOnCount();
@@ -726,6 +727,7 @@ void ResumeCtrlImpl::SaveDataOnTimer() {
void ResumeCtrlImpl::FinalPersistData() {
LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(resumption_storage_);
StopSavePersistentDataTimer();
SaveAllApplications();
resumption_storage_->Persist();