Weird spinning behavior of a station and fuel station.

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3035
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Re: Weird spinning behavior of a station and fuel station.

Post by pagroove »

Anyway this is the bug I experienced.
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
https://bb.oolite.space/viewtopic.php?f=4&t=13709
User avatar
Mad Dan Eccles
Deadly
Deadly
Posts: 196
Joined: Tue Sep 07, 2004 8:54 pm
Location: The Greatest City in the Ooniverse
Contact:

Re: Weird spinning behavior of a station and fuel station.

Post by Mad Dan Eccles »

Last night I came across yet another spinning Rock Hermit (in 1.77 deployment. It seemed to be even more frequent in 1.77 test, by the way) but instead of jumping out I made my way to the main station. As expected, it was spinning off the main axis with the docking slot and external structures screwed up.

But this time, I had docking computers! I only bought them for the sake of completeness, never intending to use them. However, I'm not sure if this is another bug, but shift-C docks me instantaneously whenever I'm within the aegis, whatever disposition and velocity (although I haven't checked red alert status, to be honest). As an aside, shift-C attempts to dock me with Rock Hermits but seems to wait for ages a dozen clicks out so I've never let it take me all the way in. So, anyway, when I got within the aegis of this screwed-up station I hit shift-C and found myself docked.

When I launched I came out the weird slot on top, and didn't die.

Which was good. The station was still screwed up though, and remained that way till I hypered out and back again.
Master of Mayhem

"The name's derived from Object Oriented eLite so you could say "Oh! Oh! Leet!", but that might sound too much like g33k sex."
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Weird spinning behavior of a station and fuel station.

Post by cim »

If you can build from source, one way to track this down - since it doesn't seem to be happening on any computer a dev owns - would be to track through the SVN history between 1.76 and 1.77 to see where it was introduced. This is time-consuming, especially for an intermittent bug like this, but is generally pretty effective at tracking down the cause. If you're willing to give it a go, there's some hints below.

http://developer.berlios.de/svn/?group_id=3577 explains how to get anonymous SVN access to download the source. Once you've done that, svn up -r [i]num[/i] will download that particular revision's source, which you can then build in the usual way.

1.76 was 4698, so you wouldn't need to go earlier than that. 5097 changed certain aspects of quaternion math, so trying that and 5096 would rule that one out. Once the obvious ones are done, you basically have to split it in half, repeatedly, until you find the one that causes it.
User avatar
Mad Dan Eccles
Deadly
Deadly
Posts: 196
Joined: Tue Sep 07, 2004 8:54 pm
Location: The Greatest City in the Ooniverse
Contact:

Re: Weird spinning behavior of a station and fuel station.

Post by Mad Dan Eccles »

Well Chuck, that sounds like more fun than that time we had to chase that coyote away from the sheep in that top field of your cuz.
Master of Mayhem

"The name's derived from Object Oriented eLite so you could say "Oh! Oh! Leet!", but that might sound too much like g33k sex."
User avatar
Mad Dan Eccles
Deadly
Deadly
Posts: 196
Joined: Tue Sep 07, 2004 8:54 pm
Location: The Greatest City in the Ooniverse
Contact:

Re: Weird spinning behavior of a station and fuel station.

Post by Mad Dan Eccles »

Actually Cim, I'd probably be happy to do that... except it's incredibly intermittent. So I haven't seen it at all tonight, in a couple hours hunting shooting and fishing. If there was a certain set of actions that made it happen (i.e. if it were reproducible!) it'd be so much easier.
Master of Mayhem

"The name's derived from Object Oriented eLite so you could say "Oh! Oh! Leet!", but that might sound too much like g33k sex."
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Weird spinning behavior of a station and fuel station.

Post by cim »

That does suggest either a memory allocation bug somewhere, or an obscure maths issue. But if it takes several hours of play for the bug to potentially show up, searching SVN certainly isn't practical...
User avatar
Mad Dan Eccles
Deadly
Deadly
Posts: 196
Joined: Tue Sep 07, 2004 8:54 pm
Location: The Greatest City in the Ooniverse
Contact:

Re: Weird spinning behavior of a station and fuel station.

Post by Mad Dan Eccles »

Yah. And it's not terribly annoying.
Master of Mayhem

"The name's derived from Object Oriented eLite so you could say "Oh! Oh! Leet!", but that might sound too much like g33k sex."
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Weird spinning behavior of a station and fuel station.

Post by cim »

Still no idea what this might be - could someone the next time it happens grab

Code: Select all

station.orientation
station.roll
station.pitch
station.yaw
station.scanClass
station.orientation
from the console, please? (Yes, station.orientation is in twice)
User avatar
maaarcooose
---- E L I T E ----
---- E L I T E ----
Posts: 397
Joined: Sun May 29, 2011 9:36 pm
Location: Devon, UK
Contact:

Re: Weird spinning behavior of a station and fuel station.

Post by maaarcooose »

Just quick example of the bug that I managed to provoke this morning.

http://www.youtube.com/watch?v=VEpgf2wTvYk

I'm going to get trunk installed and the debug console so I can capture some more info.

Anyone point me in the right direction for getting trunk up and running on my mac?

!m!
Trading computers and writing stuff....
Website: http://www.theramist.co.uk/
OOliteInfo: http://www.theramist.co.uk/ooliteinfo/oo.php
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Weird spinning behavior of a station and fuel station.

Post by Eric Walch »

On the top of the mac forum you find a link to the nighties. That is a fully compiled version with the latest changes.
User avatar
maaarcooose
---- E L I T E ----
---- E L I T E ----
Posts: 397
Joined: Sun May 29, 2011 9:36 pm
Location: Devon, UK
Contact:

Re: Weird spinning behavior of a station and fuel station.

Post by maaarcooose »

Have trunk installed and debug console now.

Will post some stuff next time I provoke it.

!m!
Trading computers and writing stuff....
Website: http://www.theramist.co.uk/
OOliteInfo: http://www.theramist.co.uk/ooliteinfo/oo.php
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Weird spinning behavior of a station and fuel station.

Post by Eric Walch »

Now it happened to me. While testing the Tori station I launched OOlite-trunk and jumped to the adjacent system with a Tori. There I waited for bad docking behaviour. While lurking around the station and doing all other stuff on the laptop, I brought Oolite back to front. At that moment both the Tori and the Buoy were spinning round like hell. I targeted it and got some data:

Code: Select all

> PS.target.roll
-18.551815032958984
> PS.target.roll
-18.551815032958984
> PS.target.yaw
0
> PS.target.pitch
0
> PS.target.orientation
(0.12938 - 0.0133388i + 0.796239j + 0.590835k)
> PS.target.heading
(-0.221798, 0.937441, -0.268348)
> PS.target.heading
(-0.221798, 0.937441, -0.268347)
> PS.target.heading
(-0.221798, 0.937441, -0.268347)
> PS.target.heading
(-0.221798, 0.937441, -0.268347)
> PS.target.roll
-18.551815032958984
> PS.target.subEntities[0].position
(1, 0, 500)
> PS.target.subEntities[0].orientation
(0.707107 + 0i + 0j + 0.707107k)
> PS.target.orientation
(0.585711 + 0.704705i + 0.370895j + 0.150899k)
And this for the buoy:

Code: Select all

> PS.target.roll
-18.630353927612305
> PS.target.pitch
-37.33924865722656
> PS.target.yaw
0
Turning around two axis is normal, but not the speed.

The system also contained a Black Monk station:

Code: Select all

> PS.target.roll
-18.316194534301758
And also a Kioto station rotating like hell:

Code: Select all

> PS.target.roll
-18.94451332092285
I notice that all rotations have about the same value. All docks seemed placed correctly though.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Weird spinning behavior of a station and fuel station.

Post by cim »

Makes sense that it's those objects, because anything not in behaviour_idle would have its roll+pitch corrected back to sensible values after something affected it.

I can't see anything plausible in the code that could do this, so that looks like a memory corruption bug. The gdb debugger lets you watch a value and break for debugging any time anything writes to it - does the Mac debugger have that feature too? If so, only applySticks should be writing to flightRoll for stations, so it might be possible to track it down that way.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Weird spinning behavior of a station and fuel station.

Post by Eric Walch »

It will stay difficult to analyse without a sure way to trigger the bug. Till now I have only seen it once.

Probably you can set conditional breakpoints, but apple managed to hide that function completely. With Xcode3 you could insert breakpoints from the menu. Now, with XCode4 there is a whole breakpoint editor and other breakpoint functions. But no obvious way to add them into the code. :)

XCode4 has so many new functions that the old ones just can't be found anymore. :?

It is just odd that all idle stuff had about the same value. As if to all the same wrong value was added. e.g. by a corrupt ∆t value when returning from sleep mode?
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Weird spinning behavior of a station and fuel station.

Post by cim »

Eric Walch wrote:
It is just odd that all idle stuff had about the same value. As if to all the same wrong value was added. e.g. by a corrupt ∆t value when returning from sleep mode?
Thing is, in idle behaviour nothing should be writing new values to roll at all - stick_roll gets set to flightRoll in behaviour_idle, and then flightRoll gets set to stick_roll in applySticks, and in normal circumstances they just pass back and forth the original value set at ship creation.

Maybe something else is being written to a different ship property, but which property is being corrupted? Bad pointer arithmetic somewhere, perhaps? What would subtract about 19 from a property, though?
Post Reply