Page 1 of 2

Crash when starting taspring linux client

Posted: 14 Mar 2006, 17:53
by nicke
Hi

I am a Ubuntu 5.10 (Breezy Badger) user and have tried to build the linux client for TASpring which seems to be an great game unfortuanatly i cannot get it to work properly.

My graphicscard is a GeForce Fx 5900 ultra which works well with other OpenGL games. I have followed the instructions (link below) for building the linux client:
http://taspring.clan-sy.com/wiki/SetupGuide

But spring crashes immediately when i start it?
Could anyone help me getting it to work?

/Nicke

./spring
*** glibc detected *** free(): invalid pointer: 0x0859ea68 ***
Avbruten (SIGABRT)

strace spring:
---------------
futex(0xb7ccf44c, FUTEX_WAKE, 2147483647) = 0
stat64("maps", {st_mode=S_IFDIR|0755, st_size=144, ...}) = 0
stat64("maps", {st_mode=S_IFDIR|0755, st_size=144, ...}) = 0
open("maps", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 4
fstat64(4, {st_mode=S_IFDIR|0755, st_size=144, ...}) = 0
fcntl64(4, F_SETFD, FD_CLOEXEC) = 0
mmap2(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6b06000
getdents64(4, /* 5 entries */, 131072) = 160
stat64("maps/Mars.sd7", {st_mode=S_IFREG|0755, st_size=7666430, ...}) = 0
stat64("maps/Mars.sd7", {st_mode=S_IFREG|0755, st_size=7666430, ...}) = 0
open("/dev/tty", O_RDWR|O_NONBLOCK|O_NOCTTY) = 5
writev(5, [{"*** glibc detected *** ", 23}, {"free(): invalid pointer", 23}, {": 0x", 4}, {"0859ea68", 8}, {" ***\n", 5}], 5*** glibc detected *** free(): invalid pointer: 0x0859ea68 ***
) = 63
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
tgkill(19957, 19957, SIGABRT) = 0
--- SIGABRT (Aborted) @ 0 (0) ---
+++ killed by SIGABRT +++

Posted: 14 Mar 2006, 19:37
by Tobi
Could you provide a gdb backtrace?

Compile with

Code: Select all

scons configure debug=yes && scons
and run

Code: Select all

gdb ./spring
run
then when it crashes

Code: Select all

backtrace

Posted: 14 Mar 2006, 20:33
by nicke
I tested building taspring client in debug mode and it works :shock: but it takes a looooong time to start up, so it seems that the problem i am experiencing is in release mode.

I have libsdl1.2-dev instead of libsdl-dev could that be a factor?

I made a scons -c and rebuilt in release and it crashes :?

Do you have any other way to debug in release mode?
Thanks for your help :)

Posted: 16 Mar 2006, 12:48
by nicke
I used strip to remove the debug symbols from /trunk/game/spring and that worked :shock:, so now i have a working spring client in linux with a reasonable filesize :P

So the only explanation i can think of is that there is something wrong with the makefile scons generates i.e. without debug symbols.

Posted: 16 Mar 2006, 13:07
by Tobi
I have libsdl1.2-dev instead of libsdl-dev could that be a factor?
libsdl-dev is just a virtual package depending on libsdl1.2-dev
So the only explanation i can think of is that there is something wrong with the makefile scons generates i.e. without debug symbols.
Scons doesn't generate makefiles, but replaces make and makefiles.

It might be possible tho that there's a bug in it. I'll try a release only build when I get home.

Btw, which gcc version did you use? (gcc --version)

Posted: 17 Mar 2006, 00:24
by nicke
I use:
gcc (GCC) 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)

Posted: 19 Mar 2006, 18:04
by nicke
I noticed a difference when building debug and release with scons ie. that optimazation was disabled in debug so i thought i would test a release build with no optimizations so i tried:

scons configure optimize=no
scons: Reading SConscript files ...

