sdl_core icon indicating copy to clipboard operation
sdl_core copied to clipboard

Core dump on ignition off when registering 20 apps

Open ShobhitAd opened this issue 3 years ago • 0 comments

Fixes #3857

Original PR: https://github.com/smartdevicelink/sdl_core/pull/3928

This PR is ready for review.

Risk

This PR makes no API changes.

Testing Plan

Submitted ATF test for issue

Summary

Fixes the following problems:

  • Аn object of this class AppExtension was not given externally without protection. Therefore, I will change the return type from Extensions () to DataAccessor . Where the desired mutex is captured.
  • ApplicationManagerImpl had unprotected deletion of objects used in other threads. Also, I found a duplicate of the is_stopping method. I deleted this one and left the IsStopping method.
  • ResumeCtrlImpl captured the mutex queue_lock_, which belongs to it, and the mutex from ApplicationManagerImpl, when calling the application(..) method. This created a deadlock, and not a secure use of the application object. So I added getting all the apps and working with this list.
  • It consists of two different crash of the program. The first crash when remove mobile_request_list_. The second is when deleting mobile requests from waiting_for_response_. This was due to the use of smart pointers in different threads. They are copied into threads, so we have to delete them in the thread in which we finish working with it. Since these requests are processed in a separate thread, I delete them there if the core stops working during the processing of these requests. Also added a check to see if the core stopped working while adding such requests to the list.
  • This is a drop while processing data in one thread and deleting it in another thread. I created a separate mutex to protect this data. Because using the existing one, we do not invest in the time allotted to the timer to perform certain work.

CLA

ShobhitAd avatar Aug 10 '22 01:08 ShobhitAd