dear all,
I’m working with root v5.23/02.
I have an application with two threads which more or less look like this:
void *
monitorFunction(void *ptr)
{
AliRawReaderRoot reader("/home/preghenella/ALICE.2008/data/67577/raw/09000067577018.10.root");
while(1) {
reader.RewindEvents();
Int_t eventCounter = 0;
while (reader.NextEvent()) printf("event %d\n", eventCounter++);
}
}
Int_t
main(int argc, char *argv[])
{
TApplication application("spyke", &argc, argv);
AliTOFMonitor monitor;
monitor.CreateFullMonitorScheme();
new spykeGUI(&monitor, NULL);
TThread *monitorThread = new TThread("monitorThread", monitorFunction);
monitorThread->Run();
application.Run();
return 0;
}
the call spykeGUI(…) creates a user interface with buttons and canvases. the interactive behaviour of the GUI is obtained using signal/slot mechanism. pressing a button causes a set of calls to be executed and eventually a histogram is drawn on a canvas.
in summary the main thread contains the user interface, while the other thread (monitorThread) does some operations reading from a file.
what happens is that if I push one of the GUI buttons in a certain moment both threads hang.
this is the stack trace of the two threads when they are hanging:
#0 0x005db7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x013313de in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0
#2 0x0132e00b in _L_mutex_lock_35 () from /lib/tls/libpthread.so.0
#3 0x00000000 in ?? ()
#0 0x005db7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x013313de in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0
#2 0x0132e00b in _L_mutex_lock_35 () from /lib/tls/libpthread.so.0
#3 0x00000001 in ?? ()
#4 0x0738057c in ?? () from /home/alisoft/root/trunk/lib/libThread.so.5.23
#5 0xb7f2aba0 in ?? ()
#6 0x107d0ca0 in ?? ()
#7 0xb7f29fc8 in ?? ()
#8 0x07359303 in TPosixMutex::Lock ()
from /home/alisoft/root/trunk/lib/libThread.so.5.23
#9 0x07359303 in TPosixMutex::Lock ()
from /home/alisoft/root/trunk/lib/libThread.so.5.23
#10 0x0735465b in TMutex::Lock ()
from /home/alisoft/root/trunk/lib/libThread.so.5.23
#11 0x007d1973 in TCint::RecursiveRemove ()
from /home/alisoft/root/trunk/lib/libCore.so.5.23
#12 0x0078987e in THashList::RecursiveRemove ()
from /home/alisoft/root/trunk/lib/libCore.so.5.23
#13 0x007286e7 in TObject::~TObject$base ()
from /home/alisoft/root/trunk/lib/libCore.so.5.23
#14 0x039436d3 in ~AliRawData (this=0xb6fa88d8)
at /home/alisoft/aliroot/pro/RAW/AliRawData.h:24
#15 0x0391b14a in ~AliRawEquipment (this=0xb6f7fe90)
at RAW/AliRawEquipment.cxx:106
#16 0x00787718 in TCollection::GarbageCollect ()
from /home/alisoft/root/trunk/lib/libCore.so.5.23
#17 0x0078ef73 in TObjArray::Delete ()
from /home/alisoft/root/trunk/lib/libCore.so.5.23
#18 0x0391b9c1 in ~AliRawEvent (this=0xb6f7f9c0) at RAW/AliRawEvent.cxx:190
#19 0x00787718 in TCollection::GarbageCollect ()
from /home/alisoft/root/trunk/lib/libCore.so.5.23
#20 0x0078ef73 in TObjArray::Delete ()
from /home/alisoft/root/trunk/lib/libCore.so.5.23
#21 0x0391b9f4 in ~AliRawEvent (this=0xb718c480) at RAW/AliRawEvent.cxx:193
#22 0x01609e2c in AliRawReaderRoot::NextEvent (this=0xb7f2a2c0)
at RAW/AliRawReaderRoot.cxx:528
#23 0x080495de in monitorFunction (ptr=0x0) at spyke.cxx:23
#24 0x07356fc5 in TThread::Function ()
from /home/alisoft/root/trunk/lib/libThread.so.5.23
#25 0x0132c3cc in start_thread () from /lib/tls/libpthread.so.0
#26 0x04774b3e in clone () from /lib/tls/libc.so.6
both are in the same portion of code… and it seems that both threads are trying to lock a mutex.
does anybody have an idea of what’s going on and how can I deal with it (i.e. avoid hangs)?
thank you very much,
roberto