diff options
author | VProdanov <VProdanov@luxoft.com> | 2016-06-13 19:15:14 +0300 |
---|---|---|
committer | VProdanov <VProdanov@luxoft.com> | 2016-06-14 19:55:31 +0300 |
commit | 59baba3732d3a9464b754ee5a2c8778158d638f8 (patch) | |
tree | 8663e2d711d8de6edcc42b8e919e434c37825466 | |
parent | 1c7dc251ed3ac41c74ed817a99616c45d6e7ca9c (diff) | |
download | sdl_core-59baba3732d3a9464b754ee5a2c8778158d638f8.tar.gz |
Fix_core_dump_when_app_is_in_LIMITED_and_ignition_off_is_sent
The reason for the coredump was a string destructor call after the
string was already destructed. After checking the address in memory
where we were dummped the involved strings were discovered. The
apperant reason for the double destruction in doubled linking of
the same string in static and dynamic library.
Related-Issue: APPLINK-22355
5 files changed, 9 insertions, 20 deletions
diff --git a/src/components/application_manager/src/resumption/resumption_data_db.cc b/src/components/application_manager/src/resumption/resumption_data_db.cc index 7e025917c4..7e546a012c 100644 --- a/src/components/application_manager/src/resumption/resumption_data_db.cc +++ b/src/components/application_manager/src/resumption/resumption_data_db.cc @@ -48,13 +48,13 @@ #include "utils/file_system.h" #include "application_manager/application_manager_settings.h" -namespace { -const std::string kDatabaseName = "resumption"; -} - namespace resumption { CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption") +namespace { +const char* kDatabaseName = "resumption"; +} // namespace + ResumptionDataDB::ResumptionDataDB( DbStorage db_storage, const application_manager::ApplicationManager& application_manager) diff --git a/src/components/policy/include/policy/sql_pt_representation.h b/src/components/policy/include/policy/sql_pt_representation.h index d8b168e9c9..2710a7d4a5 100644 --- a/src/components/policy/include/policy/sql_pt_representation.h +++ b/src/components/policy/include/policy/sql_pt_representation.h @@ -193,7 +193,6 @@ class SQLPTRepresentation : public virtual PTRepresentation { virtual bool UpdateDBVersion() const OVERRIDE; private: - static const std::string kDatabaseName; utils::dbms::SQLDatabase* db_; #ifdef BUILD_TESTS diff --git a/src/components/policy/src/sql_pt_representation.cc b/src/components/policy/src/sql_pt_representation.cc index 4e47b209e6..046b858131 100644 --- a/src/components/policy/src/sql_pt_representation.cc +++ b/src/components/policy/src/sql_pt_representation.cc @@ -66,10 +66,9 @@ void InsertUnique(K value, T* array) { array->push_back(value); } } +const char* kDatabaseName = "policy"; } // namespace -const std::string SQLPTRepresentation::kDatabaseName = "policy"; - SQLPTRepresentation::SQLPTRepresentation(const std::string& app_storage_folder, uint16_t attempts_to_open_policy_db, uint16_t open_attempt_timeout_ms) diff --git a/src/components/utils/include/utils/sqlite_wrapper/sql_database.h b/src/components/utils/include/utils/sqlite_wrapper/sql_database.h index 437cfd4920..5fd3de5fa1 100644 --- a/src/components/utils/include/utils/sqlite_wrapper/sql_database.h +++ b/src/components/utils/include/utils/sqlite_wrapper/sql_database.h @@ -149,17 +149,6 @@ class SQLDatabase { int error_; /** - * The temporary in-memory database - * @see SQLite manual - */ - static const std::string kInMemory; - - /** - * The extension of filename of database - */ - static const std::string kExtension; - - /** * Execs query for internal using in this class * @param query sql query without return results * @return true if query was executed successfully diff --git a/src/components/utils/src/sqlite_wrapper/sql_database.cc b/src/components/utils/src/sqlite_wrapper/sql_database.cc index 7b7e1f3d5a..4763ddc776 100644 --- a/src/components/utils/src/sqlite_wrapper/sql_database.cc +++ b/src/components/utils/src/sqlite_wrapper/sql_database.cc @@ -36,8 +36,10 @@ namespace utils { namespace dbms { -const std::string SQLDatabase::kInMemory = ":memory:"; -const std::string SQLDatabase::kExtension = ".sqlite"; +namespace { +const char* kInMemory = ":memory:"; +const char* kExtension = ".sqlite"; +} // namespace SQLDatabase::SQLDatabase() : conn_(NULL), database_path_(kInMemory), error_(SQLITE_OK) {} |