From 3b8965c0b6abf18d544c2b8e8316458beb27d93d Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 16 Aug 2018 21:40:10 +0200 Subject: [PATCH] Heisenbug hunt.... Segfault related to regular expression (#1158) not yet able to reproduce these seemingly random segfaults --- research/try.cpp | 95 ++++++++++--------------------------- tests/gui/bus-term-test.cpp | 2 +- 2 files changed, 26 insertions(+), 71 deletions(-) diff --git a/research/try.cpp b/research/try.cpp index 5948b8bec..9d2805acf 100644 --- a/research/try.cpp +++ b/research/try.cpp @@ -38,20 +38,26 @@ // 12/17 - investigate SFINAE failure. Reason was indirect use while in template instantiation // 03/18 - Dependency Injection / Singleton initialisation / double checked locking // 04/18 - investigate construction of static template members +// 08/18 - Segfault when compiling some regular expressions for EventLog search /** @file try.cpp - * Investigation: static initialisation order -- especially of static template member fields. - * This version embeds the factory as Meyer's Singleton into the Front-Template using it, and - * it invokes the factory from within the Front constructor -- thereby ensuring the factory - * is indeed initialised prior to any usage and its lifespan extends beyond the lifespan of the - * last instance using it. + * Heisenbug hunt: random crashes in BusTerm_test, seemingly emerging from regular expression compilation. + * Not able to reproduce the crash, unfortunately. //////////////////////////////////////////////////////////TICKET #1158 */ typedef unsigned int uint; #include "lib/format-cout.hpp" #include "lib/test/test-helper.hpp" +#include "lib/util.hpp" + +#include +#include +#include + +using std::string; +using VecS = std::vector; @@ -62,77 +68,26 @@ typedef unsigned int uint; -template -class Factory - { - public: - T val; - - Factory() - : val{} - { - cout << "Factory-ctor val="< -class Front - { - public: - Factory& - fac() - { - static Factory fac; - return fac; - } - - - Front() - { - cout << "Front-ctor val="<..."< fint; - - int& i = fint.operate(); - cout << "main: val="<