Missiles crasher trunk r4913

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Missiles crasher trunk r4913

Post by Capt. Murphy »

Hi,

I've noticed some anomalous behaviour with missiles on purchasing ships via the shipyard in the normal way.

If the current ship's pylons are empty on buying a new ship, the new ships pylons are empty.
If the current ship has pylon mounted equipment it is transferred to the new ship (subject to available pylon space). Is this the way it is supposed to be?

I can also reliably crash trunk r4913 taking the following steps.

Start a new Jameson - manually remove all 3 missiles using player.ship.removeEquipment("EQ_MISSILE").
Purchase a missile normally. On attempting to remove that missile with player.ship.removeEquipment("EQ_MISSILE") the game will crash.

Alternatively start a new Jameson - buy a 4th missile. Remove all 4 missiles using player.ship.removeEquipment("EQ_MISSILE"). On removing the 4th missile the game will crash.

Edit to add - bug also present in 1.76.1 maintenance build
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Missiles crasher trunk r4913

Post by cim »

Capt. Murphy wrote:
I can also reliably crash trunk r4913 taking the following steps.
Edit to add - bug also present in 1.76.1 maintenance build
Confirmed - I'll see if I can figure out what's going on.
Thanks
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: Missiles crasher trunk r4913

Post by Eric Walch »

Capt. Murphy wrote:
Start a new Jameson - manually remove all 3 missiles using player.ship.removeEquipment("EQ_MISSILE").
Purchase a missile normally. On attempting to remove that missile with player.ship.removeEquipment("EQ_MISSILE") the game will crash.

Alternatively start a new Jameson - buy a 4th missile. Remove all 4 missiles using player.ship.removeEquipment("EQ_MISSILE"). On removing the 4th missile the game will crash.
It does not crash with me on a mac with my usual oxp set. Have you tried it without oxp's? If not, an oxp might be involved also. But cim can reproduce so he will be able to generate a backtrace.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Missiles crasher trunk r4913

Post by Capt. Murphy »

Just tested trunk with no OXPs and still crashes. SDL build issue?
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Missiles crasher trunk r4913

Post by cim »

It looks like a memory management race condition, where a string can be deallocated by the garbage collector just before it's needed. That's also fits with it being platform dependent, and also with it not happening every time a missile is removed.

If that's the case, r4294 should fix it.

[EDIT: and r4295 for the maintenance branch]
Last edited by cim on Sat May 12, 2012 11:45 am, edited 1 time in total.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Missiles crasher trunk r4913

Post by Capt. Murphy »

cim wrote:
If that's the case, r4294 should fix it.
Seems to have done the trick. Thanks cim.

edit to add - 68 mins from bug report to bug fix....got to be a record?
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
Post Reply