warlock235 / XAst

This code was originally written to find compiler syntax bugs and floating point errors. It plays a mean game of classic Asteroids, albeit a silent one.
Apache License 2.0
1 stars 2 forks source link

Segfault immediately when starting game #5

Open jlkaus opened 7 years ago

jlkaus commented 7 years ago

Running on linux, RHEL7.3, x86_64. When I start up XAsteroids, I get the menu screen just fine, and can go in and change settings, etc. But, when I press S to start the game, the game board flashes up quick, and you can see some asteroids drawn, etc, but then everything dies, with a segfault.

I took a core dump, and rebuilt with debugging symbols on, and here is the backtrace:

0 SetPositionBoxes (cTime=, this=)

at gamePlay/options/../../objects/ships/../../utilities/../objects/movableObject.H:178

1 Intersector::Intersect (this=this@entry=0x646e90 <playingField+304>)

at gamePlay/options/../../objects/ships/../../utilities/intersection2d.H:710

2 0x000000000042d5f8 in PlayingField::RunGame (this=this@entry=0x646d60 , options=...)

at gamePlay/options/../../objects/ships/../explosions/../../gamePlay/../objects/ships/../../gamePlay/../objects/ships/../../gamePlay/../objects/ships/../../gamePlay/../objects/enemies/../../gamePlay/../objects/rocks/../../gamePlay/playingField.H:500

3 0x000000000042e2c5 in PlayingField::PlayTheGame (this=this@entry=0x646d60 , l=1, argc=argc@entry=1,

argv=argv@entry=0x7ffc69d14e78)
at gamePlay/options/../../objects/ships/../explosions/../../gamePlay/../objects/ships/../../gamePlay/../objects/ships/../../gamePlay/../objects/ships/../../gamePlay/../objects/enemies/../../gamePlay/../objects/rocks/../../gamePlay/playingField.H:591

4 0x0000000000404446 in main (argc=1, argv=0x7ffc69d14e78) at XAsteroids.C:35

jlkaus commented 7 years ago

Same thing happens on Slackware 14.2/x86_64.

This problem is really curtailing my enjoyment of this game! :)

jlkaus commented 7 years ago

On the RHEL7.3 system, gcc version is 4.8.3. On the Slackware 14.2 system, gcc version is 5.3.0.

@warlock235 confirmed that with newer gcc versions, he gets the segfault as well, and suggests moving to an older gcc. That might be a little tricky to try on my systems.

He also suggests that breaking up the line with the segfault, in Intersector::Intersect seems to either make the problem go away, or change the problem signature. I may play with that a bit.