From: Fred T. Hamster Date: Tue, 17 Feb 2026 11:55:06 +0000 (-0500) Subject: testing with callstack tracker disabled X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=679393246b27f98df9a6a4af3f1c886ec4796ee8;p=feisty_meow.git testing with callstack tracker disabled turning off the tracker got rid of one class of problems, but now we're seeing that a pure virtual method is being invoked. something is calling into our code after its been destroyed, or we're using dead objects. --- diff --git a/nucleus/library/processes/ethread.cpp b/nucleus/library/processes/ethread.cpp index d88b94bb..a21102f6 100644 --- a/nucleus/library/processes/ethread.cpp +++ b/nucleus/library/processes/ethread.cpp @@ -162,11 +162,9 @@ bool ethread::start(void *thread_data) if (aret) LOG("failed to set detach state."); int ret = -1; if (_periodic) - ret = pthread_create(_handle, &attribs, periodic_thread_driver, - (void *)this); + ret = pthread_create(_handle, &attribs, periodic_thread_driver, (void *)this); else - ret = pthread_create(_handle, &attribs, one_shot_thread_driver, - (void *)this); + ret = pthread_create(_handle, &attribs, one_shot_thread_driver, (void *)this); if (!ret) success = true; else error = ret; /* diff --git a/octopi/library/tests_octopus/test_bin_threaded.cpp b/octopi/library/tests_octopus/test_bin_threaded.cpp index c0e8c2a2..2b13b634 100644 --- a/octopi/library/tests_octopus/test_bin_threaded.cpp +++ b/octopi/library/tests_octopus/test_bin_threaded.cpp @@ -52,6 +52,9 @@ using namespace textual; using namespace timely; using namespace unit_test; +// uncomment if you want the more careful shutdown of the threads. +//#define FANCY_UNNECESSARY_THREAD_STOP ugh + // synchronization for logged messages to avoid overwriting on the console. SAFE_STATIC(mutex, __loggers_lock, ) @@ -269,12 +272,12 @@ class obsessive_compulsive : public ethread public: obsessive_compulsive() : ethread(MIN_TIDIER_THREAD_PAUSE, ethread::TIGHT_INTERVAL) { FUNCDEF("constructor"); - LOG("<< new cleaner <<"); + LOG(">> new cleaner >>"); } virtual ~obsessive_compulsive() { FUNCDEF("destructor"); - LOG(">> cleaner exits >>"); + LOG("<< cleaner exits <<"); } DEFINE_CLASS_NAME("obsessive_compulsive"); @@ -405,10 +408,12 @@ int test_entity_data_bin_threaded::execute() __threads_can_run_wild_and_free() = false; -#ifdef FANCY_UNNECESSARY_THREAD_STOP - //hmmm: this code shouldn't be needed! thread cabinet should do it!!!! +//deciding whether the cancel really should be done every time, to let the threads bail on their own rather than single stepping through their shutdowns. LOG("now cancelling all threads..."); for (int j = 0; j < thread_list.elements(); j++) { thread_list[j]->cancel(); } + +#ifdef FANCY_UNNECESSARY_THREAD_STOP + //hmmm: this code shouldn't be needed! thread cabinet should do it!!!! LOG("now stopping all threads..."); for (int k = 0; k < thread_list.elements(); k++) { thread_list[k]->stop(); } #endif diff --git a/production/feisty_meow_config.ini b/production/feisty_meow_config.ini index 21853785..1e63a567 100644 --- a/production/feisty_meow_config.ini +++ b/production/feisty_meow_config.ini @@ -84,6 +84,6 @@ endif # methods with a way to know how they were invoked. to get this information. # the invoker must be fitted with FUNCDEF macros. ifeq "$(BOOT_STRAPPING)" "" - DEFINITIONS += ENABLE_CALLSTACK_TRACKING +# DEFINITIONS += ENABLE_CALLSTACK_TRACKING endif