Game Development Community

Crash - stock out of the box torque F11

by James · in Torque Game Engine · 10/29/2006 (5:24 am) · 27 replies

Purchase Torque 1.5 upgrade and have the following problem:

After launching a mission, if I access the editor (F11) and click on the items in the column, Torque crashes.
Sometimes I can click on several items no problem but eventually Torque will crash. Wierd.

My system is:
Model: PowerMac3,6, BootROM 4.4.8f2
CPU: 2 processors, PowerPC G4 (2.1), 1 GHz,
RAM:1.75 GB
Graphics: ATI Radeon 9000 Pro, ATY,RV250, AGP, 64 MB

I saved the crash report if that will help.

*won't let me post part of report.
** added torque build number
Page«First 1 2 Next»
#21
11/18/2006 (2:36 am)
Okay, today 1.5 seems to be a little more forgiving. I can click on the various elements a few times before Torque dies. Of the 5 threads, on thread 1 is experiences a crash although I've had thread 0 do so too but rarely:
Date/Time:      2006-11-18 05:29:56.347 -0500
OS Version:     10.4.8 (Build 8L127)
Report Version: 4

Command: Torque Demo OSX
Path:    /Volumes/Milly/torqueEngine/Torque Game Engine 1.5 SDK/Torque SDK/example/Torque Demo OSX.app/Contents/MacOS/Torque Demo OSX
Parent:  WindowServer [64]

Version: GarageGames.com, Inc. All rights reserved. (1.5.0)

PID:    261
Thread: 1

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0xcc000000

Thread 0:
0   libSystem.B.dylib          	0x9000ab48 mach_msg_trap + 8
1   libSystem.B.dylib          	0x9000aa9c mach_msg + 60
2   com.apple.CoreFoundation   	0x907dcb78 __CFRunLoopRun + 832
3   com.apple.CoreFoundation   	0x907dc47c CFRunLoopRunSpecific + 268
4   com.apple.HIToolbox        	0x93208740 RunCurrentEventLoopInMode + 264
5   com.apple.HIToolbox        	0x93207dd4 ReceiveNextEventCommon + 380
6   com.apple.HIToolbox        	0x9324cee4 AcquireNextEventInMode + 72
7   com.apple.HIToolbox        	0x9324ccd4 RunApplicationEventLoop + 132
8   com.garagegames.torquedemo 	0x002aec0c main + 460 (crt.c:300)
9   com.garagegames.torquedemo 	0x00002c3c _start + 392 (crt.c:267)
10  com.garagegames.torquedemo 	0x00002ab0 start + 48

Thread 1 Crashed:
0   <<00000000>> 	0xfffeff20 objc_msgSend_rtp + 32
1   com.apple.HIToolbox        	0x9323dde8 RemoveEventLoopTimer + 168
2   com.apple.HIToolbox        	0x932880a8 RemoveActivateTSMDocument_Timer + 48
3   com.apple.HIToolbox        	0x932875a8 MyActivateTSMDocument + 132
4   com.apple.HIToolbox        	0x93287514 ActivateTSMDocument + 16
5   com.garagegames.torquedemo 	0x002afec0 Platform::enableKeyboardTranslation() + 32 (crt.c:300)
6   com.garagegames.torquedemo 	0x0017f2f0 GuiControl::onWake() + 480 (crt.c:300)
7   com.garagegames.torquedemo 	0x00168f68 GuiTextCtrl::onWake() + 24 (crt.c:300)
8   com.garagegames.torquedemo 	0x00169e64 GuiTextEditCtrl::onWake() + 20 (crt.c:300)
9   com.garagegames.torquedemo 	0x0017ef30 GuiControl::awaken() + 160 (crt.c:300)
10  com.garagegames.torquedemo 	0x0017eee4 GuiControl::awaken() + 84 (crt.c:300)
11  com.garagegames.torquedemo 	0x0017eee4 GuiControl::awaken() + 84 (crt.c:300)
12  com.garagegames.torquedemo 	0x0017eee4 GuiControl::awaken() + 84 (crt.c:300)
13  com.garagegames.torquedemo 	0x0017deec GuiControl::addObject(SimObject*) + 108 (crt.c:300)
14  com.garagegames.torquedemo 	0x00152768 GuiStackControl::addObject(SimObject*) + 24 (crt.c:300)
15  com.garagegames.torquedemo 	0x0018da5c GuiInspector::inspectObject(SimObject*) + 2156 (crt.c:300)
16  com.garagegames.torquedemo 	0x00037430 CodeBlock::exec(unsigned, char const*, Namespace*, unsigned, char const**, bool, char const*, int) + 12112 (crt.c:300)
17  com.garagegames.torquedemo 	0x00041374 Namespace::Entry::execute(int, char const**, ExprEvalState*) + 84 (crt.c:300)
18  com.garagegames.torquedemo 	0x0003a970 Con::execute(SimObject*, int, char const**) + 192 (crt.c:300)
19  com.garagegames.torquedemo 	0x0003aa34 Con::executef(SimObject*, int, ...) + 100 (crt.c:300)
20  com.garagegames.torquedemo 	0x00173164 GuiTreeViewCtrl::onItemSelected(GuiTreeViewCtrl::Item*) + 276 (crt.c:300)
21  com.garagegames.torquedemo 	0x001734b8 GuiTreeViewCtrl::setItemSelected(int, bool) + 808 (crt.c:300)
22  com.garagegames.torquedemo 	0x001759ac GuiTreeViewCtrl::onMouseDown(GuiEvent const&) + 1180 (crt.c:300)
23  com.garagegames.torquedemo 	0x0017b660 GuiCanvas::rootMouseDown(GuiEvent const&) + 192 (crt.c:300)
24  com.garagegames.torquedemo 	0x0017b558 GuiCanvas::processInputEvent(InputEvent const*) + 2088 (crt.c:300)
25  com.garagegames.torquedemo 	0x000f02b8 DemoGame::processInputEvent(InputEvent*) + 168 (crt.c:300)
26  com.garagegames.torquedemo 	0x001e4d58 GameInterface::processEvents() + 136 (crt.c:300)
27  com.garagegames.torquedemo 	0x000efe88 DemoGame::main(int, char const**) + 1192 (crt.c:300)
28  com.garagegames.torquedemo 	0x002ae6f8 MacCarbRunTorqueMain() + 88 (crt.c:300)
29  com.garagegames.torquedemo 	0x001f3ecc ThreadRunHandler(void*) + 44 (crt.c:300)
30  libSystem.B.dylib          	0x9002b508 _pthread_body + 96
You can see this time I had to click around a few times before it crapped out.

