setup crash

Zini

02-09-2007 12:07:47

I am getting a crash on this function call:

QuickGUI::GUIManager::getSingleton().setup (
RenderWindow->getWidth(), RenderWindow->getHeight());

(SVN version)

Here is the backtrace:

#0 6934D504 ZNSbItSt11char_traitsItESaItEEaSERKS2_() (C:\code\TinEngine\Core\Test\QuickGUI.dll:??)

#1 692F56B0 ZN8QuickGUI6Widget15getInstanceNameEv() (C:\code\TinEngine\Core\Test\QuickGUI.dll:??)

#2 692CC591 ZN8QuickGUI10GUIManager15injectMouseMoveERKiS2_() (C:\code\TinEngine\Core\Test\QuickGUI.dll:??)

#3 692CD2B2 ZN8QuickGUI10GUIManager14setActiveSheetEPNS_5SheetE() (C:\code\TinEngine\Core\Test\QuickGUI.dll:??)

#4 692CDA4F ZN8QuickGUI10GUIManager5setupERKjS2_() (C:\code\TinEngine\Core\Test\QuickGUI.dll:??)

#5 004218EF tcg::facade::facade() (??:??)

#6 00414BD2 tcf::engine::CreateRemainingEngine() (??:??)

#7 00417A65 tcf::engine::Invoke() (??:??)

#8 00403BCC main() (??:??)

kungfoomasta

02-09-2007 19:42:52

Is this using Code::Blocks also? :?

setup will call GUIManager::setActiveSheet, which calls the following lines of code:


// Update the active widget
mActiveWidget = mActiveSheet;
mWidgetContainingMouse = mActiveSheet;
injectMouseMove(0,0);


As you can see, mWidgetContainingMouse and mActiveWidget should now be the default Sheet.

From your stack, it looks like the crash is here:


// Now get the widget the cursor is over.
Widget* hitWidget;
Widget* wItr = mActiveWidget;
while( (wItr != NULL) && ((hitWidget = wItr->getTargetWidget(args.position)) == NULL) )
wItr = wItr->getParentWidget();

// NOTE: Widget is only detected if it is enabled.
args.widget = hitWidget;

CRASH ----------> if( (mWidgetContainingMouse->getInstanceName() != hitWidget->getInstanceName()) )
{
mWidgetContainingMouse->onMouseLeaves(args);
mWidgetContainingMouse = hitWidget;
mWidgetContainingMouse->onMouseEnters(args);
}
else // widget containing mouse has not changed.
mWidgetContainingMouse->onMouseMoved(args);


This would suggest hitWidget or mWidgetContainingMouse is NULL. Can you step through and see what is happening?

Zini

03-09-2007 15:15:41

Yes, I am using Code::Blocks.

Sorry, for the delay. The imported VC project files for QuickGUI are messing up things on a regular basis.

My tests have shown, that hitWidget is indeed 0.

Zini

04-09-2007 17:19:10

With rev 124 the problem disappeared. Did you apply any fixes, that I overlooked? If not, may I ask that the problem is investigated further? A bug, that randomly appears and disappears, is a sign of forthcoming doom.

kungfoomasta

04-09-2007 17:25:41

I committed last night, maybe 10 hours ago, the log should show the time I checked it in. I made 2 or 3 revisions last night, one being the singleton imlpementation. I do not have bugs that randomly come and go, its a matter of unveiling a bug, or hiding it. :P The static link issue from the other thread is not valid because my GUIManager and MosueCursor constructors take no arguments. But either way we have come to a solution for that. :)

Zini

04-09-2007 17:40:37

Defensive coding is the art of not creating hiding places for bugs. 8)

Danno

08-09-2007 00:57:56

I've had this issue in Code::blocks as well. I've been assuming that i've been missing resources until i narrowed it down with log statements. My debug is liking to crash on init of the app, so log statements it had to be :).

Sound like something got fixed in the SVN, but is there any word on what might have been the fix so I can tailor my release?

kungfoomasta

08-09-2007 01:05:26

Yesterday I uploaded Mikachu's Code Block Workspace and .cbp files, you'll find them in SVN. It was made during the 0.9.6b release. The current SVN has a lot more improvements and has a lot of changes in general, with the exception that I have broke List Widgets, which means if you update, ComboBox and MenuList won't work correctly. Aside for those, which won't be resolved until I complete the ScrollBar Widget and functionality, I recommend you giving it a shot if you're familiarizing with QuickGUI. If you really really needed Lists back I can fix it to work, but it will be a step sideways, since I planned to change the design of the List widget anyway.

Danno

11-09-2007 20:34:33

Hey kungfoo,

Sorry I haven't responded sooner; been a very busy few days. I don't need anything in particular. Right now, I am just trying to get something working so I can learn the basics of the system, and possibly develop a working beta of my project's gui. So don't worry about pressing anything on my account.

I'll check out the SVN and give it a whirl.

_Dan