Game Development Community

Segfault in linux

by Logan Buesching · in Torque Game Builder · 03/13/2006 (5:56 pm) · 3 replies

I have been working on getting a linux build of the alpha, and here is what I have done.

Remove -mcpu=i686... it's depreciated and I dont like warnings
Problem 1.)
targets.torque.mk:307: *** missing separator. Stop.
make: *** [default] Error 2
---
comment out the T2D/fxGlobals.cc
Problem 2.)
make: *** No rule to make target 'out.GCC3.DEBUG/dgl/rectClipper.obj', needed by 'out.GCC3.DEBUG/T2D_DEBUG.bin'. Stop.
---
comment out line 77.
Problem 3.)
gui/editor/guiInspector.cc:20:34: t2d/t2dBaseDatablock.h: No such file or directory
gui/editor/guiInspector.cc:21:38: t2d/t2dImageMapDatablock.h: No such file or directory
gui/editor/guiInspector.cc:22:50: t2d/sceneedit/gui2DDatablockDropDown.h: No such file or directory
---
change t2d to T2D in the includes
Problem 4.)
./T2D/sceneedit/gui2DDatablockDropDown.h:13:33: t2d/t2dStaticSprite.h: No such file or directory
./T2D/sceneedit/gui2DDatablockDropDown.h:40:7: warning: no newline at end of file
---
again, change t2d to T2D
Problem 5.)
make: *** No rule to make target 'out.GCC3.DEBUG/T2D/fxAnimatedSprite2D.obj', needed by 'out.GCC3.DEBUG/T2D_DEBUG.bin'. Stop.
---
in targets.torque.mk, source.t2d, change all of them from fx[file]2D.cc to t2d[file].cc.
remove line 307, un-necessary as function is now in t2dUtility
Problem 6.)
platformX86UNIX/x86UNIXFileio.cc:850: error: prototype for 'bool Platform::dumpP ath(const char*, Vector&)' does not match any in class 'Platform'
./platform/platform.h:337: error: candidate is: static bool Platform::dumpPath(const char*, Vector&, S32)
make: *** [out.GCC3.DEBUG/platformX86UNIX/x86UNIXFileio.obj] Error
---
Remove the last argument in platform.h:337

Once I have done that, I had to add some references to the targets.torque.mk. Here they are:
Line 307 add:
T2D/sceneedit/gui2DDatablockDropDown.cc
not sure where this one should go, so that's where I put it.

It also seems that the entire TS folder is not even compiled into the program, so I added the target:
SOURCE.TS=ts/tsAnimate.cc \
ts/tsDecal.cc \
ts/tsDump.cc \
ts/tsIntegerSet.cc \
ts/tsLastDetail.cc \
ts/tsMaterialList.cc \
ts/tsMesh.cc \
ts/tsPartInstance.cc \
ts/tsShapeAlloc.cc \
ts/tsShape.cc \
ts/tsShapeConstruct.cc \
ts/tsShapeInstance.cc \
ts/tsShapeOldRead.cc \
ts/tsSortedMesh.cc \
ts/tsThread.cc \
ts/tsTransform.cc

and to the SOURCE.ENGINE add $(SOURCE.TS) to the end.

So that's where I stand right now. I have a binary!!!

#1
03/13/2006 (5:56 pm)
Ok, now, once I have done that, I try and start it up, and I get a segfault.

here is the trace:

