omniorb log messages called from thread desctructor
Michael Teske via omniORB-list <[email protected]> Tue, 8 Dec 2020 16:28:02 +0100
| Newsgroups | gmane.comp.corba.omniorb.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, this is on omniORB 4.2.4 on windows. While trying to debug a CORBA problem, we raised the ORBtraceLevel to 40. This works fine, but we wanted to have the messages in our own log file, so we used omniORB::setLogFunction(). This works fine, until the log function gets called from a thread destructor with messages like "omniORB: (20) 2020-12-08 14:09:17.049000: AsyncInvoker: thread id 20 has exited. Total threads = 10.\n" form ~omniAsyncWorker(). In this case, the underlying omnithread seems to be half-destroyed already. In our log function we try to get some thread-specific storage to identify the thread but unfortunately the _values member is already deleted and set to NULL in omni_thread::exit() and not in the destructor. Unfortunately, omni_thread::get_value does not check for _value but for _value_alloc, which is not reset in omni_thread::exit(), and thus get_value crashes. Is there any reason, why the _values member is not deleted in the omnithread destructor but in omni_thread::exit()? If yes, then I think _value_alloc should be set to 0 as well. As I write this I think I have a solution without rebuilding, fortunately I can check for state() == STATE_TERMINATED and not use get_value then. But for future reference I send the message anyway, and maybe it's worth fixing... Greetings, Michael