"*** Break *** illegal instruction" in thread

Dear rooters,

I’m writing a GUI program for online event display. The main job of this program is to display PMT hits at near real time. Most of the time it will run in auto scan mode, i.e. receive data and display it at the rate about one event per second. To avoid the GUI gets stuck with the auto scan ( when function AutoScan() is busy), I’m trying to put auto scan into a dedicated thread.

Now my problem is, if I don’t put AutoScan() into a thread, everything is fine. But if I put it into a thread, then for some events I got *** Break *** illegal instruction" or “*** Break *** segmentation violation” message (more information listed below). Although the program does not crash when this happens, it’s quite annoying. Does anyone know why this happen?

I’m sorry that I can’t attach the codes because it’s a little bit complex and the data file is too large. Any hint will be greatly appreciated.

Haibing ZHANG

===================
*** Break *** illegal instruction
(no debugging symbols found)
Using host libthread_db library “/lib64/tls/libthread_db.so.1”.
Attaching to program: /proc/26759/exe, process 26759
[Thread debugging using libthread_db enabled]
[New Thread 182948731424 (LWP 26759)]
[New Thread 1084229984 (LWP 26766)]
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.

0x00000031c858f9fa in waitpid () from /lib64/tls/libc.so.6
Thread 2 (Thread 1084229984 (LWP 26766)):
#0 0x0000002a958ca77a in TList::FindLink ()
from /usr/local/root/lib/libCore.so
#1 0x0000002a958cb43a in TList::Remove () from /usr/local/root/lib/libCore.so
#2 0x0000002a958c6ad4 in TCollection::RecursiveRemove ()
from /usr/local/root/lib/libCore.so
#3 0x0000002a976355d6 in TPad::RecursiveRemove ()
from /usr/local/root/lib/libGpad.so
#4 0x0000002a958c6b2b in TCollection::RecursiveRemove ()
from /usr/local/root/lib/libCore.so
#5 0x0000002a958c8d22 in THashList::RecursiveRemove ()
from /usr/local/root/lib/libCore.so
#6 0x0000002a958743ea in TObject::~TObject$base ()
from /usr/local/root/lib/libCore.so
#7 0x0000002a970be59a in TMarker::~TMarker$base ()
from /usr/local/root/lib/libGraf.so
#8 0x000000000043e18b in SKPmt::~SKPmt$delete ()
#9 0x0000002a958c70fd in TCollection::GarbageCollect ()
from /usr/local/root/lib/libCore.so
#10 0x0000002a958cad74 in TList::Clear () from /usr/local/root/lib/libCore.so
#11 0x0000002a9762fdc3 in TPad::Clear () from /usr/local/root/lib/libGpad.so
#12 0x0000002a97614156 in TCanvas::Clear () from /usr/local/root/lib/libGpad.so
#13 0x000000000042d19f in SKMainFrame::DisplayAll ()
#14 0x000000000042ed59 in SKMainFrame::DataAcquire ()
#15 0x000000000042f27c in SKMainFrame::ThreadData ()
#16 0x0000002a955a1992 in TThread::Function ()
from /usr/local/root/lib/libThread.so
#17 0x00000031c9206137 in start_thread () from /lib64/tls/libpthread.so.0
#18 0x00000031c85c7533 in clone () from /lib64/tls/libc.so.6

Thread 1 (Thread 182948731424 (LWP 26759)):
#0 0x00000031c858f9fa in waitpid () from /lib64/tls/libc.so.6
#1 0x00000031c8539bbf in do_system () from /lib64/tls/libc.so.6
#2 0x00000031c8539e36 in system () from /lib64/tls/libc.so.6
#3 0x0000002a959063ac in TUnixSystem::StackTrace ()
from /usr/local/root/lib/libCore.so
#4 0x0000002a95903188 in TUnixSystem::DispatchSignals ()
from /usr/local/root/lib/libCore.so
#5
#6 0x000000000147ee91 in ?? ()
#7 0x000000000147ed10 in ?? ()
#8 0x0000002a97633d7a in TPad::Pick () from /usr/local/root/lib/libGpad.so
#9 0x0000002a97615a97 in TCanvas::Pick () from /usr/local/root/lib/libGpad.so
#10 0x0000002a976152dc in TCanvas::HandleInput ()
from /usr/local/root/lib/libGpad.so
#11 0x0000002a9849a523 in TRootEmbeddedCanvas::HandleContainerMotion ()
from /usr/local/root/lib/libGui.so
#12 0x0000002a9849b254 in TRootEmbeddedContainer::HandleMotion ()
from /usr/local/root/lib/libGui.so
#13 0x0000002a983eb2c1 in TGFrame::HandleEvent ()
from /usr/local/root/lib/libGui.so
#14 0x0000002a983ba9c4 in TGClient::HandleEvent ()
from /usr/local/root/lib/libGui.so
#15 0x0000002a983baaf7 in TGClient::ProcessOneEvent ()
from /usr/local/root/lib/libGui.so
#16 0x0000002a983babad in TGClient::HandleInput ()
from /usr/local/root/lib/libGui.so
#17 0x0000002a983babcd in TGInputHandler::Notify ()
from /usr/local/root/lib/libGui.so
#18 0x0000002a95903769 in TUnixSystem::DispatchOneEvent ()
from /usr/local/root/lib/libCore.so
#19 0x0000002a958a1565 in TSystem::InnerLoop ()
from /usr/local/root/lib/libCore.so
#20 0x0000002a958a14fd in TSystem::Run () from /usr/local/root/lib/libCore.so
#21 0x0000002a9584f23f in TApplication::Run ()
from /usr/local/root/lib/libCore.so
#22 0x000000000041654e in main ()

Hi,

This looks like an issue with thread (safety), you may be accessing in a 2nd thread, objects (GUI) that are deleted in the 1st thread.

Cheers,
Philippe