CTD with trunk r3744

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

CTD with trunk r3744

Post by Eric Walch »

Svengalii just wrote me:
i've just noticed where it goes wrong in trunk (r3744). system.legacy_addShipsAtPrecisely() causes the CTD. The workaround for the moment is simply
replacing with system.legacy_addShipsWithinRadius()
I wanted to test and compiled trunk also, but on 4 startups I consistently CTD-ed after launch with always the same crashlog:

Code: Select all

Application Specific Information:
objc[855]: FREED(id): message deleteJSSelf sent to freed object=0x21af3c00
[universe.unremovedEntity] Universe.m:3700: Entity <ShipEntity 0x21af3c00>{"(null)" position: (-111730, -54321.8, 528984) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT} dealloced without being removed from universe! (This is an internal programming error, please report it.)


Thread 0 Crashed:
0   libobjc.A.dylib               	0x952d6bfa _objc_error + 116
1   libobjc.A.dylib               	0x952d6c30 __objc_error + 52
2   libobjc.A.dylib               	0x952d5637 _freedHandler + 58
3   org.aegidian.oolite           	0x0015c14c -[Entity dealloc] + 136 (Entity.m:113)
4   org.aegidian.oolite           	0x001704f5 -[OOEntityWithDrawable dealloc] + 104 (OOEntityWithDrawable.m:39)
5   org.aegidian.oolite           	0x000f64df -[ShipEntity dealloc] + 1256 (ShipEntity.m:804)
6   com.apple.CoreFoundation      	0x94dba38a CFRelease + 90
7   com.apple.CoreFoundation      	0x94d87709 __CFDictionaryDeallocate + 281
8   com.apple.CoreFoundation      	0x94dba538 _CFRelease + 216
9   com.apple.Foundation          	0x9127a68f NSPopAutoreleasePool + 1007
10  com.apple.Foundation          	0x912b34b8 __NSFireTimer + 200
11  com.apple.CoreFoundation      	0x94db88f5 CFRunLoopRunSpecific + 4469
12  com.apple.CoreFoundation      	0x94db8aa8 CFRunLoopRunInMode + 88
13  com.apple.HIToolbox           	0x916222ac RunCurrentEventLoopInMode + 283
14  com.apple.HIToolbox           	0x916220c5 ReceiveNextEventCommon + 374
15  com.apple.HIToolbox           	0x91621f39 BlockUntilNextEventMatchingListInMode + 106
16  com.apple.AppKit              	0x96e796d5 _DPSNextEvent + 657
17  com.apple.AppKit              	0x96e78f88 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
18  com.apple.AppKit              	0x96e71f9f -[NSApplication run] + 795
19  com.apple.AppKit              	0x96e3f1d8 NSApplicationMain + 574
20  org.aegidian.oolite           	0x0000385f main + 35 (main.m:14)
21  org.aegidian.oolite           	0x00002c62 _start + 216
22  org.aegidian.oolite           	0x00002b89 start + 41
I tried both launching with my last commander and as a Jameson, but with my full oxp set. It was always the same object with scanClass: CLASS_BUOY that was mentioned as being de-allocated without removed
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Svengaliis report and my problem to launch trunk are probably the same. After several tries I finally managed to launch without crashing. Now I had a change to test system.legacy_addShipsAtPrecisely() in the console. It was followed to the CTD with as log:

Code: Select all

Application Specific Information:
objc[6935]: FREED(id): message deleteJSSelf sent to freed object=0x450eee00
[universe.unremovedEntity] Universe.m:3700: Entity <ShipEntity 0x450eee00>{"(null)" position: (0, 0, -50000) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} dealloced without being removed from universe! (This is an internal programming error, please report it.)


Thread 0 Crashed:
0   libobjc.A.dylib               	0x952d6bfa _objc_error + 116
1   libobjc.A.dylib               	0x952d6c30 __objc_error + 52
2   libobjc.A.dylib               	0x952d5637 _freedHandler + 58
3   org.aegidian.oolite           	0x0015c14c -[Entity dealloc] + 136 (Entity.m:113)
4   org.aegidian.oolite           	0x001704f5 -[OOEntityWithDrawable dealloc] + 104 (OOEntityWithDrawable.m:39)
5   org.aegidian.oolite           	0x000f64df -[ShipEntity dealloc] + 1256 (ShipEntity.m:804)
6   com.apple.CoreFoundation      	0x94dba38a CFRelease + 90
7   com.apple.CoreFoundation      	0x94d87709 __CFDictionaryDeallocate + 281
8   com.apple.CoreFoundation      	0x94dba538 _CFRelease + 216
9   com.apple.Foundation          	0x9127a68f NSPopAutoreleasePool + 1007
10  com.apple.AppKit              	0x96e72026 -[NSApplication run] + 930
11  com.apple.AppKit              	0x96e3f1d8 NSApplicationMain + 574
12  org.aegidian.oolite           	0x0000385f main + 35 (main.m:14)
13  org.aegidian.oolite           	0x00002c62 _start + 216
14  org.aegidian.oolite           	0x00002b89 start + 41
Its the same log as before so whenever one of my oxps is adding a ship by that command (most of the times), trunk crashes.

EDIT: I forgot to mention that it was a trader that I tried to add at [0, 0, -50000]. That position is consistent with the one in the crashlog.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

The same bug also affected legacy_spawnShip()... fixed now! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Kaks wrote:
The same bug also affected legacy_spawnShip()... fixed now! :)
Fix confirmed, no crashes anymore on using that command.

The fix of removing the line [ship release]; seems logic seeing the log about dealloced memory, but that line has been there since at least Oolite 1.65. Why didn't it give problems before?
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Yep, that confused me too, for a while.

Before rev3701, the code did call newShipWithRole: directly - after calling that function, you always need to release the object, otherwise you have memleaks.

This cleanup already happens inside the new internal function we're using since rev3701 (addShipWithRole: launchPos: rfactor: - and it does a few other bits too) Unfortunately, after refactoring, I didn't remove the now redundant bit of code, or check those two legacy functions properly, as I should have done... :(
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
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:

Post by Eric Walch »

Kaks wrote:
....Before rev3701, ......after refactoring, ... :(
refactoring sometimes has strange side effects. One was that legacy_spawnShip("foo") now expects a role as parameter while it used to be a shipKey as parameter. For ships added with this rare command, the method was broken since, unless the key was the same as the role.

Will be fixed soon.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: CTD with trunk r3744

Post by Kaks »

Thanks! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Post Reply