bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #27311] Keyed archiving related exceptions with NSScrollView


From: Quentin Mathé
Subject: [bug #27311] Keyed archiving related exceptions with NSScrollView
Date: Thu, 27 Aug 2009 11:42:09 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/2009033100 Ubuntu/9.04 (jaunty) Firefox/3.0.8

Follow-up Comment #2, bug #27311 (project gnustep):

Hi Fred,

Thanks for the explanation :-) My conclusion was too quick indeed.

After further investigations, I found the problem was elsewhere. It seems
there is a problem when a scrollview with no visible vertical scroller is
unarchived. I attached a patch and an updated test example which gives me a
'nil subview insertion' exception.

The stack trace is:
#0  -[NSException raise] (self=0x9c015d0, _cmd=0xb7a8ea60) at
NSException.m:835
#1  0xb78f8181 in +[NSException raise:format:arguments:] (self=0xb7a8e840,
_cmd=0xb7a8ea48, name=0xb7a8e5d0, 
    format=0xb7ed7e40, argList=0xbfadb40c "`k�t") at NSException.m:785
#2  0xb78f80be in +[NSException raise:format:] (self=0xb7a8e840,
_cmd=0xb7ed8fa8, name=0xb7a8e5d0, 
    format=0xb7ed7e40) at NSException.m:771
#3  0xb7d6e22e in -[NSView addSubview:positioned:relativeTo:]
(self=0x9c010e0, _cmd=0xb7ed9168, aView=0x0, 
    place=NSWindowAbove, otherView=0x0) at NSView.m:709
#4  0xb7d6e1c4 in -[NSView addSubview:] (self=0x9c010e0, _cmd=0xb7eb4880,
aView=0x0) at NSView.m:696
#5  0xb7d1c92e in -[NSScrollView initWithCoder:] (self=0x9c010e0,
_cmd=0xb7a99188, aDecoder=0x9c040e8)
    at NSScrollView.m:1600
#6  0xb79176d0 in -[NSKeyedUnarchiver(Private) _decodeObject:]
(self=0x9c040e8, _cmd=0xb7a99148, index=3)
    at NSKeyedUnarchiver.m:219
#7  0xb7917109 in -[NSKeyedUnarchiver(Internal) _decodeArrayOfObjectsForKey:]
(self=0x9c040e8, 
    _cmd=0xb7a661f8, aKey=0xb7a656d8) at NSKeyedUnarchiver.m:114
#8  0xb7837934 in -[GSMutableArray initWithCoder:] (self=0x9c01080,
_cmd=0xb7a99188, aCoder=0x9c040e8)
    at GSArray.m:541
#9  0xb79176d0 in -[NSKeyedUnarchiver(Private) _decodeObject:]
(self=0x9c040e8, _cmd=0xb7a99148, index=2)
    at NSKeyedUnarchiver.m:219
#10 0xb791a1cf in -[NSKeyedUnarchiver decodeObjectForKey:] (self=0x9c040e8,
_cmd=0xb7ed9820, aKey=0xb7ed7f60)
    at NSKeyedUnarchiver.m:600
#11 0xb7d7cd6f in -[NSView initWithCoder:] (self=0x9c00e90, _cmd=0xb7a99188,
aDecoder=0x9c040e8)
    at NSView.m:4507
#12 0xb79176d0 in -[NSKeyedUnarchiver(Private) _decodeObject:]
(self=0x9c040e8, _cmd=0xb7a99148, index=1)
    at NSKeyedUnarchiver.m:219
#13 0xb791a1cf in -[NSKeyedUnarchiver decodeObjectForKey:] (self=0x9c040e8,
_cmd=0xb7a991b8, aKey=0xb7a98b4c)
    at NSKeyedUnarchiver.m:600
#14 0xb7917e14 in +[NSKeyedUnarchiver unarchiveObjectWithData:]
(self=0xb7a98fc0, _cmd=0xb6f111a8, 
    data=0x9c05e60) at NSKeyedUnarchiver.m:316

I think the problem is invisible most of the time because scroll views
(especially the ones created in Gorm) tends to use a vertical scroller by
default. 
I'm not sure to fully understand the scroll view unarchiving code, I added
several notes/questions in the patch itself. 
The scroll view archives/unarchives its subviews, at least that's what I
expect, so I don't see why -addSubview: vScroller was added here.

For the plist generator, why not define an enum {
GSPLGeneratorWritingSuccess, GSPLGeneratorWritingTableIndexFull } and use it
as the return type of -writeObject:, -storeObject: and -markOffset:for:. 
Then in -generate, you can do:

  while (!done && (index_size <= 4))
    {
          [self setup];
          if ([self writeObjects] == GSPLGeneratorWritingTableIndexFull)
            {
              [self cleanup];
              index_size += 1;
            }
          else // GSPLGeneratorWritingSuccess
            {
              done = YES;
            }
    }


(file #18649, file #18650)
    _______________________________________________________

Additional Item Attachment:

File name: KeyedArchiverTableViewTest.tar.gz Size:2 KB
File name: NSScrollView-archiving.m.patch Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27311>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]