Since I'm going to have to use the inspector and terrian elemets, this is a serious problem for me.

I may download the sdk again to make sure my copy is clean. Anyone has an idea what's going on and needs something else to narrow it down, please just let me know.

Cheers!
#22
11/18/2006 (2:06 pm)
James, this crash looks related to Unicode support (ActivateTSMDocument is used to ask the OS to give unicode keycodes for this window). I wonder if this happens because this code executes off the main thread -- I don't know about Carbon, but Cocoa GUI calls need to happen on the main thread. (See http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/index.html for a generic explanation.) I just have zero idea about how Torque has implemented threading.
#23
11/18/2006 (2:46 pm)
Thanks Rob. I'll email GG directly if they don't jump in here with a suggestion or two.

If something else comes up or I arrive at a solution, I'll post it here.

Thanks again.
#24
11/20/2006 (8:03 pm)
James -- see this thread. www.garagegames.com/mg/forums/result.thread.php?qt=53544 seems like it's the same on both platforms, and Matt knows about it.
#25
12/05/2006 (12:37 am)
@James:
Thanks for the crashlog! Only... you don't need to post the entire crash log. All that's needed is: the System info, program & version info, and the call stack for the thread that crashed.

This looks like an issue related to ActivateTSMDocument, threading, and the magic of gui control's onWake sequence.
Now, the code in onWake() is supposed to prevent multiple ActivateTSMDocument() spamming.
And, it looks like this call will need to move to thread 0, where interaction with the Mac gui must happen.

@Rob: good catch, you're exactly right.

Added Bug #2445.



/Paul
#26
12/05/2006 (7:48 am)
@ Paul - thanks for the response. I posted all that because I'm totally ignorant as to what is useful information and what isn't. Sorry about that. I'll look up wikipedia and find out what a "call stack" is :)

Everything you said after that lost me but I believe you :)

I will sleep easier know that the bug has a number and is marked for extraction.

@Rob - cool :)
#27
02/20/2010 (7:04 am)

This thread is pretty old but not finding a fix posted anywhere (1.5.2 still has the problem) and being rather annoyed by the bug while toying around with good old TGE, I quickfixed this and for now, it appears to be running stable.

So, in case someone's running into this issue with TGE on OSX, here's the changes.

In platformMacCarb/macCarbEvents.h add the following two event types:

const U32 kEventTorqueActivateTSM = 6;
const U32 kEventTorqueDeactivateTSM = 7;

Then in platformMacCarb/macCarbEvents.cc replace the following methods:

//--------------------------------------
static OSStatus _OnTorqueEvent(EventHandlerCallRef nextHandler, EventRef theEvent, void* userData)
{
   UInt32 eventKind = GetEventKind(theEvent);
   void* torqueData;
   GetEventParameter(theEvent, kEventParamTorqueData, typeVoidPtr,
                     NULL, sizeof(void*), NULL, &torqueData);
   
   switch( eventKind )
   {
      case kEventTorqueAlert:
         MacCarbRunAlertMain();
         break;

      case kEventTorqueFadeInWindow:
         MacCarbFadeInWindow((WindowPtr)torqueData);
         break;
      
      case kEventTorqueFadeOutWindow:
         MacCarbFadeAndReleaseWindow((WindowPtr)torqueData);
         break;
         
      case kEventTorqueReleaseWindow:
         ReleaseWindow((WindowPtr)torqueData);
         break;
         
      case kEventTorqueShowMenuBar:
         MacCarbShowMenuBar(torqueData);
         break;
         
      case kEventTorqueActivateTSM:
         ActivateTSMDocument(platState.tsmDoc);
         break;
         
      case kEventTorqueDeactivateTSM:
         DeactivateTSMDocument(platState.tsmDoc);
         break;
   }
   return noErr;
}

#pragma mark -
#pragma mark ---- Keyboard input ----

//--------------------------------------
void Platform::enableKeyboardTranslation(void)
{
   MacCarbSendTorqueEventToMain( kEventTorqueActivateTSM, NULL );
   platState.tsmActive=true;
}

//--------------------------------------
void Platform::disableKeyboardTranslation(void)
{
   MacCarbSendTorqueEventToMain( kEventTorqueDeactivateTSM, NULL );
   platState.tsmActive=false;
}

The asynchronous nature this has now definitely isn't ideal but so far it appears to work fine.
Page«First 1 2 Next»