Currently, I am testing my GUI Application and got the following irreproducible error:
When closing a dialogbox I got a “bus error” but could continue working
with my program w/o any problems. I could even open/close the dlogbox again w/o the error.
The crash reporter on my Mac gives the following crashlog:
As with my other problem, this problem is completely irreproducible, in this case
I have experienced it only once.
I know that the crash reporter of the Mac displays in the first line the last executed
function, i.e. the function where the crash occurs. Usually this is one of my functions,
but this time it was a ROOT function (called from other ROOT functions) so I
thought I let you know.
Problems difficult to reproduce could be the sign of some uninitialized variable in your code. On Linux, valgrind is an unvaluable tool to spot these
cases.
Use the debugger (gdb) to report a traceback. The default traceback
obtained with bare root is not always precise.
Now I could catch the error when closing my dialogbox by pressing the Cancel button.
gdb gives the following error message:
Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand.
0xbfffeb28 in ?? ()
(gdb) bt
#0 0xbfffeb28 in ?? ()
#1 0x03018578 in G__G__Gui1_274_6_0 ()
#2 0x02ef0f00 in TGFrame::HandleEvent ()
Previous frame inner to this frame (corrupt stack?)
When pressing “Cancel” the following methods are executed before the crash appears:
------XOptionDialog::DoClickCancel------
------XOptionDialog::DoCloseWindow------
—XOptionDialog::~XOptionDialog------
This is a short excerpt of the corresponding code:
Sorrowly I have to attach the code since "code" does delete most of my code!!
My program seems to crash in the destructor when calling “delete fMain”.
Does “fMain->SendCloseMessage()” already delete fMain?
Maybe, the reason for the irreproducible bus errors could be that I am using the
statement "fMain->SendCloseMessage();"
in my code, which has worked fine in earlier versions of root!
Looking at the tutorial “guitest.C” shows that apparently this statement should no
longer be used but replaced by “TTimer::SingleShot()”:
1, It would be great if changes in code which force people to change their code
would be clearly reported somewhere, maybe in the "root.cern.ch/root/News.html"
section (which currently displays: Object not found!)
Simply changing the code in the tutorials is in my opinion not sufficient.
2, Having to use TTimer::SingleShot() causes a visible delay when closing the
dialogbox which is a strange experience for users since no other gui program
shows a similar delay when closing a dialogbox.