Weird spinning behavior of a station and fuel station.

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

Moderators: winston, another_commander, Getafix

LRGH
Poor
Poor
Posts: 4
Joined: Sun May 18, 2014 5:28 pm

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

Post by LRGH »

cim wrote:
Thanks. Would you be able to try out the Mac nightly build - https://bb.oolite.space/viewtopic.php?f=10&t=7648 - and confirm that the bug is still there, please?
I can do that. But I am not sure that the bug will still appear.
Currently I am outside the station, and therefore I cannot save the game. And I have not bought the docking computers, I was planning to hyperjump to be able to dock somewhere, I don't think I can entre the station where I am, it is spinning faster than what I can do.

Note that the Rock Hermit, the Station and the Buoy are spinning fast. And the entrance of the station is not in the direction of the Buoy (if it can help to diagnose the issue). I have also looked at a ship that left the station: she was spinning fast, too.
cim wrote:
Assuming it hasn't disappeared in the current code as mysteriously as it arrived, I think we'll need someone with a Mac, a compiler and a fair bit of patience (...) Any volunteers?
If I have a saved game that shows the bug, I may do the work.
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 »

LRGH wrote:
If I have a saved game that shows the bug, I may do the work.
Loading a saved game is likely to reset everything to working state again, so it would probably be a matter of flying around for several systems and hoping that "didn't see it this time" means "gone". One of the reasons, I think, no-one's done it already.
LRGH
Poor
Poor
Posts: 4
Joined: Sun May 18, 2014 5:28 pm

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

Post by LRGH »

cim wrote:
Loading a saved game is likely to reset everything to working state again, so it would probably be a matter of flying around for several systems and hoping that "didn't see it this time" means "gone". One of the reasons, I think, no-one's done it already.
Indeed, everything went fine after dying and loading a saved game !

I just have this weird spinning once again. Still the same version of Oolite, therefore it can not help to tell when this bug appeared.
Do you think that I can get some useful information by attaching gdb to the running process ?
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 »

LRGH wrote:
Do you think that I can get some useful information by attaching gdb to the running process ?
Maybe - depends how good you are with gdb. I assume what's happening is something is causing information to leak into another buffer, and the nature of the leak means it often hits station roll rates (that, or those aren't usually corrected by something else, so it's more noticeable then). If you could find the station's roll rate in memory, and set a breakpoint for if it changes, then find what caused the change ... I'm fairly sure this is possible with gdb, but I have no idea how, unfortunately.
LRGH
Poor
Poor
Posts: 4
Joined: Sun May 18, 2014 5:28 pm

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

Post by LRGH »

cim wrote:
Maybe - depends how good you are with gdb. I assume what's happening is something is causing information to leak into another buffer, and the nature of the leak means it often hits station roll rates (that, or those aren't usually corrected by something else, so it's more noticeable then). If you could find the station's roll rate in memory, and set a breakpoint for if it changes, then find what caused the change ... I'm fairly sure this is possible with gdb, but I have no idea how, unfortunately.
If there is no procedure explaining how to access to Oolite internals, it will be difficult, indeed.

I did not look at Oolite source code, but if this is caused by a buffer overflow, the list of values that are changed may help to find the bug.
There are at least the roll rates of stations, buoys and hermits, but also the orientation of the station, which does not have its entrance pointing to the buoy.
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 »

Okay, turns out it's quite straightforward once you pick the right search terms. This should do it in gdb - make sure Oolite is compiled in full debug mode, though:

Code: Select all

$ gdb oolite.app/oolite.dbg
...
(gdb) watch 'Universe.m'::gSharedUniverse->cachedStation->flightRoll
Hardware watchpoint 1: 'Universe.m'::gSharedUniverse->cachedStation->flightRoll
(gdb) run
...
{{{{ this is Oolite initialising the station. Every time you load a saved game or make a hyperspace jump,
Oolite will delete the station and create a new one, so you'll have to type 'continue' twice to let it do that }}}}
Hardware watchpoint 1: 'Universe.m'::gSharedUniverse->cachedStation->flightRoll

Old value = <unreadable>
New value = 0.125663713
-[Universe setUpSpace] (self=0x2054360, _cmd=0xfc8be0)
    at src/Core/Universe.m:1217
1217		closeSystems = nil;
(gdb) continue
...
{{{{ At this point I deliberately wrote to the station roll rate with the debug console. }}}}
Hardware watchpoint 1: 'Universe.m'::gSharedUniverse->cachedStation->flightRoll

Old value = 0.125663713
New value = 1
-[ShipEntity setRawRoll:] (self=0x7fffe51fad00, _cmd=0xf69430, amount=1)
    at src/Core/Entities/ShipEntity.m:7531
7531	}
{{{{ and we get a backtrace from the legitimate roll-setting function }}}}
(gdb) bt
{{{{ lots of useful backtrace info here }}}}
...
{{{{ when you exit the program, you'll get the gdb prompt back - cleanup the breakpoint here }}}}
(gdb) delete
Delete all breakpoints? (y or n) y
(gdb)
Good luck!
User avatar
Cholmondely
Archivist
Archivist
Posts: 5381
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

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

Post by Cholmondely »

This often happens on my AppleMac if I pause the game and then come back to it some time later.

And again, the station's entrance ends up getting dislocated from the buoy.
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Post Reply