Now configuring. If something fails, consult `config.log' for details.

Detected platform : linux
Checking gcc version... 4.0.3
profiling NOT enabled, debugging NOT enabled, optimizing NOT enabled,KeyError: 'CCFLAGS':
File "SConstruct", line 29:
env = Environment(tools = ['default', 'rts'], toolpath = ['.', 'rts/build/scons'])
File "/usr/lib/scons/SCons/Environment.py", line 266:
apply_tools(self, tools, toolpath)
File "/usr/lib/scons/SCons/Environment.py", line 122:
env.Tool(tool, toolpath)
File "/usr/lib/scons/SCons/Environment.py", line 906:
return SCons.Tool.Tool(tool, map(self.subst, toolpath))(self)
File "/usr/lib/scons/SCons/Tool/__init__.py", line 53:
apply(self.generate, ( env, ) + args, kw)
File "rts/build/scons/rts.py", line 169:
env['CCFLAGS'] += ['-fvisibility=hidden']
File "/usr/lib/scons/SCons/Environment.py", line 290:
return self._dict[key]

Do you know if there is a workaround or anything else i could test?

Posted: 19 Mar 2006, 20:53
by Tobi
Oh, you found a bug. I fixed it in SVN, so update and try again.

Posted: 19 Mar 2006, 23:13
by nicke
Thanks for the bugfix Tobi :-) I tested building taspring with no opimizations and it worked :shock: as i suspected.. so something happens with optimized build..is it possible to tweak scons configuration so that it doesnt optimize as much? :? It still crashes in default release build.

Or is there something wrong with my build environment?

Posted: 20 Mar 2006, 12:21
by Tobi
You could try with scons configure optimize=N, with N 1, 2, 3 or s for respectively -O1 -O2 -O3 and -Os.

I really don't know what's wrong tho, I use gcc 4.0.3 myself and everything seems to work (tho it might be the real release or another prerelease,not sure about that).

I must still try an optimized-only build (I use optimize=yes debug=yes for development).

Posted: 21 Mar 2006, 00:41
by nicke
I have upgraded my gcc to (GCC) 4.0.3 (Debian 4.0.3-1) so its not a prerelase anymore :-)

I tried building taspring with optimize=(1-3) and taspring still crashes. The 'optimize=s' generated the following result:

scons configure optimize=s && scons
scons: Reading SConscript files ...

Now configuring. If something fails, consult `config.log' for details.

Detected platform : linux
Checking gcc version... 4.0.3
profiling NOT enabled, debugging NOT enabled,ValueError: invalid literal for int(): s:
File "SConstruct", line 29:
env = Environment(tools = ['default', 'rts'], toolpath = ['.', 'rts/build/scons'])
File "/usr/lib/scons/SCons/Environment.py", line 266:
apply_tools(self, tools, toolpath)
File "/usr/lib/scons/SCons/Environment.py", line 122:
env.Tool(tool, toolpath)
File "/usr/lib/scons/SCons/Environment.py", line 906:
return SCons.Tool.Tool(tool, map(self.subst, toolpath))(self)
File "/usr/lib/scons/SCons/Tool/__init__.py", line 53:
apply(self.generate, ( env, ) + args, kw)
File "rts/build/scons/rts.py", line 158:
if int(level) == 0:

Posted: 22 Mar 2006, 12:42
by Tobi
Tobi wrote:Oh, you found a bug. I fixed it in SVN, so update and try again.
and again

Posted: 23 Mar 2006, 01:41
by nicke
Checked out the latest code and 'optimize=s' works for scons configure and i can launch ./spring without a crash, it works..:shock: do you know whats the difference between O1 -O2 -O3 and -Os?

Posted: 23 Mar 2006, 19:15
by Tobi
-O1, -O2 and -O3 are just different optimization levels which turn on more and more detailed optimization code (refer to the GCC manual/infopages for details). -Os optimizes for executable size.

I still think it's strange it crashes for you tho; I found no problem whatsoever here (at least with -O3 and -Os).

