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.
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.
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 ?
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.
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.
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:
$ 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)