bugGNUstep - Bugs: bug #32378, Exception when starting ANY...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #32378: Exception when starting ANY application....

Submitted by:  Gregory John Casamento <gcasa>
Submitted on:  Mon 07 Feb 2011 06:53:12 AM UTC  
 
Category: Base/FoundationSeverity: 5 - Blocker
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Fri 11 Feb 2011 11:55:58 PM UTC, comment #3:

Verified on multiple platforms. Thanks.

Gregory John Casamento <gcasa>
Project Administrator
Mon 07 Feb 2011 05:28:53 PM UTC, comment #2:

I fixed that issue and a couple of other minor things while I was looking.
Please check that all is working OK, and if so, close this issue.

Richard Frith-Macdonald <CaS>
Project Member
Mon 07 Feb 2011 07:08:31 AM UTC, comment #1:

+ (id) currentLocale
{
NSLocale *result;

[classLock lock];
if (nil == currentLocale)
{
NSString *localeId;
[classLock unlock];

localeId =
[[NSUserDefaults standardUserDefaults] objectForKey: @"Locale"];

[classLock lock];
if (currentLocale == nil)
currentLocale = [[NSLocale alloc] initWithLocaleIdentifier: localeId];
}
result = RETAIN(currentLocale);
[classLock unlock];
return AUTORELEASE(result);
}

If "Locale" in my user defaults is nil, then it seems like it's pretty much doomed to failure, since...

- (id) initWithLocaleIdentifier: (NSString*)string
{
NSLocale *newLocale;
NSString *localeId;
#if GS_USE_ICU == 1
int32_t length;
char cLocaleId[ULOC_FULLNAME_CAPACITY];
UErrorCode error = U_ZERO_ERROR;

localeId = [NSLocale canonicalLocaleIdentifierFromString: string];
// Normalize locale ID
length = uloc_canonicalize ([localeId UTF8String], cLocaleId,
ULOC_FULLNAME_CAPACITY, &error);
if (U_FAILURE(error))
{
[self release];
return nil;
}

localeId = [NSString stringWithUTF8String: cLocaleId];
#else
localeId = [NSLocale canonicalLocaleIdentifierFromString: string];
#endif

[classLock lock];
newLocale = [allLocales objectForKey: localeId];
if (nil == newLocale)
{
_localeId = [localeId copy];
[allLocales setObject: self forKey: localeId];
}
else
{
[self release];
self = [newLocale retain];
}
[classLock unlock];

_components = [[NSMutableDictionary alloc] initWithCapacity: 0];

return self;
}

It's passing nil into the init function here and then getting the canonicalized locale identifier from the nil value which was passed in... it then attempts get newLocale based on the "canonicalized" nil value which, of course is also nil.... and the proceeds to set that nil object into allLocales which throws the exception.

Gregory John Casamento <gcasa>
Project Administrator
Mon 07 Feb 2011 06:53:12 AM UTC, original submission:

Breakpoint 1, -[NSException raise] (self=0x2ae9800, _cmd=0x7f852ad5fc40) at NSException.m:955
(gdb) bt
#0 -[NSException raise] (self=0x2ae9800, _cmd=0x7f852ad5fc40) at NSException.m:955
#1 0x00007f852a8686ba in -[GSMutableDictionary setObject:forKey:] (self=0x2ae5ce0, _cmd=<value optimized out>, anObject=0x2ae7be0, aKey=0x0) at GSDictionary.m:419
#2 0x00007f852a941e57 in -[NSLocale initWithLocaleIdentifier:] (self=0x2ae7be0, _cmd=<value optimized out>, string=<value optimized out>) at NSLocale.m:745
#3 0x00007f852a94269f in +[NSLocale currentLocale] (self=<value optimized out>, _cmd=<value optimized out>) at NSLocale.m:436
#4 0x00007f852a951fea in -[NSNumberFormatter init] (self=<value optimized out>, _cmd=<value optimized out>) at NSNumberFormatter.m:430
#5 0x00007f8522c3b60d in -[DataPalette finishInstantiate] (self=0x2aa2750, _cmd=0x7f852bf882c0) at DataPalette.m:306
#6 0x00007f852bcfeeab in -[GormPalettesManager loadPalette:] (self=0x2643b50, _cmd=0x7f852bf88130, path=0x2a9fe10) at GormPalettesManager.m:529
#7 0x00007f852bcfdeed in -[GormPalettesManager init] (self=0x2643b50, _cmd=0x60ca60) at GormPalettesManager.m:360
#8 0x000000000040658a in -[Gorm palettesManager] (self=0x24c0cd0, _cmd=0x60cb50) at Gorm.m:1031
#9 0x00000000004023f6 in -[Gorm init] (self=0x24c0cd0, _cmd=0x7f852b4a4690) at Gorm.m:166
#10 0x00007f852b02971e in +[NSApplication sharedApplication] (self=<value optimized out>, _cmd=<value optimized out>) at NSApplication.m:839
#11 0x00007f852b00f5f4 in NSApplicationMain (argc=<value optimized out>, argv=<value optimized out>) at Functions.m:76
#12 0x0000000000407b87 in main (argc=1, argv=0x7fff341cb4c8) at main.m:30

Gregory John Casamento <gcasa>
Project Administrator

 

Attached Files
file #22615:  error_panel.png added by gcasa (7KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by gcasa (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 11 Feb 2011 11:55:58 PM UTCgcasaOpen/ClosedIn Test=>Closed
    Mon 07 Feb 2011 05:28:53 PM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>In Test
    Mon 07 Feb 2011 06:53:12 AM UTCgcasaAttached File-=>Added error_panel.png, #22615

    Back to the top


    Powered by Savane 3.1-cleanup1