ChimeraTK / ControlSystemAdapter

An adapter layer which allows to use control applications with different control system software environments.
GNU Lesser General Public License v3.0
3 stars 2 forks source link

Exception due to version number #13

Closed zenker closed 4 years ago

zenker commented 5 years ago

On a Raspberry my Application keeps crashing due to uncaught exception. The exception is thrown in UnidirectionalProcessArray<T>::writeInternal. I don't know at which point the wrong version number is assigned. It is triggered in different cases calling the write() method in ApplicationCore. Here the PeriodicTrigger caused the exception, which is bad because I would have to change the PeriodicTrigger module by introducing a try/catch block.

terminate called after throwing an instance of 'ChimeraTK::logic_error'
  what():  The version number passed to write is less than or equal to the last version number used.
terminate called recursively
ChimeraTK error catched: The version number passed to write is less than or equal to the last version number used.

Thread 26 "OneWireServer" received signal SIGABRT, Aborted.
[Switching to Thread 0x613ff3d0 (LWP 5867)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x73b6a824 in __GI_abort () at abort.c:89
#2  0x73d1e060 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#3  0x73d1bdb0 in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#4  0x73d1be24 in std::terminate() () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#5  0x73d1c158 in __cxa_throw () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#6  0x76939e7c in ChimeraTK::UnidirectionalProcessArray<unsigned long long>::writeInternal (this=0x178490, newVersionNumber=..., shouldCopy=true)
    at /home/start/data/sw/installed/include/ChimeraTK/ControlSystemAdapter/UnidirectionalProcessArray.h:597
#7  0x768b71d0 in ChimeraTK::UnidirectionalProcessArray<unsigned long long>::doWriteTransfer (this=0x178490, versionNumber=...)
    at /home/start/data/sw/installed/include/ChimeraTK/ControlSystemAdapter/UnidirectionalProcessArray.h:537
#8  0x76908864 in ChimeraTK::FeedingFanOut<unsigned long long>::doWriteTransfer (this=0x17e92c, versionNumber=...) at /home/start/data/sw/chimeraTK/ApplicationCore/include/FeedingFanOut.h:106
#9  0x000bab44 in ChimeraTK::TransferElement::write (this=0x17e944, versionNumber=...) at /home/start/data/sw/installed/include/ChimeraTK/TransferElement.h:195
#10 0x000badd8 in ChimeraTK::TransferElementAbstractor::write (this=0x11c0cc <theServer+3316>, versionNumber=...) at /home/start/data/sw/installed/include/ChimeraTK/TransferElementAbstractor.h:124
#11 0x000bf068 in ChimeraTK::ScalarAccessor<unsigned long long>::write (this=0x11c0cc <theServer+3316>, versionNumber=...) at /home/start/data/sw/installed/include/ChimeraTK/ApplicationCore/ScalarAccessor.h:52
#12 0x000bcec4 in ChimeraTK::PeriodicTrigger::mainLoop (this=0x11bfc0 <theServer+3048>) at /home/start/data/sw/installed/include/ChimeraTK/ApplicationCore/PeriodicTrigger.h:50
#13 0x76a2927c in ChimeraTK::ApplicationModule::mainLoopWrapper (this=0x11bfc0 <theServer+3048>) at /home/start/data/sw/chimeraTK/ApplicationCore/src/ApplicationModule.cc:63
#14 0x76a2e5bc in boost::_mfi::mf0<void, ChimeraTK::ApplicationModule>::operator() (this=0x9b3ebf4, p=0x11bfc0 <theServer+3048>) at /usr/include/boost/bind/mem_fn_template.hpp:49
#15 0x76a2e3e0 in boost::_bi::list1<boost::_bi::value<ChimeraTK::ApplicationModule*> >::operator()<boost::_mfi::mf0<void, ChimeraTK::ApplicationModule>, boost::_bi::list0> (this=0x9b3ebfc, f=..., a=...)
    at /usr/include/boost/bind/bind.hpp:259
#16 0x76a2e2c4 in boost::_bi::bind_t<void, boost::_mfi::mf0<void, ChimeraTK::ApplicationModule>, boost::_bi::list1<boost::_bi::value<ChimeraTK::ApplicationModule*> > >::operator() (this=0x9b3ebf4)
    at /usr/include/boost/bind/bind.hpp:1294
#17 0x76a2e208 in boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf0<void, ChimeraTK::ApplicationModule>, boost::_bi::list1<boost::_bi::value<ChimeraTK::ApplicationModule*> > > >::run (
    this=0x9b3ead8) at /usr/include/boost/thread/detail/thread.hpp:116
#18 0x75b9edc8 in ?? () from /usr/lib/arm-linux-gnueabihf/libboost_thread.so.1.62.0
#19 0x743e6fc4 in start_thread (arg=0x613ff3d0) at pthread_create.c:335
#20 0x73c0ebc8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6

There is one line saying that the error was catched. This output results from catching that error inside my application by guarding the write call:

try{
      writeAll();
} catch (ChimeraTK::logic_error &e){
      std::cerr << "ChimeraTK error catched: " << e.what() << std::endl;
}

But as I said before in the PeriodicTrigger that error is not catched.

mhier commented 4 years ago

Should be fixed with the latest version of the framework.