Game Development Community

Getting 'kern_protection_failure' Error

by Patrick Jeeves · in Torque Game Engine · 10/22/2008 (11:50 am) · 5 replies

I've had torque for a while but recently it started closing when i tried to load a mission; naturally i thought i must have messed up the source, so i copied the source files i changed to another folder, and reinstalled torque from the download. The version of torque included worked; until i tried to compile the source, (without changing any of it,) and the resulting 'torque demo OSX.app' does the same thing.

this is the crash log:

...
Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread:  1
...
Thread 1 Crashed:
0   com.garagegames.torquedemo    	0x0021c0d0 dStricmp(char const*, char const*) + 32
1   com.garagegames.torquedemo    	0x0028ca10 TSShape::findName(char const*) const + 64
2   com.garagegames.torquedemo    	0x0010f154 PlayerData::preload(bool, char*) + 516
3   com.garagegames.torquedemo    	0x000365e4 CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*, int) + 2660
4   com.garagegames.torquedemo    	0x0003f660 Namespace::dumpFunctions() + 9584
5   com.garagegames.torquedemo    	0x00038bbc CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*, int) + 12348
6   com.garagegames.torquedemo    	0x0003870c CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*, int) + 11148
7   com.garagegames.torquedemo    	0x0003870c CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*, int) + 11148
8   com.garagegames.torquedemo    	0x0003870c CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*, int) + 11148
9   com.garagegames.torquedemo    	0x000355b4 CodeBlock::compileExec(char const*, char const*, bool, int) + 612
10  com.garagegames.torquedemo    	0x0019cbe0 GuiControl::onAction() + 112
11  com.garagegames.torquedemo    	0x00171f54 GuiButtonBaseCtrl::onAction() + 276
12  com.garagegames.torquedemo    	0x00171bd4 GuiButtonBaseCtrl::onMouseUp(GuiEvent const&) + 84
13  com.garagegames.torquedemo    	0x00196974 GuiCanvas::processInputEvent(InputEvent const*) + 2084
14  com.garagegames.torquedemo    	0x000fee64 DemoGame::processInputEvent(InputEvent*) + 164
15  com.garagegames.torquedemo    	0x0020d244 GameInterface::processEvents() + 132
16  com.garagegames.torquedemo    	0x000fea34 DemoGame::main(int, char const**) + 1188
17  com.garagegames.torquedemo    	0x002df744 Platform::AlertRetry(char const*, char const*) + 420
18  com.garagegames.torquedemo    	0x0021c728 dQsort(void*, unsigned int, unsigned int, int (*)(void const*, void const*)) + 56
19  libSystem.B.dylib             	0x96be8658 _pthread_start + 316
...

and this is the contents of console.log:

...
Engine initialized...
Could not locate texture: tutorial.base/client/ui/buttons/exit
...
Could not locate texture: tutorial.base/client/ui/buttons/tutorial_i
Exporting server prefs...
creating path common/prefs.cs
creator/editor/editor.cs (96): Unable to find object: 'Editor' attempting to call function 'close'
Exporting server prefs...
creating path common/prefs.cs
Loading compiled script tutorial.base/server/camera.cs.
Loading compiled script tutorial.base/server/editor.cs.
... Shape with old version.

OS X 10.5.5; PPC

#1
10/23/2008 (12:06 pm)
Do you have anything in creator/editor/? Make sure your project does not have any spaces in the path as well.
#2
10/23/2008 (5:19 pm)
Looks like a plain old null pointer dereference. Compounded with evidence such as crashing in a function that takes two pointers and dereferences them without checking whether they're NULL.

What happened when you ran this under the XCode debugger and looked up the callstack for where the NULL pointer was coming from?

Gary (-;
#3
10/25/2008 (9:03 pm)
@ David:
its tutorial.base nothing inside changed; i set it to this to test if it was my problem.

@ Gary:
i never learned how to use the Xcode debugger; but i'll try that.
#4
10/27/2008 (7:01 am)
Okay i found the problem, some application installed a thing by unsanity on my hard disk and that was causing the error.
#5
10/27/2008 (11:54 am)
Dear Application Enhancer: Die, horribly.


Application Enhancer harkens back to the days of pre-OSX. Pre-OSX, no memory protection anywhere meant that you could load things into memory that poked at random into other things in memory. This is Bad(TM).

Because OSX is based on a unix-ish kernel, you're no longer allowed to do stupid bad things like that... Unless someone installed Application Enhancer, in which case random applications have again gained the ability to poke random crap into other random application's memory spaces. It's a terrible terrible idea, concept, design, and implementation, no matter what you're trying to do.

I would like to take the unsanity developers and beat them to death with Tanenbaum's book.

Gary (-;