[ROOT] Bug in TCanvas / TGWin32 + "0xbaadf00d"

From: Axel Naumann (axel@fnal.gov)
Date: Tue Jun 05 2001 - 22:32:18 MEST


Hi,

in my usual environment (Win2k, MSVC6, linking root against my own main()) I
(and other colleagues) occasionally get an access violation in libGpad.
Thanks to the debug distribution I could track that problem down to the
following bug:

When opening a new TCanvas aparently a windows message "MouseMove" can be
issued without "fSelected" being properly initialized (TCanvas::fSelected is
"0xbaadf00d"), which results in a access violation in TObject::TestBit().

Here's the stack of that call (lines corresponding to debug vers 3.01/03):

TObject::TestBit(unsigned int 33554432) line 169 + 10 bytes
TCanvas::HandleInput(EEventType kMouseMotion, int 551, int 250) line 948 +
31 bytes
TGWin32WindowsObject::OnMouseButton(TGWin32WindowsObject * const 0x014cbd30,
HWND__ * 0x001e08de, unsigned int 512, unsigned int 0, long 16384551) line
673
TGWin32WindowsObject::OnMouseButtonCB(TGWin32Object * 0x014cbd30, HWND__ *
0x001e08de, unsigned int 512, unsigned int 0, long 16384551) line 165 + 31
bytes
TWin32CallBackList::operator()(HWND__ * 0x001e08de, unsigned int 512,
unsigned int 0, long 16384551) line 137 + 29 bytes
TGWin32Object::CallCallback(HWND__ * 0x001e08de, unsigned int 512, unsigned
int 0, long 16384551) line 432
WndROOT(HWND__ * 0x001e08de, unsigned int 512, unsigned int 0, long
16384551) line 94 + 24 bytes

Could somebody please fix that? It's very annoying... I can't really believe
this access violation is caused by windows, as it even occurs when I don't
move the mouse at all (from when I start my program until it crashes). So my
guess would be that some class is sending this event "by accident", e.g.
because its event list is not properly initialized... Or maybe just
initializing fSelected with NULL is good enough. I'm willing to help
tracking this problem down - as I said, it's reproduced by colleagues of
mine (actually by everybody I know who is using root on win), and it means
you can't plot anything. O, and it's an old problem, happens since Root
version 2.something.

By the way: Does anybody know where members are initialized to "0xbaadf00d"?
I can't find it anywhere in the root source...

Thanks,
Axel.



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:48 MET