Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#9447 closed defect (fixed)

Crash when moving around groups in contact list or moving them in and out of it

Reported by: tgos Owned by: evands
Milestone: Adium 1.3 Component: Adium Core
Version: Severity: normal
Keywords: Cc:
Patch Status: Accepted


Hi evands,

I owe you that one, so here you go :P

Now since you fixed the issue that per account settings were not stored, I re-ordered my contact list and permanently got crashes. I moved groups in and out of the contact list and got crashes as well. The crashlogs are absolutely useless, see below:

#0	0x90a594c7 in objc_msgSend
#1	0x9080e011 in CFRelease
#2	0x90811830 in __CFArrayReleaseValues
#3	0x9080e0e6 in _CFRelease
#4	0x927dc8af in NSPopAutoreleasePool
#5	0x93526288 in NSCoreDragReceiveProc
#6	0x917f917d in DoDropMessage
#7	0x917f90ee in SendDropMessage
#8	0x917f77ba in DragInApplication
#9	0x917f60d3 in CoreDragStartDragging
#10	0x9352be2a in -[NSCoreDragManager _dragUntilMouseUp:accepted:]
#11	0x9352b423 in -[NSCoreDragManager dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:]
#12	0x9352ae7b in -[NSWindow(NSDrag) dragImage:at:offset:event:pasteboard:source:slideBack:]
#13	0x9352ef4f in -[NSOutlineView dragImage:at:offset:event:pasteboard:source:slideBack:]
#14	0x0043fff4 in -[AIListOutlineView dragImage:at:offset:event:pasteboard:source:slideBack:] at AIListOutlineView.m:611
#15	0x9352e250 in -[NSTableView _doImageDragUsingRowsWithIndexes:event:pasteboard:source:slideBack:]
#16	0x933dbe38 in -[NSTableView _performDragFromMouseDown:]
#17	0x933da79e in -[NSTableView mouseDown:]
#18	0x933da533 in -[NSOutlineView mouseDown:]
#19	0x12028d97 in -[AIVariableHeightOutlineView mouseDown:] at AIVariableHeightOutlineView.m:96
#20	0x00043e82 in -[AIBorderlessListOutlineView mouseDown:] at AIBorderlessListOutlineView.m:47
#21	0x933533e3 in -[NSWindow sendEvent:]
#22	0x93345384 in -[NSApplication sendEvent:]
#23	0x9326fe1e in -[NSApplication run]
#24	0x93263d4f in NSApplicationMain
#25	0x00003a32 in main at main.m:3

and the backtrace does not always look the same on each crash. After working with all memory debugging tricks I know, I found out that it crashes, because some object located at address 0x7c6a380 is in the autorelease pool and shall be released, but this object has already been released elsewhere.

After some more debugging I found out that the object at address is of type AIListWindowController (or probably a subclass of it). With that knowledge, I could hunt down the issue to the function

-(void)contactListDidClose:(NSNotification *)notification

Now, looking at the code, this is what I found:

AIListWindowController *window = [notification object]; 

if (window == defaultController) {
	[defaultController release];
	defaultController = nil;
} else {
// [...]
	[window release];

Might be that my UI programming knowledge is limited and I'm not the greatest ObjC expert walking around, but one thing I know for sure: You never need to release an object, that you don't have created yourself using [[xxx alloc] init] (not even if it was created using a new method).

-[NSNotification object]

returns an autoreleased object, releasing it is no good :(

It's also released within the if-case, but here, the object is checked against an instance variable of the current class and from what I've seen in the code, when this variable is set, the value is retained, so I guess this really needs to be released before setting it to nil.

Patch will be included, it solves the crashes issue for me.

I guess we are even now ;)

Attachments (3)

AISCLViewPlugin.patch (442 bytes) - added by tgos 13 years ago.
connection.2.plist (2 bytes) - added by tgos 13 years ago.
connection.plist (2 bytes) - added by tgos 13 years ago.

Download all attachments as: .zip

Change History (10)

Changed 13 years ago by tgos

Attachment: AISCLViewPlugin.patch added

Changed 13 years ago by tgos

Attachment: connection.2.plist added

Changed 13 years ago by tgos

Attachment: connection.plist added

comment:1 Changed 13 years ago by tgos

Sorry, attached an incorrect file. I'd cancel it, but I don't have permission, so I replaced it with a file of the same name and no context and selected to replace it. The Patch is of course the file with the .patch extension :-[

comment:2 Changed 13 years ago by Jordan

Milestone: Adium X 1.3
Owner: changed from nobody to Evan Schoenberg

comment:3 Changed 13 years ago by tgos

Hmm... okay, this solves the crashes, but it might have caused another bug. Either that or the bug was there before, hard to say because it kept crashing so often. Now I can't change the order of groups within the contact list any longer. Before I could, at least sometimes, most of the time it crashed when I did so, so hard to say :-/

comment:4 Changed 13 years ago by tgos

Nope, that is an intirely different issue. Sorry for the confusing, taking back the fixe adds the crashes again and still shows the same strange drag and drop behavior. This belongs to a different bug report then.

comment:5 Changed 13 years ago by Evan Schoenberg

Resolution: fixed
Status: newclosed

(In [22884]) Don't release that which is not ours. Fixes a crash after closing a detached contact list. Patch from tgos - thanks :) Fixes #9447

comment:6 Changed 13 years ago by Evan Schoenberg

(In [22885]) Merged [22884]: Don't release that which is not ours. Fixes a crash after closing a detached contact list. Patch from tgos - thanks :) Fixes #9447

comment:7 Changed 12 years ago by Robert

Patch Status: Initially IncludedAccepted
Note: See TracTickets for help on using tickets.