Page 1 of 1

Lots of segmentation faults with 0.73b1

Posted: 07 Oct 2006, 16:31
by architeuthis
I installed spring 0.73b1 on linux (ubuntu 6.06).
Spring regularly crashes, the console reports everytime "segmentation fault", it happens with nanoblobs 0.63, aa 2.21 and xta. It just happens randomly no returning pattern or crashes with one type of unit.

Are these bugs or can this occur with a bad compilation or something like that?

Posted: 07 Oct 2006, 18:32
by LordMatt
A somewhat related question: What is a segmentation fault, and what generally causes it? I've had them from other linux programs from time to time and I'd like to know where to start looking to fix them.

Posted: 07 Oct 2006, 19:37
by Tobi
A segmentation fault means the program tried to access memory that it didn't have access to.

For example it tried to write to a read-only "page" (chunk of memory) or tried to read from a page of another process.

It usually happens because of uninitialized variables, particularly pointers, writing outside array bounds, or using NULL pointers.

To fix a segmentation fault the most important thing is to be able to reproduce it, preferably as easy as possible. Then you'd usually (re)compile the sourcecode of the program with debugging enabled so you can run it inside the debugger (gdb). Then if you get the segmentation fault again while running in debugger, you can create a stacktrace and look at that place in the source.

If you're lucky the bug is pretty obvious but usually only then the detective work starts to figure out why that certain pointer was uninitialized, why it was NULL, etc. A good knowledge of the language the program is written in definitely helps in that case, but the developers will be very happy already if you can supply them with a unambiguous instructions "how to reproduce" the bug, the stacktrace, and any data files needed to reproduce it.

Also make sure to only debug the recentmost version of a program, preferably a version from CVS/SVN/bazaar/etc. otherwise you might be spilling your time if the bug has already been fixed upstream.

Posted: 07 Oct 2006, 21:02
by architeuthis
I'd like to try to reproduce the segmentation fault, but how do i recompile spring with debugging enabled?

And gdb would work like "gdb ./spring" right? because i am not going to read all this: http://sources.redhat.com/gdb/current/o ... b_toc.html :roll:

Posted: 07 Oct 2006, 21:51
by Tobi
Ultraquick debugging on linux help
Compiling spring

Code: Select all

scons configure debug=yes
scons
Running spring in gdb and making a backtrace after it crashes

Code: Select all

gdb ./spring
r
  <<<Wait until it segfaults>>>
bt
q

Posted: 08 Oct 2006, 04:30
by LordMatt
Thanks Tobi, I will keep that in mind if I have those issues again.

Posted: 08 Oct 2006, 12:54
by architeuthis
Thanks, i made a backtrace but it looks absurdly long. Another question were does it save the backtrace? And will i have to paste it in pastebin or something like that?

Posted: 08 Oct 2006, 12:56
by imbaczek
Put it anywhere, be it pastebin, rapidshare, filefront, spring issue tracker, whatever. The sooner, the better :)

Posted: 08 Oct 2006, 13:00
by Tobi
architeuthis wrote:Thanks, i made a backtrace but it looks absurdly long. Another question were does it save the backtrace? And will i have to paste it in pastebin or something like that?
The backtrace isn't saved, you should just copy paste it. A pastebin is fine yeah.

Posted: 08 Oct 2006, 13:27
by architeuthis
Ok here is it:

Code: Select all

(gdb) r
Starting program: /home/architeuthis/spring/taspring_0.73b1/game/spring
[Thread debugging using libthread_db enabled]
[New Thread -1231337792 (LWP 13319)]
warning: Lowest section in /usr/lib/libicudata.so.34 is .hash at 00000094
[New Thread -1231426640 (LWP 13322)]
[New Thread -1410233424 (LWP 13324)]
[New Thread -1419928656 (LWP 13361)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1231337792 (LWP 13319)]
0xb5cc01d3 in __glim_R200TCLDrawArrays () from /usr/lib/dri/atiogl_a_dri.so
The enitire bt is more then 20000 lines long, i hope this is what you need?
Do you need more info (map, mod etc)?

Posted: 08 Oct 2006, 13:34
by architeuthis
I got another one, this one is pracitcally the same:

Code: Select all

Starting program: /home/architeuthis/spring/taspring_0.73b1/game/spring
[Thread debugging using libthread_db enabled]
[New Thread -1231354176 (LWP 13921)]
warning: Lowest section in /usr/lib/libicudata.so.34 is .hash at 00000094
[New Thread -1231443024 (LWP 13924)]
[New Thread -1410249808 (LWP 13927)]
[New Thread -1419945040 (LWP 13933)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1231354176 (LWP 13921)]
0xb5cbc1d3 in __glim_R200TCLDrawArrays () from /usr/lib/dri/atiogl_a_dri.so
Are these the same or is this just the same bug but on another moment?

Posted: 08 Oct 2006, 13:46
by Tobi
Hm I fear it's maybe an ATI driver bug seeing that first stackframe, but feel free to post the entire backtrace. If it's that long put it on a pastebin or some public file server thing and give a link to it here.

Posted: 08 Oct 2006, 14:02
by architeuthis
The backtrace is extremly long (+2000 lines), i have to press enter to continue every 20 lines, and my console remembers only 100 lines, so i have to copy them seperatly and i really dont have the time to copy thousands of lines. But i came this far: http://pastebin.com/802452

If its a driver issue, i have a big problem, ati stopped supporting my ati9250 pro, damned ati.

I hope i helped you and contributed to spring.

Posted: 12 Oct 2006, 20:47
by architeuthis
Was my bug report useful or is it really a driver issue? Is someone else maybe experiencing the same problem?

If its a driver issue is there any thing i can do, because ati is no longer making drivers for my ati9250?

Posted: 12 Oct 2006, 21:04
by Tobi
It seems really a driver thing. I think I saw identical looking backtraces in other cases.
Maybe if it ends with something different then the bunch of identical lines, it could be useful (that end part that is).

Posted: 12 Oct 2006, 21:35
by pheldens
Yep the crash is in a fire gl driver component.

You can try the open drivers, they are slower but dont have such short lifetimes. (r200 series could be too slow for spring with open drivers)

I'm running spring on the open r300 driver (x700 64bit mem) and it's just doable. But svn is crashing there more often for me too, with a lockup of the hardware. It's unlikely it's springs fault though, too many incriminating other factors.

Posted: 12 Oct 2006, 22:02
by architeuthis
Thanks for the help, i'll chech out those open drivers?

edit: can you tell me which open drivers you use?

Posted: 10 Jun 2007, 16:20
by pattex
architeuthis wrote:The backtrace is extremly long (+2000 lines), i have to press enter to continue every 20 lines, and my console remembers only 100 lines, so i have to copy them seperatly and i really dont have the time to copy thousands of lines.
If the debug information is sent to stdOUT, you could use redirecting...

Code: Select all

gdb ./spring > ~/debugfile.txt
r
  <<<Wait until it segfaults>>>
bt
q 
your +2000 lines file will be located in your home directory then, I suppose

please correct me if I´m wrong


anyway, I´ve an SEGFault as well...
I used Spring for a week or so on Ubuntu Feisty and suddenly during a AiSkirmish Spring segfaulted. Since then neither the Ubuntu .deb-packet nor the self-compiled version would run...

Posted: 10 Jun 2007, 16:30
by Relative
Necro post! Sorcery I say!

Posted: 10 Jun 2007, 17:29
by pattex
oh, sry, i´ll start a new thread...