Posted: 23 Mar 2006, 22:02
by nicke
Ok, -Os works for me too but not -O1,-O2,-O3

Posted: 28 Mar 2006, 20:55
by Haukew
it seems to me that the linux-client is only available for version 0.70b2 - when will b3 be released?

[Edit] Can i compile from the "normal?" source code which i download from http://taspring.clan-sy.com/download.php?

Posted: 28 Mar 2006, 21:07
by Tobi
In theory you can but I recommend an anonymous SVN checkout at the moment.

Posted: 29 Mar 2006, 00:57
by Haukew
ok - so i just have to wait until b3 comes out for linux, too?

Posted: 29 Mar 2006, 08:33
by nicke
Hi Haukew :-)

Have you tried this?
http://taspring.clan-sy.com/wiki/SetupGuide

Posted: 29 Mar 2006, 14:27
by Haukew
yes, but i did not understand what to do with the link - until 20 seconds ago i realized it's a command...now

Code: Select all

Everything seems OK.  Run `scons' now to build.
hope my luck lasts :-)

[Edit]mh...i get this error while compiling...

Code: Select all

hauke@hauke:~/trunk$ sudo scons
Password:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -O1 -pipe -march=athlon -pthread -D_REENTRANT -DDIRECT_CONTROL_ALLOWED -D_SZ_ONE_DIRECTORY -DNO_CLIPBOARD -DNO_AVI -DNO_LUA -Irts -Irts/System -I/usr/include -I/usr/include/GL -I/usr/include/freetype2 -I/usr/include/SDL -I/usr/include/AL -I/usr/include/python2.4 -c -o build/rts/Rendering/ExplosionGraphics.o rts/Rendering/ExplosionGraphics.cpp
g++ -O1 -pipe -march=athlon -pthread -D_REENTRANT -DDIRECT_CONTROL_ALLOWED -D_SZ_ONE_DIRECTORY -DNO_CLIPBOARD -DNO_AVI -DNO_LUA -Irts -Irts/System -I/usr/include -I/usr/include/GL -I/usr/include/freetype2 -I/usr/include/SDL -I/usr/include/AL -I/usr/include/python2.4 -c -o build/rts/Rendering/GroundFlash.o rts/Rendering/GroundFlash.cpp
g++ -O1 -pipe -march=athlon -pthread -D_REENTRANT -DDIRECT_CONTROL_ALLOWED -D_SZ_ONE_DIRECTORY -DNO_CLIPBOARD -DNO_AVI -DNO_LUA -Irts -Irts/System -I/usr/include -I/usr/include/GL -I/usr/include/freetype2 -I/usr/include/SDL -I/usr/include/AL -I/usr/include/python2.4 -c -o build/rts/Rendering/InMapDraw.o rts/Rendering/InMapDraw.cpp
g++ -O1 -pipe -march=athlon -pthread -D_REENTRANT -DDIRECT_CONTROL_ALLOWED -D_SZ_ONE_DIRECTORY -DNO_CLIPBOARD -DNO_AVI -DNO_LUA -Irts -Irts/System -I/usr/include -I/usr/include/GL -I/usr/include/freetype2 -I/usr/include/SDL -I/usr/include/AL -I/usr/include/python2.4 -c -o build/rts/Rendering/ShadowHandler.o rts/Rendering/ShadowHandler.cpp
In file included from rts/Rendering/ShadowHandler.cpp:14:
rts/Rendering/GL/IFramebuffer.h: In function `IFramebuffer* instantiate_fb(int)
   ':
rts/Rendering/GL/IFramebuffer.h:40: error: `GL_EXT_framebuffer_object'
   undeclared (first use this function)
rts/Rendering/GL/IFramebuffer.h:40: error: (Each undeclared identifier is
   reported only once for each function it appears in.)
scons: *** [build/rts/Rendering/ShadowHandler.o] Error 1
scons: building terminated because of errors.
I tried the above tweaks with optimize=N -Os etc - none worked