[FIXED] Segfault when shooting or selecting sub-units

Find any bugs in Vega Strike? See if someone has already found it, or report them here!

[FIXED] Segfault when shooting or selecting sub-units

Postby maze » Sun Nov 11, 2012 10:46 pm

As a reminder, my OD is Debian GNU/Linux Testing (Wheezy)

I mentioned in a previous thread, the game segfaults systematically after some time when I'm fighting sub-units of the capship that I have to destroy per my current mission. The ship in question is an Agesipolis.

The segfault can happen at the very mometnt when I'm shooting the turret, or at the very moment when I'm selecting a new sub-unit.

Below the backtrace of the segfault:
Code: Select all
[Thread debugging using libthread_db enabled]
  Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
  [New Thread 0x7fffe5e3f700 (LWP 14908)]
  [Thread 0x7fffe5e3f700 (LWP 14908) exited]
  [New Thread 0x7fffe5e3f700 (LWP 14909)]
  [New Thread 0x7fffe1636700 (LWP 14910)]
  [New Thread 0x7fffdbfff700 (LWP 14911)]
 
  Prog0x0000000000e97ac4 in UnitDrawer::draw (this=0x7fffffffbaf0, unit=0x0) at ../src/star_system.cpp:214
  (gdb) backtrace
  #0  0x0000000000e97ac4 in UnitDrawer::draw (this=0x7fffffffbaf0, unit=0x0) at ../src/star_system.cpp:214
  #1  0x0000000000e979af in UnitDrawer::drawParents (this=0x7fffffffbaf0) at ../src/star_system.cpp:196
  #2  0x0000000000e95b6e in GameStarSystem::Draw (this=0x617f010, DrawCockpit=true) at ../src/star_system.cpp:322
  #3  0x0000000000e9bb44 in GameUniverse::StartDraw (this=0x26c6530) at ../src/universe.cpp:289
  #4  0x0000000000e8b83e in main_loop () at ../src/main_loop.cpp:1017
  #5  0x000000000118d2ec in winsys_process_events () at ../src/gldrv/winsys.cpp:513
  #6  0x0000000001169717 in GFXLoop (main_loop=0x118f614 <bootstrap_first_loop()>) at ../src/gldrv/gl_init.cpp:743ram received signal SIGSEGV, Segmentation fault.
  #7  0x0000000000e9b33a in GameUniverse::Loop (this=0x26c6530, main_loop=0x118f614 <bootstrap_first_loop()>) at ../src/universe.cpp:173
  #8  0x000000000118e859 in main (argc=2, argv=0x7fffffffe128) at ../src/main.cpp:351
  (gdb)


Sorry I can't send you the full stderr and stdout because gdb doesn't let me take control of an existing vegastrike process (vegastrike crashes when I start). So I have to launch vegastrike from gdb. I tried a trick to redirect the stderr and stdout of the inferior-tty to files in addition to the terminal, but it failed. Below I copy you the last lines of stdout.
Code: Select all
Reading Cubemap backgrounds/orange_light.cube
Transferring 1024x1024 texture, page 0 (eff: 1024x1024 - limited at 1024 - 11 mips), onto name 680 (CUBEMAP_POSITIVE_X)
Transferring 1024x1024 texture, page 1 (eff: 1024x1024 - limited at 1024 - 11 mips), onto name 680 (CUBEMAP_NEGATIVE_X)
Transferring 1024x1024 texture, page 2 (eff: 1024x1024 - limited at 1024 - 11 mips), onto name 680 (CUBEMAP_POSITIVE_Y)
Transferring 1024x1024 texture, page 3 (eff: 1024x1024 - limited at 1024 - 11 mips), onto name 680 (CUBEMAP_NEGATIVE_Y)
Transferring 1024x1024 texture, page 4 (eff: 1024x1024 - limited at 1024 - 11 mips), onto name 680 (CUBEMAP_POSITIVE_Z)
Transferring 1024x1024 texture, page 5 (eff: 1024x1024 - limited at 1024 - 11 mips), onto name 680 (CUBEMAP_NEGATIVE_Z)
Min (0.000000, 0.000000, 0.000000) Max(0.000000, 0.000000, 0.000000) MinLumin 1.000000, MaxLumin 1.000000Read In Star Count 0 used: 2000
Min (0.000000, 0.000000, 0.000000) Max(0.000000, 0.000000, 0.000000) MinLumin 1.000000, MaxLumin 1.000000Read In Star Count 0 used: 38
Loading a starsystem
Loading Star System Redemption/New_Portland
 Next To: Ingatwa/Yeelguhuul
 Next To: Ingatwa/Netheilaen
 Next To: Ingatwa/Mahguhmaah
 Next To: Redemption/New_Sacramento
 Next To: Redemption/New_Manhattan
Loading sound file sfx43.wav
AUDPlay sound 21 51
Beam collide with 0x193ab610, distance 68.048866
Beam collide with 0x193ab610, distance 68.601723
Beam collide with 0x325a450, distance 18.308573
Beam collide with 0x325a450, distance 26.813875
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Processing events
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Processing events
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Processing events
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Processing events
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Processing events
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Processing events
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Processing events
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Processing events
Occluders: 2 forced and 16 dynamic
Beam collide with 0x325a450, distance 18.308340
Beam collide with 0x325a450, distance 26.850910
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Occluders: 2 forced and 16 dynamic
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic
Processing events
Occluders: 2 forced and 16 dynamic
AUDPlay sound 32 38
AUDPlay sound 28 38
Beam collide with 0x193ab610, distance 233.645508
Beam collide with 0x193ab610, distance 233.173553
Drawn 11220 vertices in 27 batches
Occluders: 0 forced and 0 dynamic

Very instructuve huh?
User avatar
maze
Hunter
Hunter
 
Posts: 94
Topics: 11
Joined: Tue Oct 30, 2012 3:39 pm

Share On:

Share on Facebook Facebook Share on Twitter Twitter Share on Digg Digg

Re: Segfault when shooting or selecting sub-units

Postby klauss » Sun Nov 11, 2012 11:28 pm

I think I found the problem with the traceback. I just committed it. Thanks :D

You can redirect to file and tty with tee:

gdb --args vegastrike --debug=3 2>&1 | tee vslog
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Segfault when shooting or selecting sub-units

Postby maze » Mon Nov 12, 2012 3:53 pm

I just tested your change and it looks good. I was able to destroy all the turretpd of the area ship, deliver my torpedo, which did not destroy it, and continue fighting for some twenty minutes before misfortune put me right in the middle of the line of fire between him and another capship. Since I had reproduced the segfault at least a dozen of times before that, in the same circumstances, with 100% occurence before the destruction of the 4th turret, I'd say we can consider that a successful bug fix.
User avatar
maze
Hunter
Hunter
 
Posts: 94
Topics: 11
Joined: Tue Oct 30, 2012 3:39 pm


Return to Bug Triage

Who is online

Users browsing this forum: No registered users and 3 guests