Okay, here's another problem that's apparently been exposed by the recent 
changes to retains when loading a nib. It appears there is a problem in the way 
objects retain/release each other in the text system.

We have an NSSecureTextField in a panel loaded from a nib file. When the panel 
is displayed, it tries to setup the secure text field which replaces the layout 
manager with a secure layout manager. But when replaceLayoutManager: calls 
[textStorage removeLayoutManager: _layoutManager] this results in the 
textStorage object itself being freed, and it crashes on the next line. I tried 
to figure out what was going on, but there are a lot of subtle interconnections 
in the text system, so I'm not sure exactly what isn't being retained that 
needs to be (or is being released that shouldn't be!).

Here's what the crash looks like:

Program received signal SIGSEGV, Segmentation fault.
0x67848ae6 in objc_msg_lookup () from c:\GNUstep\GNUstep\System\Tools\objc-1.dll
(gdb) bt
#0  0x67848ae6 in objc_msg_lookup () from 
c:\GNUstep\GNUstep\System\Tools\objc-1.dll
#1  0x63c24e04 in -[NSTextContainer replaceLayoutManager:] (self=0x9de34b0, 
_cmd=0x63d65b38,
    aLayoutManager=0x144b890) at NSTextContainer.m:171
#2  0x63bee87e in -[NSSecureTextView initWithFrame:textContainer:] 
(self=0x1401ea0,
    _cmd=0x63db4870, frameRect={origin = {x = 0, y = 0}, size = {width = 0, 
height = 0}},
    aTextContainer=0x9de34b0) at NSSecureTextField.m:305
#3  0x63c9e5f1 in -[NSTextView initWithFrame:] (self=0x1401ea0, 
_cmd=0x63d8b058, frameRect=
        {origin = {x = 0, y = 0}, size = {width = 0, height = 0}}) at 
NSTextView.m:744
#4  0x63c3aa9c in -[NSView init] (self=0x1401ea0, _cmd=0x63d65aa8) at 
NSView.m:566
#5  0x63bee378 in -[NSSecureTextFieldCell setUpFieldEditorAttributes:] 
(self=0x15a35a0,
    _cmd=0x63d7df98, textObject=0x1290ee0) at NSSecureTextField.m:209
#6  0x63c2649e in -[NSTextField selectText:] (self=0x994d9d0, _cmd=0x63d7e070, 
sender=0x994d9d0)
    at NSTextField.m:181
#7  0x63c26e17 in -[NSTextField becomeFirstResponder] (self=0x994d9d0, 
_cmd=0x63d91b70)
    at NSTextField.m:431
#8  0x63c53285 in -[NSWindow makeFirstResponder:] (self=0x16594c0, 
_cmd=0x585240,
    aResponder=0x994d9d0) at NSWindow.m:3176

On Mar 22, 2010, at 3:44 PM, Doug Simons wrote:

> Thanks Fred,
> 
> It looks like that has fixed the problem with NSApp. It also appears to have 
> solved the other problem that I reported to you privately. We will do some 
> more testing and let you know if we run into any other problems with nib 
> loading. Thanks for the quick fix!
> 
> Regards,
> 
> Doug
> 
> On Mar 22, 2010, at 3:27 PM, Fred Kiefer wrote:
> 
>> Thank you for pointing out the problem with NSApp. This was caused by a
>> missing retain in some part of GSNibLoading that I hadn't cleaned up.
>> 
>> Hopefully this is fixed now. If there are any other issues I hope we can
>> resolve them as quick as that one.
>> 
>> Fred
>> 

_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to