From e4082fff22a9b9fb6f8efa84c39da2649c750f8b Mon Sep 17 00:00:00 2001 From: sawinglogz <3787776-sawinglogz@users.noreply.gitlab.com> Date: Sun, 5 May 2019 15:50:38 -0400 Subject: [PATCH] Add compiler flags and debug messages in search of memory access errors. --- oscar/SleepLib/loader_plugins/prs1_loader.cpp | 3 +++ oscar/oscar.pro | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/oscar/SleepLib/loader_plugins/prs1_loader.cpp b/oscar/SleepLib/loader_plugins/prs1_loader.cpp index 2c1181ee..e44f89f4 100644 --- a/oscar/SleepLib/loader_plugins/prs1_loader.cpp +++ b/oscar/SleepLib/loader_plugins/prs1_loader.cpp @@ -779,6 +779,9 @@ void PRS1Loader::ScanFiles(const QStringList & paths, int sessionid_base, Machin } SessionID chunk_sid = chunk->sessionid; + if (chunk_sid != sid && chunk_sid > 2000) { // log any really weird session IDs + qDebug() << fi.canonicalFilePath() << chunk_sid; + } if (m->SessionExists(sid)) { delete chunk; continue; diff --git a/oscar/oscar.pro b/oscar/oscar.pro index 3204bef8..a4476e5c 100644 --- a/oscar/oscar.pro +++ b/oscar/oscar.pro @@ -442,6 +442,11 @@ test { QT -= gui CONFIG += console debug CONFIG -= app_bundle + !win32 { # add memory checking on Linux and macOS test builds + QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-address-use-after-scope + QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-address-use-after-scope + QMAKE_LFLAGS += -fsanitize=address + } SOURCES += \ tests/prs1tests.cpp \