Starting program: /home/ljbuesch/Desktop/ALPHA2_T2D-SDK_1-1/example/T2D_DEBUG.bin
[Thread debugging using libthread_db enabled]
[New Thread -1215514944 (LWP 18704)]
[New Thread -1223910480 (LWP 18707)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1215514944 (LWP 18704)]
0xb7d1d83c in memcpy () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0 0xb7d1d83c in memcpy () from /lib/tls/i686/cmov/libc.so.6
#1 0x081c574b in dMemcpy (dst=0xfca838b5, src=0xb75cf538, size=384) at platformX86UNIX/x86UNIXMemory.cc:13
#2 0x08158558 in t2dImageMapDatablock::generateTextureFrames (this=0xb7567268) at T2D/t2dImageMapDatablock.cc:1319
#3 0x0815703b in t2dImageMapDatablock::calculateFrames (this=0xb7567268) at T2D/t2dImageMapDatablock.cc:510
#4 0x08156b3c in t2dImageMapDatablock::compileImageMap (this=0xb7567268) at T2D/t2dImageMapDatablock.cc:319
#5 0x08156a87 in t2dImageMapDatablock::onAdd (this=0xb7567268) at T2D/t2dImageMapDatablock.cc:289
#6 0x0807e1c6 in SimObject::registerObject (this=0xb7567268) at console/simManager.cc:340
#7 0x0805d16d in CodeBlock::exec (this=0xb74781f8, ip=240, functionName=0xb7488210 "T2D/client/demoDatablocks.cs",
thisNamespace=0x0, argc=0, argv=0x0, noCalls=false, packageName=0x0) at console/compiledEval.cc:600
#8 0x0806ba21 in cexec (argc=2, argv=0x82e2588) at console/consoleFunctions.cc:1015
#9 0x0805e92f in CodeBlock::exec (this=0xb7465288, ip=69, functionName=0xb74359ec "initialiseClient",
thisNamespace=0xb7418228, argc=0, argv=0x82e2588, noCalls=false, packageName=0x0) at console/compiledEval.cc:1162
#10 0x0805e56c in CodeBlock::exec (this=0xb745d5b8, ip=63, functionName=0xb74326d4 "onStart", thisNamespace=0xb70fdbd8,
argc=0, argv=0x82e2588, noCalls=false, packageName=0xb74358ac "T2D") at console/compiledEval.cc:1087
#11 0x0805e56c in CodeBlock::exec (this=0xb745dbc8, ip=114, functionName=0xb74326d4 "onStart",
thisNamespace=0xb70fdc88, argc=0, argv=0x82e2588, noCalls=false, packageName=0xb7458d64 "T2D_TILE_EDITOR")
at console/compiledEval.cc:1087
#12 0x0805e56c in CodeBlock::exec (this=0xb745c028, ip=54, functionName=0xb74326d4 "onStart", thisNamespace=0xb70f5518,
argc=0, argv=0x82e2588, noCalls=false, packageName=0xb7459010 "T2D_PARTICLE_EDITOR") at console/compiledEval.cc:1087
#13 0x0805e56c in CodeBlock::exec (this=0xb745abc8, ip=1281, functionName=0x0, thisNamespace=0x0, argc=0, argv=0x0,
noCalls=false, packageName=0x0) at console/compiledEval.cc:1087
#14 0x0806119c in CodeBlock::compileExec (this=0xb745abc8, fileName=0x0,
string=0xb7453b68 "//", '-' , "\r\n// Torque 2D. \r\n// Copyright (C) GarageGames.com, Inc.\r\n//", '-' ..., noCalls=false) at console/compiler.cc:522
#15 0x08067ed8 in Con::evaluate (
string=0xb7453b68 "//", '-' , "\r\n// Torque 2D. \r\n// Copyright (C) GarageGames.com, Inc.\r\n//", '-' ..., echo=false, fileName=0x0) at console/console.cc:778
#16 0x0806bb2a in ceval (argc=2, argv=0xbffe6520) at console/consoleFunctions.cc:1046
#17 0x0806f2fe in Namespace::Entry::execute (this=0xb70f5f10, argc=2, argv=0xbffe6520, state=0x82e4f80)
at console/consoleInternal.cc:850
#18 0x08067fd1 in Con::execute (argc=2, argv=0xbffe6520) at console/console.cc:803
#19 0x080681c3 in Con::executef (argc=2) at console/console.cc:863
#20 0x080f1169 in runEntryScript (argc=1, argv=0xb7105e78) at game/main.cc:300
#21 0x080f12de in initGame (argc=1, argv=0xb7105e78) at game/main.cc:333
#22 0x080f138d in DemoGame::main (this=0x82feea0, argc=1, argv=0xb7105e78) at game/main.cc:390
#23 0x081cfa22 in main (argc=1, argv=0xbffe8cc4) at platformX86UNIX/x86UNIXWindow.cc:886

Any information or help would be greatly appreciated :)
#2
03/13/2006 (11:13 pm)
The required changes to make Alpha 2 work are in this file: T2DLinux11b.zip.
#3
03/24/2006 (10:02 pm)
I just received my laptop back from Dell, and that file worked WONDERFULLY, thanks very much.

I must also add that it worked for GCC 4.0.2 under Ubuntu 5.10, w/o any changes to that zip!

Thank you very much.