Segfault when accessing the Monitor
Follow up of pytango#324 (comment 2016331802)
The context is the call to ApiUtil.cleanup() suggested to workaround the CORBA file descriptors "leak".
When running our Bliss tests, that stress the creation and destruction of device servers, I get a
Program terminated with signal SIGSEGV, Segmentation fault.
#0 __GI___pthread_mutex_lock (mutex=0x0) at ../nptl/pthread_mutex_lock.c:67
67 ../nptl/pthread_mutex_lock.c: No such file or directory.
[Current thread is 1 (Thread 0x7f00e5943700 (LWP 20459))]
(gdb) bt
#0 __GI___pthread_mutex_lock (mutex=0x0) at ../nptl/pthread_mutex_lock.c:67
#1 0x00007efffc620872 in Tango::TangoMonitor::get_monitor() ()
from /nobackup/lid00lima21/debionne/miniconda3/envs/bliss/lib/python3.9/site-packages/tango/../../../libtango.so.95
#2 0x00007efffc63a095 in Tango::EventConsumerKeepAliveThread::run_undetached(void*) ()
from /nobackup/lid00lima21/debionne/miniconda3/envs/bliss/lib/python3.9/site-packages/tango/../../../libtango.so.95
#3 0x00007efffc16701d in omni_thread_wrapper ()
from /nobackup/lid00lima21/debionne/miniconda3/envs/bliss/lib/python3.9/site-packages/tango/../../../libomnithread.so.4
#4 0x00007f010ec81609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#5 0x00007f010ea4c353 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
It's pretty reproductible (but probably difficult to extract a repro).